<!-- 

	var sPRODUCTION_URL="www.mycokerewards.com";
	var sPRODUCTION_IP="216.64.209.85";
	var sTEST_URL="test.mycokerewards.com";
	var sTEST_IP="216.33.74.85";
	var sSB_URL="sandbox.mycokerewards.com";
	var sSB_IP="216.33.74.85";
	var sQA_IP="mcr6.studiocom.com";
	var sDEV_IP="mcr6-dev.studiocom.com";
	var sDW="MCR.Code.Entry.widget";
	var sDW_="MCR.Code.EntryT.widget";
	var _path = "/widget/";


	// Common Functions:

	function bookmarkPage(msg)
	{
		if (window.external)
		{
			window.external.AddFavorite(window.location, document.title)
		}
		else
		{
			if(navigator.appName == "Netscape")
			alert(msg);
		}
	}
	
	function popupFile(fileName, w, h)
	{
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizable=0,menubar=0' ;
		title = 'MCRPopUp' + Math.floor(Math.random()*1000000+1);
		win = window.open(fileName, title, winprops);
		win.focus();
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}	
	
	function popupFileNoScrolls(fileName, w, h)
	{
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=0,menubar=0' ;
		title = 'MCRPopUp' + Math.floor(Math.random()*1000000+1);
		win = window.open(fileName, title, winprops);
		win.focus();
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}

	function popupFileNoMinimum(fileName, w, h)
	{
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=0,menubar=0,status=0,location=no' ;
		title = 'MCRPopUp' + Math.floor(Math.random()*1000000+1);
		win = window.open(fileName, title, winprops);
		win.focus();
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}

	function callpopupFileNoMinimum(arrayS){
                 popupFileNoMinimum(arrayS[0], arrayS[1], arrayS[2])
        }

	function goToURL(target,newWindow)
	{
		if(newWindow=='undefined')
		{
			newWindow=false;
		}
		if(!newWindow)
		{
			window.location = target;
		}
		if(newWindow)
		{
			window.open(target);
		}
	}

	function addBookmark(title,url)
	{
		//For mozilla based browsers
		if (window.sidebar)
		{
			window.sidebar.addPanel(title, url,"");
		}
		else if(document.all)
		{
			//For IE
			window.external.AddFavorite(url, title);
		}
		else if(window.opera && window.print)
		{
			return true;
		}
	}
	
	function goToTop()
	{
		 self.scrollTo(0, 0);
	}
	
function getURL(uri) {
	uri.dir = location.href.substring(0, location.href.lastIndexOf('\/'));
	uri.dom = uri.dir; 
	if (uri.dom.substr(0,7) == 'http:\/\/') uri.dom = uri.dom.substr(7);
	uri.path = ''; 
	var pos = uri.dom.indexOf('\/'); 
	if (pos > -1) {
		uri.path = uri.dom.substr(pos+1); 
		uri.dom = uri.dom.substr(0,pos);
		}
		
	uri.page = location.href.substring(uri.dir.length+1, location.href.length+1);
	
	pos = uri.page.indexOf('?');
	if (pos > -1) {
			uri.page = uri.page.substring(0, pos);
		}
	pos = uri.page.indexOf('#');
	if (pos > -1) {
			uri.page = uri.page.substring(0, pos);
		}
	uri.ext = ''; pos = uri.page.indexOf('.');
	
	if (pos > -1) {
		uri.ext =uri.page.substring(pos+1); 
		uri.page = uri.page.substr(0,pos);
		}
	uri.file = uri.page;
	if (uri.ext != '') uri.file += '.' + uri.ext;
	if (uri.file == '') uri.page = 'index';
	
	uri.args = location.search.substr(1).split("?");
	return uri;
}

function downloadWidget(){
	var uri = new Object();
	getURL(uri);
	//check test
	if(uri.dom.indexOf(sPRODUCTION_URL) != -1 || uri.dom == sPRODUCTION_IP){
		window.location = _path + sDW;
	}
	if(uri.dom == sTEST_IP || uri.dom == sTEST_URL ||uri.dom == sQA_IP ||uri.dom == sDEV_IP || uri.dom == sSB_URL || uri.dom == sSB_IP){
		window.location = _path + sDW_;
	}	
}	

function openContestRules(strAnchor){
	if(strAnchor=="undefined"||strAnchor==undefined)
		strAnchor = "";
	var l = "en_US";
	if(language == "spanish")
		l = "es_US";
	popupFile("extrapages/contestRules_"+l+".html#"+strAnchor, 640, 480);
}

function openWidgetWindow(){
	shortLang = "en";
	if(language == "spanish")
		shortLang = "es";
	popupFileNoScrolls('downloadWidget.jsp?language='+shortLang, '650', '470');
}

var memberId = "";
function setMemberId(strMemberId){
	if(strMemberId == null || strMemberId == 'null') strMemberId = '';
	memberId = strMemberId;
}

// -->