 //document.getElementById("pageTitle").innerHTML = "Shop & Earn";
 //document.getElementById("sb_lnkClientHome").innerHTML = "Search & Win";
 //document.getElementById("sb_lnkRefer").innerHTML = "Invite your friend";
 //document.getElementById("sb_lnkSwagStore").innerHTML = "Swag Store";
 //document.getElementById("sbhdr_lnkClientHome").href = "/?cmd=sb-shopping";
  directToReg = false;
  
  function scroll2TopNonIe() {
    var msie = ((navigator.appVersion.indexOf("MSIE")!= -1)&&!window.opera)? true : false;
    if (! msie) {
        scroll(0,0);
    }
  }
  var oldHeader;
  function showNonMemberBox(title, cancelUrl) {
	if (typeof(isSwagstore30)!="undefined") {
		showDiaologLogin(title, cancelUrl);
		return;
	}
    coverObj = document.getElementById("fadeCover");
    coverObj.style.display = "block";
    popupObj = document.getElementById("dvPopupLogin");
    popupObj.style.width = "270px";
    popupObj.style.left = "50%";
    popupObj.style.top = "50%";
    popupObj.style.right = "auto";
    popupObj.style.display = 'block';
    popupObj.style.position = 'absolute';
    document.getElementById("dvPopupLoginTop").removeChild(popupObj);
    document.getElementById("popupContainer").insertBefore(popupObj, null);
    centerElement(popupObj);
	boxTitle = document.createElement("DIV");
    popupObj.insertBefore(boxTitle, document.getElementById("loginType"));
    boxTitle.style.position = "absolute";
    boxTitle.style.margin = "-23px 0 0";
    boxTitle.style.width = "265px";
	boxTitle.style.height = "18px";
    boxTitle.style.background = "url(/content/top-bar/images/centerBar.jpg) left top repeat-x";	
    boxTitle.style.fontFamily = "Arial,Helvetica,Sans-Serif";
	boxTitle.style.fontWeight = "bold";
	boxTitle.style.fontSize = "12px";
	boxTitle.style.lineHeight = "12px";	
	boxTitle.style.color = "#272727";
	boxTitle.style.padding = "5px 0 0 5px";
	boxTitle.innerHTML = '<div class="popClose" onclick="cancelShopLogin();">X</div>' + title;
	document.getElementById("cancelImg").onclick = function() {cancelShopLogin();}
	initFB();	
	//titleBar =  document.getElementById("tbrTitleBar");
	//var popupTitle = title;
    //titleBar.innerHTML = '<span class="tbr-dialog-title">Swag Bucks&#8482;&nbsp;' + popupTitle + '</span>' +
    //'<img class="dialog-close" title="Close" onclick="cancelShopLogin();" src="/images/sb/x-grey.gif"' +
    //'onmousedown="this.style.marginTop=\'7px\'; this.style.marginRight=\'2px\'"' + 
    //'onmouseout="this.style.marginTop=\'6px\'; this.style.marginRight=\'3px\'" onmouseout="this.style.marginTop=\'6px\'; this.style.marginRight=\'3px\'">';
    //titleBar.style.width = "354px"
    //titleMsg = document.getElementById("tbrTitleMessage");
    //oldHeader = titleMsg.innerHTML;
    //lineMsg is defined in the refering document.
	//titleMsg.innerHTML = lineMsg;
    //document.getElementById("tbar-cancel-popup").style.display = "none";
    //document.getElementById("tbar-register-popup").style.display = "";
    //titleLnks = document.createElement("DIV");
    //document.getElementById("frmLogIn-tbar").insertBefore(titleLnks, null);
    //titleLnks.id = "tbrDialogLinks";
    //titleLnks.innerHTML = '<a href="#" onclick="cancelShopLogin(); return false;">Continue without earning Swag Bucks</a>';
	//titleLnks.style.paddingBottom = '10px';
  }
  
  function centerElement(el) {
      clientX = (self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || document.body.scrollWidth);
      clientY = (self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || document.body.scrollHeight);
      scrollX = (self.pageXoffset || document.documentElement.scrollLeft || document.body.scrollLeft);
      scrollY = (self.pageYoffset || document.documentElement.scrollTop || document.body.scrollTop);
      el.style.marginLeft = "-" + ((el.clientWidth / 2) - scrollX) + "px" 
      el.style.marginTop = "-" + ((el.clientHeight / 2) - scrollY) + "px" 
  }

function cancelShopLogin() {
    popupLogin = document.getElementById("dvPopupLogin");
    popupLogin.style.display = "none";
    fadedCover = document.getElementById("fadeCover");
    fadedCover.style.display = "none";
    //boxTitle.style.display = "none";
	popupObj.style.left = "auto";
    popupObj.style.top = "0";
    popupObj.style.right = "0";
    popupObj.style.display = 'inline';
    popupObj.style.position = 'relative';
	popupObj.style.margin = "0";


    popupObj.removeChild(boxTitle);

//popupObj.style.width = "270px";
//	popupLogin.style.left = "auto";
//    popupLogin.style.top = "auto";
//    popupLogin.style.marginLeft = "auto";
//    popupLogin.style.marginTop = "auto";
//    popupLogin.style.right = "0";
//    popupObj.style.position = 'relative';
    //titleBar = document.getElementById("tbrTitleBar");
    //titleBar.innerHTML = '<span class="tbr-dialog-title">Swag Bucks&#8482;</span>' +
    //'<img class="dialog-close" title="Close" onclick="cancelShopLogin();" src="/images/sb/x-grey.gif"' +
    //'onmousedown="this.style.marginTop=\'7px\'; this.style.marginRight=\'2px\'"' + 
    //'onmouseout="this.style.marginTop=\'6px\'; this.style.marginRight=\'3px\'" onmouseout="this.style.marginTop=\'6px\'; this.style.marginRight=\'3px\'">';
    //titleBar.style.width = "274px"
    //document.getElementById("tbrTitleMessage").innerHTML = oldHeader;
    //document.getElementById("tbar-cancel-popup").style.display = "";
    //document.getElementById("tbar-register-popup").style.display = "none";
    //document.getElementById("frmLogIn-tbar").removeChild(document.getElementById("tbrDialogLinks"));
    document.getElementById("popupContainer").removeChild(popupObj);
    document.getElementById("dvPopupLoginTop").insertBefore(popupObj, document.getElementById("loginContentEnd"));
	document.getElementById("cancelImg").onclick = function() {hideLoginBox();}
	if (directToReg) {
		location.href = '/?cmd=sb-register';
	}
}
  
  
