//显示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;
}


function checkform(){
	if (document.enquiry.Company.value==""){
		window.alert("请输入公司名称！");
		document.enquiry.Company.focus();
		return false;
	}
	if (document.enquiry.Address.value==""){
		window.alert("请输入公司地址！");
		document.enquiry.Address.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;
}

//双击滚动代码
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 MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


var flag=false; 
function DrawImage(ImgD){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= 280/220){ 
   if(image.width>280){
    ImgD.width=280; 
    ImgD.height=(image.height*220)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
  else{ 
   if(image.height>220){
    ImgD.height=220; 
    ImgD.width=(image.width*220)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
 }
}



function CheckJob()
{
	if (document.form1.Quarters.value.length < 2 || document.form1.Quarters.value.length > 30){
		alert ("提示：\n\n职位必须在2-30字之间！");
		document.form1.Quarters.focus();
		return false;
	}
	if (document.form1.Name.value.length < 2 || document.form1.Name.value.length > 16){
		alert ("提示：\n\n姓名必须在2-16字之间！");
		document.form1.Name.focus();
		return false;
	}
	if (document.form1.Birthday.value.length!=10){
		alert ("提示：\n\n出生日期格式不对！");
		document.form1.Birthday.focus();
		return false;
	}
	if (document.form1.Stature.value.length != 3){
		alert ("提示：\n\n身高格式不对！");
		document.form1.Stature.focus();
		return false;
	}
	if (document.form1.Residence.value.length < 4 ||document.form1.Residence.value.length > 30 ){
		alert ("提示：\n\n户籍所在地在4-30个符之间！");
		document.form1.Residence.focus();
		return false;
	}
	if (document.form1.Edulevel.value.length < 20 ){
		alert ("提示：\n\n教育经历必须在20字以上！");
		document.form1.Edulevel.focus();
		return false;
	}
	if (document.form1.Experience.value.length < 20 ){
		alert ("提示：\n\n工作经历必须在20字以上！");
		document.form1.Experience.focus();
		return false;
	}
	if (document.form1.Phone.value == "" || document.form1.Phone.value.length < 8){
		alert ("提示：\n\n联系电话必须在8个字符以上！");
		document.form1.Phone.focus();
		return false;
	}

    if(document.form1.Email.value.length!=0)
     {
       if (document.form1.Email.value.charAt(0)=="." ||        
            document.form1.Email.value.charAt(0)=="@"||       
            document.form1.Email.value.indexOf('@', 0) == -1 || 
            document.form1.Email.value.indexOf('.', 0) == -1 || 
            document.form1.Email.value.lastIndexOf("@")==document.form1.Email.value.length-1 || 
            document.form1.Email.value.lastIndexOf(".")==document.form1.Email.value.length-1)
        {
         alert("Email地址格式不正确！");
         document.form1.Email.focus();
         return false;
         }
      }
    else
     {
      alert("Email不能为空！");
      document.form1.Email.focus();
      return false;
      }
 }

var flag=false; 
function DrawImage(ImgD){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= 550/412){ 
   if(image.width>550){
    ImgD.width=550; 
    ImgD.height=(image.height*412)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查大图..."; 
  } 
  else{ 
   if(image.height>412){
    ImgD.height=412; 
    ImgD.width=(image.width*412)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看大图..."; 
  } 
 }
}

function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll")
       e.checked = form.chkAll.checked;
    }
  }


var flag=false; 
function DrawImages(ImgD){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= 220/153){ 
   if(image.width>220){
    ImgD.width=220; 
    ImgD.height=(image.height*153)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细资料..."; 
  } 
  else{ 
   if(image.height>153){
    ImgD.height=153; 
    ImgD.width=(image.width*153)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细资料..."; 
  } 
 }
}

