﻿// JScript 文件
function getEi(n) { return document.getElementById(n);}
function getEn(n) { return document.getElementsByName(n);}
function thisMovie(movieName) {
      if (navigator.appName.indexOf("Microsoft") != -1) {
          return window[movieName];
      } else {
          return document[movieName];
      }
   } 
//
function setleft()
{
	if(window.screen.width<=1024)
	{
		getEi('quick').style.left=window.screen.width;
	}
	else
	{
	setwidth();
	}	
	getEi('quick').style.display="";

}
function setwidth()
{
    if(document.body.offsetWidth<=965)
    {
    getEi('quick').style.left=window.screen.width;
    }
}
window.onresize=setwidth;
//
	function ch_hei(){
	  //getEi("topNavi").style.height ="188px";
	  thisMovie("topNavi").height="188";	  
	 }
	 function ch_hei_no(){
	  //getEi("topNavi").style.height ="32px";
	  thisMovie("topNavi").height="32";
	 }	 
	 function writeSwf (files, name, width, height) 
	 {
	var sTag = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ width + '" height="'+ height + '" id="'+ name +'" name="' + name + '" align="middle">'
		+ '<param name="allowScriptAccess" value="always" />'
		+ '<param name="movie" value="' + files + '" />'
		+ '<param name="quality" value="high" />'
		+ '<param name="wmode" value="transparent">'
		+ '<embed wmode="transparent" src="' + files + '" quality="high" bgcolor="#ffffff" width="' + width + '" height="'+ height +'" name="'+ name +'" id="' + name + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" swLiveConnect="true" /></object>';
	document.write (sTag);
    }
    function writeSwf2 (files2, name2, width2, height2) 
	 {
	var sTag2 = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ width2 + '" height="'+ height2 + '" id="'+ name2 +'" name="' + name2 + '" align="middle">'
		+ '<param name="allowScriptAccess" value="always" />'
		+ '<param name="movie" value="' + files2 + '" />'
		+ '<param name="quality" value="high" />'
		+ '<param name="wmode" value="transparent">'
		+ '<embed wmode="transparent" src="' + files2 + '" quality="high" bgcolor="#ffffff" width="' + width2 + '" height="'+ height2 +'" name="'+ name2 +'" id="' + name2 + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" swLiveConnect="true" /></object>';
	return sTag2;
    }
///隐藏所有Select控件  
function   hideAllSelect() 
{ 
var   selects   =   document.getElementsByTagName( "Select"); 
for(var   i   =   0   ;   i <selects.length;i++) 
{ 
selects[i].style.display=   "none"; 
} 
}
///显示所有Select控件
function   ShowAllSelect() 
{ 
var   selects   =   document.getElementsByTagName( "Select"); 
for(var   i   =   0   ;   i <selects.length;i++) 
{ 
selects[i].style.display=   ""; 
} 
}
///隐藏视频播放控件
function HiddenItem()
  {
    getEi('product_cate').style.zIndex='998';
    getEi('DivMovie').style.display='none';   
  
  }
  ///显示视频播放控件
  function ShowItem()
  {
    getEi('DivMovie').style.display='';         
  }   
///判断浏览器版本
function detectBrowser()
{
  return typeof document.body.style.maxHeight =="undefined";
}
function showSwf(){    
   getEi("product_cate").innerHTML = writeSwf2 ("swf/ls.swf", "lsFlash", 989, 580);
   getEi('product_cate').style.display='block';
   window.setInterval("setHFun()",1000);
   if(detectBrowser()){hideAllSelect();}
   HiddenItem();
  }
  function showSwf2(fid,sid,tid){
   getEi("product_cate").innerHTML = writeSwf2 ("swf/ls.swf?goto=true&nfid="+fid+"&nsid="+sid+"&ntid="+tid,"lsFlash",989,580);
   getEi('product_cate').style.display='block';
   window.setInterval("setHFun()",1000); 
  }
  function hideSwf()
  {
   getEi('product_cate').style.display='none';
   if(detectBrowser()){ShowAllSelect();}      
   ShowItem();
  }  
   function setHFun(){   
      thisMovie("lsFlash").height = thisMovie("lsFlash").GetVariable('_root._height');      
   }  
   

