  //弹出主程序
   function openwin() {  
  	var intHours,intMinutes,intSeconds,today,url;
  	url='http://www.testingatchina.com/webnetwang/index.php?option=com_email&Itemid=61';
  	today=new Date();
  	intHours=today.getHours();  
  	intMinutes=today.getMinutes();
    intSeconds=today.getSeconds(); 
  	//alert (intHours);            
  	if((intHours >= 8 && intHours<=20))
  	{    
  		//alert (intSeconds);                                                                                                          
     window.open (url, "newwindow", "height=480, width=760, top=100,left=100 toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no")
    }
  }
  function openwin2() {  
  	var intHours,intMinutes,intSeconds,today,url;
  	url='http://img.alimama.cn/cms/images/1275374651480.html?pid=mm_10779711_819882_8763333';
  	today=new Date();
  	intHours=today.getHours();  
  	intMinutes=today.getMinutes();
    intSeconds=today.getSeconds(); 
  	//alert (intHours);  
  	 window.open (url, "newwindow2", "height=480, width=760, top=100,left=100 toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no")          
  	//if((intHours >= 8 && intHours<=20))
  	//{    
  		//alert (intSeconds);                                                                                                          
    // window.open (url, "newwindow2", "height=480, width=760, top=100,left=100 toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no")
    //}
  }
      //写入cookie
      function setCookie(name,value,time){
       var strsec = getsec(time);
       var exp = new Date();
       exp.setTime(exp.getTime() + strsec*1);
       document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
       }
       //判断cookie失效时间
       function getsec(str){
       //alert(str);
       var str1=str.substring(1,str.length)*1; 
       var str2=str.substring(0,1); 
       if (str2=="s"){
       return str1*1000;
       }else if (str2=="h"){
       return str1*60*60*1000;
       }else if (str2=="d"){
       return str1*24*60*60*1000;
       }
       }
      // 读取cookies
      function getCookie(name)
      {
      var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
      if(arr=document.cookie.match(reg)) return unescape(arr[2]);
      else return null;
      }
      // 删除cookies
      function delCookie(name)
      {
      var exp = new Date();
      exp.setTime(exp.getTime() - 1);
      var cval=getCookie(name);
      if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
      }  
      //主程序
      function loadpopup(){  
      //alert(getCookie('popped'));
      var  hostid,cookieid;
      hostid=window.location.host;
      //alert(hostid);
      cookieid='poped_'+hostid;
      cookieid2='poped2_'+hostid;
      if (getCookie(cookieid2)==null){
      	  openwin2();
      	  setCookie(cookieid2,'yes','h4');  
       }
       //else 
       	//if (getCookie(cookieid)==null){
      	  //openwin();
      	  //setCookie(cookieid,'yes','h4');  
       //}
      } 
      function loadpop(){
      		var hrf,hostid,cookieid;
	        var strUrl=window.location.href;
          var arrUrl=strUrl.split("/");
          var page=arrUrl[arrUrl.length-1];
          
          hostid=window.location.host;
          cookieid='poped_'+hostid+'_'+page;
          cookieid2='poped2_'+hostid+'_'+page;
          if (getCookie(cookieid2)==null){
             openwin2();
             setCookie(cookieid2,'yes','s30');  
           }
      	}
       function loadpopup2(){  
            openwin2();
       } 
       loadpop();
      //loadpopup2();               