﻿function $(id){return document.getElementById(id);}
function isEmail(str){
       var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
       return reg.test(str);
}
function tips(title,msg){
   Ext.onReady(function(){
       Ext.MessageBox.show({
        title:title,
        msg:msg,
        buttons:{"ok":"好的,我知道了"},
        width:300,
        icon:Ext.MessageBox.INFO,
        progress:true,
        wait:true,
        progressText:"进度条"
      });
   });
}


function setTips(obj){
   $("tips").innerHTML=obj.alt+"&nbsp;&nbsp;<a href='?xmls=msg_show.html&id="+obj.id+"'><img alt='查看详情' src='/shell/Cuddsies/images/info.jpg' />";
   $("msg_id").value=obj.id;
}
function goUrl(){
   var id= $("msg_id").value;
   document.location.href="?xmls=msg_show.html&id="+id;
}
function Confirm(id){send("confirm",id);}///确认收货


function setCookie(name,value){//写cookie
       document.cookie=name+"="+escape(value);
    } 
function readcookie(name){//读取cookie
    var oRegex=new RegExp(name+'=([^;]+)','i');
    var oMatch=oRegex.exec(document.cookie);
    if(oMatch&&oMatch.length>1)return unescape(oMatch[1]);
    else return '';
}

function Chind(id){
   var obj=document.getElementById("se"+id);
   if(obj.className=="overflow"){
       obj.className="overflow_height";
   }else if(obj.className=="overflow_height"){
       obj.className="overflow";
   }
}
function showChind(id){
  var obj=document.getElementById("th"+id.substring(2));
   if(obj.className=="overflow"){
       obj.className="overflow_height";
   }
}

function goURL(id){
    var val=document.getElementById("c"+id).innerHTML;
    window.location.href="?xmls=productInfo.html&cid="+id+"&title="+escape(val);
}
