 function getCookie(c_name){
        
        if (document.cookie.length>0){
            var c_start=document.cookie.indexOf(c_name + "=");
           
            if (c_start!=-1){
                c_start=c_start + c_name.length+1;
                var c_end=document.cookie.indexOf(";",c_start);
                if (c_end==-1) c_end=document.cookie.length;
                //return unescape(document.cookie.substring(c_start,c_end));
                return "";
            }
        }
        return "";
    }
   
    function setCookie(c_name,value,expiredays){
        var exdate=new Date();
        exdate.setDate(exdate.getDate()+expiredays);
        //document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
    }
    
    function checkCookie(){
    
        var firstTimer=getCookie('firstTimer');
       
          blanket_size('popup');
          window_pos('popup');
          
        if (firstTimer==""){
            //document.getElementById('blanket').style.display='block'
          setTimeout('document.getElementById(\"blanket\").style.display=\"block\"', 10000);
          setTimeout('document.getElementById(\"popup\").style.display=\"block\"', 10000);
          setCookie('firstTimer',1,365);
        }
    }
    
    function blanket_size(popUpDivVar) 
    {
        
        var viewportheight;
        
	    if (typeof window.innerWidth != 'undefined') 
	    {
		    viewportheight = window.innerHeight;
	    } 
	    else 
	    {
		    viewportheight = document.documentElement.clientHeight;
	    }
	    if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) 
	    {
		    blanket_height = viewportheight;
	    } 
	    else 
	    {
		    if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) 
		    {
			    blanket_height = document.body.parentNode.clientHeight;
		    } 
		    else 
		    {
			    blanket_height = document.body.parentNode.scrollHeight;
		    }
	    }
	    var blanket = document.getElementById('blanket');
	    //blanket.style.height = blanket_height + 'px';
	    blanket.style.height = window.screen.height + 'px';
	    var popUpDiv = document.getElementById(popUpDivVar);
	    //popUpDiv_height=blanket_height/2-150;//150 is half popup's height
	    popUpDiv_height=window.screen.height/2-150;
	    popUpDiv.style.top = popUpDiv_height + 'px';
    }
    function window_pos(popUpDivVar) 
    {
	    if (typeof window.innerWidth != 'undefined') 
	    {
		    viewportwidth = window.innerHeight;
	    } 
	    else 
	    {
		    viewportwidth = document.documentElement.clientHeight;
	    }
	    if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) 
	    {
		    window_width = viewportwidth;
	    } 
	    else 
	    {
		    if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) 
		    {
			    window_width = document.body.parentNode.clientWidth;
		    } 
		    else 
		    {
			    window_width = document.body.parentNode.scrollWidth;
		    }
	    }
	    var popUpDiv = document.getElementById(popUpDivVar);
	    window_width=window_width/2-150;//150 is half popup's width
	    //popUpDiv.style.left = window_width + 'px';
	    popUpDiv.style.left = window.screen.width/2-250 + 'px';
    }
    
    
    function closeit(){
        document.getElementById("popup").style.display="none";
        document.getElementById("blanket").style.display="none";
    }
