

  var regEmail=/^\s*\w+\@\w+(\.\w+)+\s*$/i;//Email  
  function isEmail(eStr){   
     return regEmail.test(eStr);  
  } 
  function $id(id){
     return document.getElementById(id);
  }
  function checkForm(){
      if(!isEmail($id('address').value)){
         alert('请输入正确的邮件地址！');  
         $id('address').focus();
         return ;
      }
      if($id('subject').value==null||$id('subject').value.length<1){
         alert('请输入邮件主题！');
         return ;
      }
      $id('sendButton').value="正在发送";
      $id('sendButton').disabled ="true";
      document.sendEmailForm.submit();
      return true;
  }
  var tnum=7;
  function clockClose(){
      tnum=tnum-1;
      //window.opener=null;
      document.getElementById("timeNum").innerHTML=tnum+'秒后窗口将自动'; 
      if(tnum>0){
         setTimeout("clockClose()",1000);
      }else{
         parent.parent.GB_hide(); 
      }  
  } 

//添加到收藏夹
function putinFavorite( adid,dataTitle,resType){
	//优惠券:adid    resTypeId : 优惠券为3   商家为1  优惠信息为4  返回值 -1 收藏失败  
	//alert(dataTitle);  
	dataTitle=escape(dataTitle);
   var url2="/smallFavPanel.jsp?id="+adid+"&dataTitle="+dataTitle+"&resType="+resType ;
   //alert(url2);
   GB_showCenter("加入收藏！",url2,300, 590);
}
//收藏专区
function putSpaceinFavorite(resType,dataTitle,url,id){
		url='http://mall.checkoo.com/'+url;
		dataTitle=escape(dataTitle);
		
		var url2="/smallFavPanel.jsp?id="+url+"&dataTitle="+dataTitle+"&resType="+resType+"&blogId="+id ;
 
		GB_showCenter("加入收藏！",url2,300, 590);

}



function sendEmail_kk(resType,id,code){
	//alert(document.getElementById("summary_"+id)=='undefined'?"yes":document.getElementById("summary_"+id).innerHTML);
	var summary = document.getElementById("summary_"+id).innerHTML;
	var dateTitle = document.getElementById("title_"+id).innerHTML;
	var urlInfo = code+"/promotion.jspa?id="+id;
	if(resType==1){
		urlInfo=code;
	}
	if(summary.length>88){
		summary=summary.substring(0,88)+"...";
	}	
	summary=escape(summary);
	dateTitle=escape(dateTitle);
	var url="/smallEmailPanel.jsp?summary="+summary+"&dateTitle="+dateTitle+"&urlInfo="+urlInfo+"&resType="+resType;
    GB_showCenter("邮件小面板！",url,300, 590);
} 
//<%--function copyThisUrl_kk(urlInfo){--%> 
//<%--   window.clipboardData.setData('Text',urlInfo);--%>
//<%--   alert(window.clipboardData);--%>
//<%--}--%>  
function copyThisUrl(txt,id) {   
    if(txt.length>1&&txt.indexOf('/')<=0){
      txt=txt.substring(1);
    }   
    txt='http://mall.checkoo.com/'+txt;
    if(window.clipboardData) {    
            window.clipboardData.clearData();   
            window.clipboardData.setData("Text", txt);   
    } else if(navigator.userAgent.indexOf("Opera") != -1) {   
         window.location = txt;   
    } else if (window.netscape) {   
         try {   
              netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");   
         } catch (e) {   
              alert("您的浏览器目前不支持复制到剪贴板功能！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");   
         }   
         var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);   
         if (!clip)   
              return;   
         var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);   
         if (!trans)   
              return;   
         trans.addDataFlavor('text/unicode');   
         var str = new Object();   
         var len = new Object();   
         var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);   
         var copytext = txt;   
         str.data = copytext;   
         trans.setTransferData("text/unicode",str,copytext.length*2);   
         var clipid = Components.interfaces.nsIClipboard;   
         if (!clip)   
              return false;   
         clip.setData(trans,null,clipid.kGlobalClipboard);   
         //alert("复制成功！")   
    }   
	//window.location.reload();
//	var oldMsg=document.getElementById("coupyUrl"+id).innerHTML ;
//	if(oldMsg=='<FONT color=red>成功复制链接点击重新复制</FONT>'){
 //   	document.getElementById("coupyUrl"+id).innerHTML = '<FONT color=green>成功复制链接点击重新复制</FONT>'; 
//	}else if(oldMsg=='<FONT color=green>成功复制链接点击重新复制</FONT>'){
 //   	document.getElementById("coupyUrl"+id).innerHTML = '<FONT color=red>成功复制链接点击重新复制</FONT>'; 
//	}else{
//		document.getElementById("coupyUrl"+id).innerHTML = '<FONT color=red>成功复制链接点击重新复制</FONT>'; 
//	}

}

function doLogin(){
	   var url2="/login.jsp?url=mainLogin" ;
       GB_showCenter("登陆博客！",url2,300, 590);
		//window.location.reload();	 
	
			//document.getElementById("login_state").style.display="none";
			//document.getElementById("login_state_in").style.display="";
			//document.getElementById("loginMsg").innerHTML = "欢迎您：aceyin ";
}
  
function checkLogin(){
	//alert('检查登录状态');
	var loginState = "/web/loginState.jspa";
	//alert(loginUrl);
	var res = doGet(loginState);
}

function doLoginOut(){
	url=	"http://my.checkoo.com/Logout.do?url=http://mall.checkoo.com/"+BlogInfo.ownerName+"/index.jspa "
	if(confirm(' 确定退出吗 ？'))
		 window.location=url;
	else
		return;
}

function userReg(){
	window.open('http://my.checkoo.com/register.jsp');
}
 