
function closeMessage(obj,transObj)
{
	
	document.getElementById(obj).style.display = "none";
	document.getElementById(transObj).style.display = "none";
 
	
} 
function displayWelcomePopup1(){
   
    displayPopupAtCenter('pop6','pop4');
    document.getElementById('pop4').style.display = "block";
   document.getElementById('pop6').style.display = "block";    
 }
function findPos(obj){
      var curleft = curtop = 0;
      if (obj.offsetParent) {
            curleft = obj.offsetLeft;
            curtop = obj.offsetTop;
            while (obj = obj.offsetParent) {
                  curleft += obj.offsetLeft;
                  curtop += obj.offsetTop;
            }
      }
      return [curleft,curtop];
}
// set the popup coordinates, to display at center
function displayPopupAtCenter(obj,transObj){
        //to display the popup at the center
        var centerWidth=screen.width/2;
	    var centerHeight=screen.height/2;
	    var tipLeft = centerWidth - document.getElementById(obj).style.width.replace("px","")/2;
	    //var tipTop = centerHeight - centerHeight*5/8 ;// document.getElementById("modalMessageContent").style.height.replace("px","")*7/8;
	    var divLeft = tipLeft + "px";
	   // var divTop= tipTop + "px";	
	    var ht=0;
	    var wd=screen.width-20;
		document.getElementById(obj).style.left=divLeft;
		document.getElementById(obj).style.top='20px';
		// getting the ht of the page by placing a div below the footer in the layout
 		var cor=findPos(document.getElementById('togetposition'));
 		//small gap was comming at the bottom of the page so added few coordinates
 		 ht=cor[1]+8;	
 		// to remove the scroll bar at the bottom 	 
 		if(navigator.userAgent.indexOf("MSIE")!=-1){ 		
 		wd=wd-21;
 		} 
        document.getElementById(transObj).style.width=wd+"px";
        document.getElementById(transObj).style.height=ht+"px";
}
function disablePopup(obj,transObj){
   document.getElementById(transObj).style.display = "none";
   document.getElementById(obj).style.display = "none";  
 }  
 
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}


