if (document.images) {
	var logo_over = new Image();
	logo_over.src = "images/logo_on.gif";
	var logo_off = new Image();
	logo_off.src = "images/logo_off.gif";
}

function over(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + "_over.src");
	}
}
function off(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + "_off.src");
	} 
}

function OpenPopup(url, width, height) 
{
	window.open(url, 'newWindow','resizable=1,scrollbars=no,width='+ width + ',height=' + height);
} 

function SendToFriend(customQueryString) 
{
    var currentUrl = window.location.href;
			
	if (customQueryString.length > 0)
	{
		if (currentUrl.indexOf('?') != -1)
		{
			currentUrl += "&" + customQueryString;
		}
		else
		{
			currentUrl += "?" + customQueryString;
		}
	}
	
	OpenPopup("/SendToFriend.aspx?url="+escape(currentUrl), '700', '520');			
}

function BookmarkPage(customQueryString, pageName)
{
	var currentUrl = window.location.href;
			
	if (customQueryString.length > 0)
	{
		if (currentUrl.indexOf('?') != -1)
		{
			currentUrl += "&" + customQueryString;
		}
		else
		{
			currentUrl += "?" + customQueryString;
		}
	}
	
	if ((navigator.appName.indexOf("Microsoft",0)>=0) && (parseInt(navigator.appVersion)>=4) && navigator.platform == 'Win32')
	{
		window.external.AddFavorite(currentUrl, pageName);
	} 
	
	else 
	{
		alert("Please click Ctrl+D or 'Apple'+D (Safari) to add this page to your bookmarks.");
	}

}

function flashPutHref(newHash) { 

	location.hash = newHash; 


	
	flashPutTitle('MOVADO');
}
function flashPutTitle(newTitle) { document.title = newTitle; }


function getWinSize()
{
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' )
    {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    }
    else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
    {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    }
    else if(document.body && (document.body.clientWidth || document.body.clientHeight))
    {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
    return {w:myWidth,h:myHeight}
    
}


//1135x818 size of swf
function ResizeToRatio(Id)
{
	var winSizes = getWinSize();
	var availHeight = screen.availHeight;
	var availWidth = screen.availWidth;
	
	window.resizeTo(availWidth,availHeight);
	
	var yBar = availHeight - winSizes.h;
	
	var sx = availWidth;
	var sy = availHeight-yBar;
	var x = 1135;
	var y = 818;
	
	var flashRatioXY = x/y;
	var flashRatioYX = y/x;
	
	var xDelta = sx - x;
	var yDelta = sy - y;
	
	var newX = x+xDelta;
	var xRatio = (newX)*flashRatioYX;
	var newY = (y+yDelta);
	var yRatio = newY*flashRatioXY;
	
	var winSizes = getWinSize();

	if(xDelta < yDelta){
		window.resizeTo(newX,xRatio+yBar);
		self.moveTo((screen.availWidth-(newX))/2,0);
		//alert('newX ' + newX + ' xRatio ' + xRatio + ' new ratio ' + newX/xRatio);
	}else if(xDelta > yDelta){
		window.resizeTo(yRatio,newY+yBar);
		self.moveTo((screen.availWidth-(yRatio))/2,0);
		//alert('newY ' + newY + ' yRatio ' + yRatio + ' new ratio ' + yRatio/newY);
	}
}	
