
		var loginDialog;
		function initloginDialog() {
			//alert('init login dialog');
			loginDialog = new DIGITAS.dialog.PopoverBox("loginBox",
			{
				effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.45},
				underlay:"none",
				close:true,
				fixedcenter:true,
				visible:false,
				draggable:false,
				modal:true,
				width:"518px",
				zIndex: 300,
				target:document.body
			} );
			YAHOO.util.Dom.setStyle("loginBox","display", "block");
			//loginDialog.maskOpacity=1;
			loginDialog.onAnimationComplete = function() {
				
			};
			
			loginDialog.originalContent = document.getElementById('loginBox').innerHTML;
			loginDialog.render();
		}
		function showLoginDialog() {
			try{
			var bgImg= g_imageHost+"/"+g_siteid+"/bg-login-"+g_sender+"-"+g_state+".jpg";
			YAHOO.log('bgImg'+bgImg);
			//paul mccartney specific background
			/*
			if(g_sender == 'amex' && g_siteid == 'paul-mccartney' && g_state == "preshow"){ 
				bgImg= g_imageHost+"/"+g_siteid+"/bg_login_p.jpg";
			}*/
			
			YAHOO.util.Dom.setStyle("loginBox","background-image",'url('+bgImg+')');
			if (loginDialog.originalContent != document.getElementById('loginBox').innerHTML) {
				document.getElementById('loginBox').innerHTML = loginDialog.originalContent;
				
				loginDialog.render();
			}
			var tracId=new Array("unlockButton");
			attachMouseUpEvent(tracId);
			loginDialog.show();
			} catch(e){
			 	YAHOO.log('error in showLoginDialog----'+e.message);
			 	 return false;
			 } 
			// TODO, this does not cancel the A href click.  I needed to hardcode a onclick="return false" on the element (not ideal)
			return false;
		}
		//initialize the loginDialog in index.jsp
	

	function showLoginOverlay(){
		showLoginDialog();
	}
	
	
	function hideLoginOverlay(){
		loginDialog.hide();
	}
	/*
	 * called by unlockButton buton on login-box.
	 */
	function unlockButtonHandler(e) {
		//alert('hide login');
		//create a cookie 
		var code = Querystring_get('access');
		//alert(' Code=?'+code+" Site?"+ g_siteid);
		var cName = g_siteid+"-"+code;
		var cValue= g_siteid+"-"+code;
		document.cookie=cName +"="+cValue+";expires=; path=/";

		hideLoginOverlay();
		return false;
	}

