﻿document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;
if (window.Event){document.captureEvents(Event.MOUSEUP); }
 
function nocontextmenu() 
{
 event.cancelBubble = true;
 event.returnValue = false;
 return false;
}
 
function norightclick(e) 
{
 if (window.Event) 
 {
  if (e.which == 2 || e.which == 3)
   {return false;}
 }
 else{
  if (event.button == 2 || event.button == 3)
  {
   event.cancelBubble = true;
   event.returnValue = false;
   return false;
  }
 }
}

function SetAreaHeight()
    {
      var lefth=0,middlh=0,righth=0;
      var objleft,objmiddl,objright;
      
      objleft=$("leftid");
      if(objleft!=null)
      {
        $("leftaddid").style.height="0px";
        lefth=parseInt(objleft.offsetHeight);
       }
        objmiddl=$("middlid");
      if(objmiddl!=null)
      {
       $("middladdid").style.height="20px";  
        middlh=parseInt(objmiddl.offsetHeight);
      }
       objright=$("rightid");
      if(objright!=null)
      {
       $("rightaddid").style.height="0px";
        righth=parseInt(objright.offsetHeight);
      }
       
     var omax=lefth;
      if(omax<middlh)
        {omax=middlh;}
      if(omax<righth)
        {omax=righth;}
        var add=14;
      if(navigator.appVersion.toLowerCase().indexOf("msie 7.0")!=-1)
      {add=0;}
      if(omax>lefth&&lefth>0)
      {
         var correnthref=window.location.toString();
		 if(correnthref.indexOf("SupplierInformationList.aspx")>=0)
		 {
		   if(omax-lefth-8>0)
		    {lefth=omax-lefth-8;}
		   else
		    {lefth=0;}
            $("leftaddid").style.height=(lefth)+"px";
          }
          else
{
          if(navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 &&(navigator.appVersion.indexOf("Win") != -1) )
            {$("leftaddid").style.height=(add+omax-lefth)+"px";}
          else
            {$("leftaddid").style.height=(omax-lefth)+"px";}
            }
      }
      if(omax>middlh&&middlh>0)
      {
         if(navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 &&(navigator.appVersion.indexOf("Win") != -1) )
          {$("middladdid").style.height=(21+omax-middlh)+"px";}
          else
          {$("middladdid").style.height=(omax-middlh)+"px";}
       }
        
      if(omax>righth&&righth>0)
      {
           if(navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 &&(navigator.appVersion.indexOf("Win") != -1) )
             {$("rightaddid").style.height=(add+omax-righth)+"px";}
          else
            {$("rightaddid").style.height=(omax-righth)+"px";}
       }
    }
      
    function ReceiveServerData(rValue)
    {
       loadend();
       if(typeof(callbackflag)=="boolean")
        {callbackflag=true;}
        var splitstr="page$page";
       if(rValue.indexOf("AddToCart$")==0||rValue.indexOf("AddToWish$")==0)
       {
          splitstr="AddToCart$";
          if(rValue.indexOf(splitstr)>=0)
          {
            str=rValue.substring(splitstr.length,rValue.length);
            massagebox(str);
          }
          else
          {
            splitstr="AddToWish$";
            str=rValue.substring(splitstr.length,rValue.length);
            massagebox(str);
          }
          return;
       }
       var str=rValue.substring(0,rValue.indexOf(splitstr,0));
       $("ResultPage").innerHTML =str;
    
       str=rValue.substring(rValue.indexOf(splitstr,0)+splitstr.length,rValue.length);
       if($("pagerid")!=null)
       {$("pagerid").innerHTML =str;}
       
        SetAreaHeight();
        if(typeof bwStran=="function")
        {bwStran($("ResultPage"));}
      if(typeof AfterReceive=="function")
        {AfterReceive();}
    }
 function $(id) {
	return document.getElementById(id);
	}
	