// JavaScript Document
//显示flash，避免IE的激活障碍
function flash(movie,width,height,paramname,paramvalue){

	var swfHtml="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\""+width+"\" height=\""+height+"\">";
	swfHtml+="<param name=\"movie\" value=\""+movie+"\">";
	swfHtml+="<param name=\"quality\" value=\"high\">";
	
	if(paramname!="" && paramvalue!=""){
		var nameArr=new Array();
		var valueArr=new Array();
		nameArr=paramname.split(",");
		valueArr=paramvalue.split(",");
		if(nameArr.length==valueArr.length){
			for(iCount=0;iCount<nameArr.length;iCount++){
				swfHtml+="<param name=\""+nameArr[iCount]+"\" value=\""+valueArr[iCount]+"\">";
			}
		}
	}
	swfHtml+="<embed src=\""+movie+"\" width=\""+width+"\" height=\""+height+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"opaque\"></embed>";
	swfHtml+="</object>";
	document.write(swfHtml);
}

function ratImg(Img,blw,blh){
	var i=Img.width;
	var j=Img.height; 

	if (i>blw){
		var zjbl1=blw/i;
		var zjbl2=blh/j;
		if (zjbl1<zjbl2){
			zjbl=zjbl1;
		}else{
			zjbl=zjbl2;
		}
		i=i*zjbl;
		j=j*zjbl;
	}else{
		if (j>blh){
			zjbl=blh/j;
			j=blh;
			i=i*zjbl;
		}
	}

	Img.width=i;
	Img.height=j;
}



var flag=false; 
function DrawImage(ImgD,width,height){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= width/height){ 
   if(image.width>width){
    ImgD.width=width; 
    ImgD.height=(image.height*width)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
  else{ 
   if(image.height>height){
    ImgD.height=height; 
    ImgD.width=(image.width*height)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
 }
}

function bbImg(o){
	var zoom=parseInt(o.style.zoom, 10)||100;
	zoom+=event.wheelDelta/12;
	if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}


function checkform(){

	if (document.enquiry.Address.value==""){
		window.alert("请输入联系地址！");
		document.enquiry.Address.focus();
		return false;
	}
	if (document.enquiry.Product.value==""){
		window.alert("请输入您要订购的产品！");
		document.enquiry.Product.focus();
		return false;
	}
	if (document.enquiry.OrderNum.value==""){
		window.alert("请输入您要订购产品的数量！");
		document.enquiry.OrderNum.focus();
		return false;
	}
	if (document.enquiry.Phone.value==""){
		window.alert("请输入联系电话！");
		document.enquiry.Phone.focus();
		return false;
	}
	if (document.enquiry.Contact.value==""){
		window.alert("请输入联系人！");
		document.enquiry.Contact.focus();
		return false;
	}
	if (document.enquiry.Content.value==""){
		window.alert("请填写完订购说明！");
		document.enquiry.Content.focus();
		return false;
	}
	return true;
}

function check(){

	if (document.form1.Title.value==""){
		window.alert("请输入留言标题！");
		document.form1.Title.focus();
		return false;
	}
	if (document.form1.Contacts.value==""){
		window.alert("请填写联系人姓名！");
		document.form1.Contacts.focus();
		return false;
	}
	if (document.form1.Address.value==""){
		window.alert("请输入联系地址！");
		document.form1.Address.focus();
		return false;
	}
	if (document.form1.Tel.value==""){
		window.alert("请输入联系电话！");
		document.form1.Tel.focus();
		return false;
	}
	if (document.form1.Content.value==""){
		window.alert("请填写留言内容！");
		document.form1.Content.focus();
		return false;
	}
	return true;
}


//双击滚动代码
var currentpos,timer;

function initialize(){
	timer=setInterval("scrollwindow()",50);
}
function sc(){
	clearInterval(timer);
}
function scrollwindow(){
	currentpos=document.body.scrollTop;
	window.scroll(0,++currentpos);
	if (currentpos != document.body.scrollTop)
	sc();
}
document.onmousedown=sc;
document.ondblclick=initialize;

function tick() {
var hours, minutes, seconds, xfile;
var intHours, intMinutes, intSeconds;
var today, theday;
today = new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
theday = "今天是"+today.getYear()+"年" + [today.getMonth()+1]+"月" +today.getDate() +" "+ d[today.getDay()+1];
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
xfile = "午夜";
} else if (intHours < 12) {
hours = intHours+":";
xfile = "上午";
} else if (intHours == 12) {
hours = "12:";
xfile = "正午";
} else {
intHours = intHours - 12
hours = intHours + ":";
xfile = "下午";
}
if (intMinutes < 10) {
minutes = "0"+intMinutes+":";
} else {
minutes = intMinutes+":";
}
if (intSeconds < 10) {
seconds = "0"+intSeconds+" ";
} else {
seconds = intSeconds+" ";
}
timeString = theday+" "+xfile+" "+hours+minutes+seconds;
Clock.innerHTML = timeString;
window.setTimeout("tick();", 100);
}
window.onload = tick;
