﻿function createVd(){
       return '<div id="_openfrDiv" style="width: 300px;position:absolute;left:0px;z-index:9913; visibility:hidden;" align="center"><div id="openheader" style="width: 300px; height: 25px;left:0px;" align="center"><div style="width: 300px;height:25px;cursor: move" ondblclick="void(0);" onmouseover="DivID=\'_openfrDiv\';over=true;stoprol=true;" onmouseout="DivID=\'_openfrDiv\';over=false;stoprol=false;"><div style="clear:right;float: left; padding: 0px;width: 7px;height:25px; background: url('+getMainUrl()+'App_Themes/Blue/images/form/formheaderleft.gif) no-repeat" ></div><div style="width:242px;float:left;clear:right;padding: 0px;height:25px; background: url('+getMainUrl()+'App_Themes/Blue/images/form/formheadercenter.gif)" align="left"><div style="margin: 5px 0px 0px 5px; height:20px;"><asp:Label ID="lbtitle" runat="server" CssClass="fontcolor" Text="Video"></asp:Label></div></div><div style="float:left;clear:right;padding: 0px;height:25px;width:44px;background: url('+getMainUrl()+'App_Themes/Blue/images/form/formheadercenter.gif)">'+
        "<div title='help' id='helpdiv' onclick=\"javascript:window.open('"+getMainUrl()+"WebHelp/AspxFile/index.aspx');\" style='float:left;clear:right;padding:0px;cursor:help;width: 22px;height:25px;background:url("+getMainUrl()+"App_Themes/Blue/images/form/btn_help.gif) no-repeat' onmousemove=\"javascript:this.style.background='url("+getMainUrl()+"App_Themes/Blue/Images/form/btn_help1.gif)'\" onmouseout=\"javascript:this.style.background='url("+getMainUrl()+"App_Themes/Blue/Images/form/btn_help.gif)'\"></div><div title='close' id='closediv' onclick='javascript:closead();' style='float:left;clear:right;cursor:pointer;padding: 0px;width: 22px;height:25px; background:url("+getMainUrl()+"App_Themes/Blue/images/form/close.gif) no-repeat' onmousemove=\"javascript:this.style.background='url("+getMainUrl()+"App_Themes/Blue/Images/form/close_1.gif)'\" onmouseout=\"javascript:this.style.background='url("+getMainUrl()+"App_Themes/Blue/Images/form/close.gif)'\"></div></div>"+
       '<div style="clear:right;float:left;padding:0px;width:7px;height:25px;background:url('+getMainUrl()+'App_Themes/Blue/images/form/formheaderright.gif) no-repeat"></div></div></div><div id="opencenter" style="width:300px;left:0px;"><iframe id="adarea" src="" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" style="width:300px; height:250px;"></iframe><div id="openbottom" style="width:300px;height:4px;left:0px;font-size:0;" align="center"><div class="tab_4lineleft"></div><div id="openbottomcenter" class="tab_4line" style="width:288px"></div><div class="tab_4lineright"></div></div></div></div>';
       }
  if(video!=""){document.write(createVd());document.write("<script type='text/javascript' src='../script/floatdiv.js'><" + "/script>");}
 function listvideo(f){$("adarea").src=getMainUrl()+'ECF/Viedo.aspx?video='+f;}function flvvideo(f){$("adarea").src=getMainUrl()+'ECF/FlashVideo.aspx?video='+f;}
              function closead(){$("_openfrDiv").style.visibility = "hidden";$("adarea").src="";}
              function _toCart(d,v){var tp=$("ddlType");var tType="",tColor="";if(tp){var id=tp.selectedIndex;if(id<0){id=0};tType=tp.options[id].text;}
              tp=$("ddlColor");if(tp){var ic=tp.selectedIndex;if(ic<0){ic=0};tColor=tp.options[ic].text;};addToCart(d,v+"&ttype="+escape(tType)+"&tcolor="+escape(tColor)+"&tqty="+$("txtOrderQty").value)};
              function bwsetp(){var ob=$("_openfrDiv");if(!ob){return;}var scrollTop=0;if(document.all){scrollTop=document.documentElement.document.body.scrollTop;}else{scrollTop=window.top.document.documentElement.scrollTop;}if(scrollTop==0){scrollTop=document.documentElement.scrollTop;}
              clearTimeout(timeob);if(!stoprol){ob.style.top=(window.top.document.body.scrollHeight-document.body.clientHeight+scrollTop+350)+"px";}
             if($("_openfrDiv").style.visibility != "hidden"){timeob=setTimeout("bwsetp()", 300);}}
             function loadGrade(){callajaxsever(getMainUrl()+'ECF/GradeInfo.aspx?itemid='+activeItemId+'&name='+itemName+'&subCategoryId='+SubCategoryId+'&culture='+culture);}
             var timeob=null,pxml=null;
             var stoprol=false;
             function _pageload(){_createTag('TagDiv');if(video!=""){timeob=setTimeout("bwsetp()", 100);$("_openfrDiv").style.visibility ="";$("_openfrDiv").style.left="5px";if(video.toLowerCase().indexOf(".flv")>0){try{var spswf=new ActiveXObject('ShockwaveFlash.ShockwaveFlash');flvvideo(video)}catch(e){listvideo(video)}}else{listvideo(video)}}}
             function setH(){if($("leftbox").offsetHeight>$("rightbox").offsetHeight){$("rightbox").style.height=$("leftbox").offsetHeight+"px";}else{$("leftbox").style.height=($("rightbox").offsetHeight+2)+"px"};}

    function sch(wd){op(getMainUrl()+"ECF/?keyworks=" + wd + "&culture="+culture+"&currency="+Currency)}     
      loadGrade();setH();
      
      /*auto page*/      
      function autoTo(s,t)
    {
     if(t=="Stop"){ reTo("")}
     if(!isNaN(s)){if(t==""){setTimeout("reTo("+s+")",s*1000);}else{setTimeout("reTo("+s+")",0);}}
    }
    function reTo(s)
    {
      var n=$("toNext");
      if(n!=null){
      var hr=n.href;
      if(hr.indexOf("second")<0)
      {
        if(hr.indexOf("?")<0){n.href=hr+"?second="+s;}
        else{n.href=hr+"&second="+s;}
       }
       n.click();}
    }
     function checkreTo()
     {
       var hr=location.href;
       hr=hr.toLowerCase();
       if(hr.indexOf(".html")>0&&hr.indexOf("second")>0)
       {
         var n=$("toNext");
         if(n){
         n.value="Stop";
         var Request=new QueryString();
         var t=Request["second"];
         autoTo(t,"")}
       }
     }
 checkreTo();
