function cacheImages()
{
	var i;
	
	var oImages = new Array(document.images.length);			//array of image objects
	//reset all rollover images to their "off" state
	for (i=0; i<document.images.length; i++)
	{
		if ( document.images[i].src.search(/\_off\.(gif|jpg)/) > 0 )
		{	
			oImages[i] = new Image();
			oImages[i].src = document.images[i].src.replace("_off.", "_on.");
		}
	}
	return;
}

function setImage(oImage)
{
	var i;

	//first reset all rollover images to their "off" state
	for (i=0; i<document.images.length; i++)
	{
		if ( document.images[i].src.search(/\_on\.(gif|jpg)/) )
			document.images[i].src.replace("_on.", "_off.");
	}
	
	//now set the image to be in the "on" state		
	oImage.src = oImage.src.replace("_off.", "_on.");
				
	return;
}

function clearImages()
{
	var i;
	
	//reset all rollover images to their "off" state
	for (i=0; i<document.images.length; i++)
	{
		if ( document.images[i].src.search(/\_on\.(gif|jpg)/) > 0 )
			document.images[i].src = document.images[i].src.replace("_on.", "_off.");
	}
	return;
}

function openWindow(url, name, resize, width, height, scroll, center)
{
	var sParams = '';
	name = (name == null) ? '' : name;

	sParams += 'width=' + width;
	sParams += ',height=' + height;
	sParams += (resize || resize == 'true') ? ',resizable=yes' : ',resizable=no';
	sParams += (scroll || scroll == 'true') ? ',scrollbars=yes' : ',scrollbars=no';
	sParams += (center || center == 'true') ? ',left=' + ((screen.width - width) / 2) : '';
	sParams += (center || center == 'true') ? ',top=' + ((screen.height - height) / 2) : '';

	window.name = 'opener';
	var popupWin = window.open(url, name, sParams);
	return ;
}

function getDHTMLObj(objName)
{
	if (document.getElementById)
		return document.getElementById(objName);
	else if (document.all)
		return document.all[objName];
	else if (document.layers)
		return document.layers[objName];
	else
		return null;
} 

function openPrivacy()
{
	window.open('http://www.coty.com/terms_sweep.html','privacy','scrollbars=yes,status=no,width=790,height=400')
}


function OpenContest()
    {
        window.open('/contest/default.aspx','contest','scrollbars=no,status=no,width=990,height=605')
    }

function OpenPrivacy()
    {
        window.open('http://www.coty.com/privacy_policy.html','privacy','scrollbars=yes,status=no,width=780,height=605')
    }

function OpenRules()
    {
        window.open('/contest/rules.aspx','rules','scrollbars=yes,status=no,width=780,height=605')
    }