﻿/// <reference path="jquery-1.3.2-vsdoc2.js" />
/// <reference path="jquery-1.3.2.min.js" />

function search() {

    var skeys = $("#keys").val();
    if (skeys == "" || skeys == "输入产品名称快速查找") {
        alert("请输入关键词!");
        return false;
    }
    location.href = "Product.aspx?keys=" + encodeURI(skeys);

}
function searchonfocus() {
    var skeys = $("#keys").val();
    if (skeys == "输入产品名称快速查找") {
        $("#keys").val("");
        return false;
    }
}



function swf(name,width,height,transparent){
    document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>");
    document.write("<param name='movie' value='"+name+"'>");
    document.write("<param name='quality' value='high'>");
    document.write("<param name='menu' value='false'>");
    if(transparent==1) document.write("<param name='wmode' value='transparent'>");
    document.write("<embed src='"+name+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed>");
    document.write("</object>");
}

function DrawImage(ImgD,w,h){
   xwidth=w;
   xheight=h;
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= xwidth/xheight){
     if(image.width>xwidth){  
     ImgD.width=xwidth;
     ImgD.height=(image.height*xwidth)/image.width;
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }

     }
    else{
     if(image.height>xheight){  
     ImgD.height=xheight;
     ImgD.width=(image.width*xheight)/image.height;     
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }

     }
    }
}


//显示左边产品菜单
function switchMenu(curr_id, total_num) {
     for(var i=0; i<total_num; i++)
	 {         //二级菜单         
		  var el = document.getElementById('leftmenu3-'+i);          
		  if(!el) return;          //一级菜单前面的图片    
		  var el2 = document.getElementById('leftmenu1-'+i);
		  var el3 = document.getElementById('leftmenu2-'+i);
		  if(i == curr_id)         
		  {             
		     if(el.style.display =="block"){
			    el2.className="leftmenu1";
				el.style.display = "none";
			    el3.style.color="";
		     }
			 else{
				el2.className="leftmenu1a";
		        el.style.display = "block";
		        el3.style.color="#E84C00";
		     }
		  }
		  else{
		  el2.className="leftmenu1";
		  el.style.display = "none";
		  el3.style.color="";
		  }
	 }

}

$(document).ready(function() {
$('#scrollcontent').jScrollPane({ showArrows: true });

}
)
