﻿  
     var loadinglayer;
   var loadingdiv;
  function AskPrice(id)
  {
  window.location.href='/Product_Inquiry.aspx?Spid='+id;
  }
// JScript 文件
     function IsCasNo(casno) {
         casno = casno.replace(/^\s*/, "").replace(/\s*$/, "");//去左右空格
         var patncasno = /^[0-9]{2,7}-[0-9]{2}-[0-9]{1}$/;//基本验证
         if (!patncasno.test(casno)) {
             return false;
         }
         var cas2 = casno.toString().substring(0, casno.length - 2).replace("-", ""); //取前2部分，去掉-
         var ii = 1;
         var allcount = 0;//前2部分倒过来*1,2,3,4...总合
         for (var i = cas2.length - 1; i >= 0; i--) {
             allcount += cas2.charAt(i) * ii;
             ii++;
         }
         var lastchar = casno.substring(casno.length - 1, casno.length);   //最后一位
         var mod = allcount % 10; //总合除10的余数
         if (mod == lastchar) {        //余数与最后一位是否相等
             return true;
         }
         else {
             return false;
         }
     }
     function AddFavorite(sURL, sTitle) 
{ 
    try 
    { 
        window.external.addFavorite(sURL, sTitle); 
    } 
    catch (e) 
    { 
        try 
        { 
            window.sidebar.addPanel(sTitle, sURL, ""); 
        } 
        catch (e) 
        { 
          
        } 
    } 
} 
     function AddFavorites(title,memberid)
     {
                if(memberid==0)
                {
                    alert("please login first!")
                    window.location.href="/login.aspx?rurl="+window.location.pathname;
                    return;      
                }  
                showloading(true);   
                //创建浏览器兼容的XMLHttpRequest对象
                var xmlhttp1;
                try{
                    xmlhttp1= new ActiveXObject('Msxml2.XMLHTTP');
                }catch(e){
                    try{
                        xmlhttp1= new ActiveXObject('Microsoft.XMLHTTP');
                    }catch(e){
                        try{
                            xmlhttp1= new XMLHttpRequest();
                        }catch(e){}
                    }
                }
                //定义XMLHttpRequest对象的事件处理程序
                xmlhttp1.onreadystatechange=function(){
                    if(xmlhttp1.readyState==4){
                        //关闭显示条
                        showloading(false);   
                        if(xmlhttp1.status==200){
                            //当加载成功时将内容显示于页面
                            if(xmlhttp1.responseText==1)
                            {
                              alert("Add Success!")
                           
                            }
                            else {
                              alert("Add Failure!")
                            }
                          
                        }else{
                            //否则弹出错误信息
                             
                        }
                    }
                }
                //创建一个连接
                xmlhttp1.open("get","/server/AddFavorites.ashx?type=1&title="+title+"&UserId="+memberid+"&url="+window.location.pathname);
                //发送请求
                xmlhttp1.send(null);
     }

 //遮罩
function showloading(isdisplay) {
    if (isdisplay) {
                
         loadinglayer = document.createElement("div");
         document.body.appendChild(loadinglayer);
         loadinglayer.style.cssText="position:absolute;z-index:999;filter:alpha(opacity=75);background:#666;opacity: 0.5;-moz-opacity: 0.5;left:0;top:0;";
         loadingdiv = document.createElement("div");
        document.body.appendChild(loadingdiv);
        loadingdiv.style.cssText="color:#ff5500;font-weight: bold;padding-left: 190px;padding-right:20px;padding-top: 10px;padding-bottom:10px;background-image: url(/images/loading2.gif);background-repeat: no-repeat;background-position: 5px;border: #b2b1b1 solid 1px;height:58px;font-size: 10px;position: absolute; font-size:12px;z-index: 1000;"
       try
      {
      
        loadinglayer.style.display = "block";
        loadingdiv.style.display = "block";
 loadinglayer.style.width = document.documentElement.clientWidth + "px";
        loadinglayer.style.height =  document.documentElement.clientHeight + "px";
        loadingdiv.style.top = document.documentElement.scrollTop+"px";
        loadingdiv.style.left = (document.documentElement.clientWidth / 2 -100) + "px";

     }
      catch(e){}
    } else {
       try
      {
        document.body.removeChild(loadinglayer);
         document.body.removeChild(loadingdiv);

         }
       catch (e) { }
    }
}

   function showall(isdisplay,shtml,height)
   {         var IfrRef = document.getElementById('DivShim');   
          if (isdisplay) {
          try{
                if(loadinglayer!=null)
                  document.body.removeChild(loadinglayer);
                  if(loadingdiv!=null)
                  document.body.removeChild(loadingdiv);
                  }
                  catch(e){}
         loadinglayer = document.createElement("div");
         document.body.appendChild(loadinglayer);
         loadinglayer.style.cssText="position:absolute;z-index:999;filter:alpha(opacity=10);background:#ffffff;opacity: 0.1;-moz-opacity: 0.1;left:0;top:0;";
         loadingdiv = document.createElement("div");
        document.body.appendChild(loadingdiv);
        loadingdiv.style.cssText="z-index:1000; width:629px; height:260px; border:12px #c8dfff solid; text-align:left; font-family:\"Tahoma\"; padding:0 0 30px 10px; POSITION: absolute;background:#FFFFFF;";

    
        loadingdiv.innerHTML=shtml;
        IfrRef.style.width =663;   
        IfrRef.style.height =height;   
         IfrRef.style.top = document.documentElement.scrollTop+"px"; 
IfrRef.style.left = (document.documentElement.clientWidth / 2 -300) + "px";  
IfrRef.style.zIndex = loadingdiv.style.zIndex - 1;   
IfrRef.style.display = "block"; 
       try
      {
        loadinglayer.style.width = document.documentElement.clientWidth + "px";
        loadinglayer.style.height =  document.documentElement.clientHeight + "px";
        loadingdiv.style.top = document.documentElement.scrollTop+"px";
        loadingdiv.style.left = (document.documentElement.clientWidth / 2 -300) + "px";

     }
      catch(e){}
    } else {
       try
      {
        document.body.removeChild(loadinglayer);
         document.body.removeChild(loadingdiv);
          IfrRef.style.display = "none"; 
         }
       catch (e) { }
    }
   }
   
     var html='<div class="lc left"><div class="left"><img src="/images/Buyer.Seller/lv.gif" width="80" height="114" /></div>';
	html+='<ul><li>15000+</li><li>8000-15000</li><li>4000-8000</li><li>2500-4000</li><li>1000-2500</li><li>200-1000</li></ul></div>';
    html+='<div class="right" style="width:388px; padding:0 10px 30px 0;"><div class="lc_close" onmouseover="this.className=\'lc_close_hover\'" onmouseout="this.className=\'lc_close\'" onclick=\"showpoint(false);\" style=\"cursor:pointer;\" ><a>X Close</a></div>';
      html+='<h1 class="lc_title" style="line-height:22px">What is LookChem Supplier Credit Point?</h1>';
      html+='<p>When the credit status reflecting a corporate credit situation is quantified as the specific value of credit point, plus the value of credit point accumulated in the course of longtime online trading, it is turned out to be the credit point for this company. <br />';
        html+='As a seller in the transaction, LookChem Supplier Credit Point can be indirectly taken as the standard measure of credit, the increase of credit rating is shown at the left side of the diagram.<br />  ';

    // html+='<iframe id="DivShim" src="javascript:false;" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;"></iframe>'
            var html1='<div class="lc left"><img src="/images/Buyer.Seller/lc.gif" width="134" height="148" /></div>';
           html1+='<div class="right" style="width:441px; padding-right:5px;">';
           html1+='<div class="lc_close" onmouseover="this.className=\'lc_close_hover\'" onmouseout="this.className=\'lc_close\'" onclick="showcertificatex(false);" style=\"cursor:pointer;\" ><a>X Close</a></div>';
           html1+='<h1 class="lc_title">When you make a purchase using lookchem.com.</h1>';
           html1+='<p>We immediately inform your chosen supplier and hold the payment until you receive your items correctly. <br />';
           html1+='The supplier must then safely prepare your items and ship them promptly to you. <br />';
           html1+='Track every step of your shipment online with the tracking code provided by the supplier. <br />';
           html1+='After delivery, check your items are safe and correct and inform us that your payment should be released to the supplier. </p></div>';
function showpoint(isdisplay) {
showall(isdisplay,html,314);
}
 
function showcertificatex(isdisplay) {

   showall(isdisplay,html1,313);
}