// JavaScript Document

function GetObj(objName){
	if(document.getElementById){
		return eval('document.getElementById("' + objName + '")');
	}else{
		return eval('document.all.' + objName);
	}
}

function showindex(id){
	
	for (i = 1; i<= 2; i++ )
    {
        if (id == i)
        {
		   $("#indexs_"+id).attr("class","news_nav1");
		   $("#index_"+id).show();
        }
        else
        {
			$("#indexs_"+i).attr("class","news_nav2");
		   $("#index_"+i).hide();

        }
	}
}


function showtop(obj)
{
	
	$("#"+obj).attr("class","nav_m2");
	$("#"+obj).find(".nav_m1_a").attr("class","nav_m2_a");
	$width1=$("#"+obj).find(".erji").eq(0).width();
	$width2=$("#"+obj).find(".nav_m2_a").eq(0).width();
	if($width1>$width2){
	$("#"+obj).find(".erji").eq(0).css("left","-"+(($width1-$width2)/2-5)+"px");
	}else
	{
 $("#"+obj).find(".erji").eq(0).css("left",(($width2-$width1)/2)+"px");
		}
	$("#"+obj).find(".erji").eq(0).show();
}

function hidetop(obj)
{
	$("#"+obj).attr("class","");
  	$("#"+obj).find(".nav_m2_a").attr("class","nav_m1_a");
	$("#"+obj).find(".erji").eq(0).hide();
}


function showgysy(id)
{
	for (i = 1; i<= 2; i++ )
    {
        if (id == i)
        {
		   document.getElementById("ztgy_"+id).style.display='block';
        }
        else
        {
			document.getElementById("ztgy_"+i).style.display='none';

        }
	}
}

function chk()
  {
   var getValue = document.getElementById('seach');
    
    if(getValue.value=='')
    {
        alert('请输入关键字!');
		getValue.focus();
        return ;
    }
	else if(getValue.value=='请输入关键字!')
    {
        alert('请输入关键字!');
		getValue.focus();
        return ;
    }
   else
   {
	   window.location.href="/aspx/html/Search.aspx?key="+encodeURIComponent(getValue.value);
 	}
  }
  
function jobsave()
{  	
	
	if (document.frmAddUser.Postion.value=="")
	{
	   alert("请输入应聘职位！");
	   document.frmAddUser.Postion.focus();
	   return false;
	}
	if (document.frmAddUser.Dept.value=="")
	{
	   alert("请输入应聘应聘的部门！");
	   document.frmAddUser.Dept.focus();
	   return false;
	}
	
	if (document.frmAddUser.name.value=="")
	{
	   alert("请输入姓名！");
	   document.frmAddUser.name.focus();
	   return false;
	}
	if(document.frmAddUser.year.value=="年")
	{
	  	alert("请选择年份！");
	   document.frmAddUser.year.focus();
	   return false;
	}
	if(document.frmAddUser.month.value=="月")
	{
	  	alert("请选择月份！");
	   document.frmAddUser.month.focus();
	   return false;
	}
	if(document.frmAddUser.daty.value=="日")
	{
	  	alert("请选择那一天！");
	   document.frmAddUser.daty.focus();
	   return false;
	}
	if (document.frmAddUser.sfzId.value=="")
	{
	   alert("请输入身份证号码！");
	   document.frmAddUser.sfzId.focus();
	   return false;
	}
	if (document.frmAddUser.telephone.value=="")
	{
	   alert("请输入电话！");
	   document.frmAddUser.telephone.focus();
	   return false;
	}
  	   return true;   
}


//下载
 function GetReportAnalysis(path){
		 var vname =document.getElementById("iframereport");
		 var a=escape("&");
		 var url="/UI/system/uploadfiles.aspx?path="+path+"&type=2";// 1.type=1 同步下载； 2.type=2 异步下载；;
		 url.replace("&",a);
		 vname.src=url;
    }

function MM_jumpMenu(targ,selObj,restore){ 
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}


  function AtoImagea(obj,$$width,$$height){
  var $width=$("#"+obj).width();
 var $height=$("#"+obj).height();
 var $bl=$height/$width;
 var $$bl=$$height/$$width;
 if( $bl > $$bl)
 {
	 if($height>$$height){
	 $("#"+obj).height($$height+"px");}
 }else
 {
	 if($width>$$width){
	 $("#"+obj).width($$width+"px");}
 }
 $("#"+obj).show();
}


/*拖拽div*/
  var interval;
function Files(StrTitle, Url) {
    var boardDiv = "<div id='divPanel' style='width:400px;min-height:500px;_height:500px;background:white;border:1px solid #2768CC;position:absolute;left:5px;top:50px; display:none;z-index:999;' ><div id='divTitle' style='width:400px;height:25px;background:#2768CC; cursor:crosshair'><table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td style='padding-left:10px;height:25px; vertical-align:middle;text-align:left; font-size:14px;color:#fff;'><strong>" + StrTitle + "</strong></td><td style='padding-right:10px; text-align:right;height:25px; vertical-align:middle;'><a href='javascript:RemoveFiles();' style='text-decoration:none;cursor:pointer; font-size:12px; color:#ffffff;'>关闭</a></td></tr></table> </div><div style='width:400px;height:475px; display:block;'><iframe src='" + Url + "' frameborder='0' width='400px' height='475px'  scrolling='no' ></iframe></div></div><div id='divPane2' style='position:absolute;left:0px;top:0px;z-index:2;display:none;background-color:#000;margin:0px auto;'></div>";
    $(document.body).append(boardDiv);
   interval= setInterval("YIDONG()",200);

}

function YIDONG()
{
   	$height = ($(window).height()-500)/2+document.documentElement.scrollTop;
    $left = ($("html").width()-400)/2;
	$height2 = $("body").height();
    $left2 = $("html").width();
    $("#divPanel").show();
	$("#divPane2").show();
    $("#divPanel").css({ left: $left  });
    $("#divPanel").css({ top:$height });
	
	 $("#divPane2").css({ width: $left2  });
    $("#divPane2").css({ height:$height2 });
	$("#divPane2").css({ filter:'alpha(opacity=10)' });
    $("#divPane2").css({ opacity:'0.1' });
}

function AddFiles(type,id) {
    if($("#divPanel")!=null)
    {
	clearInterval(interval);
    $("#divPanel").remove();
	
    }
	if($("#divPane2")!=null)
    {
    $("#divPane2").remove();
	
    }

    switch (type)
    { 
       case 1:
           Files('在线订购', '/aspx/html/buy.aspx?id='+id);
       break;
       default:
       document.write("This type does not exist!");
    }
    
}

function Showdiv() {
	 if($("#divPanel")!=null)
    {
    $height = ($(window).height()-500)/2+document.documentElement.scrollTop;
    $("#divPanel").show();
    $("#divPanel").css({ top:$height });
	}
}

/*移除拖拽div*/
function RemoveFiles() {
    $("#divPanel").remove();

    $("#divPane2").remove();

}


function dgsave(){
	 var vname =document.getElementById("vname");
	 if(vname.value=="")
	   {
		     alert("请输入姓名！");
			 vname.focus();
			 return false;
		 }
		  var vprocud =document.getElementById("vprocud");
	  if(vprocud.value=="")
		 {
			 alert("请输入订购的产品名！");
			 vprocud.focus();
		   return false;
		 }
		 
	 var vtel =document.getElementById("vtel");
	  if(vtel.value=="")
		 {
			 alert("请输入联系电话！");
			 vtel.focus();
		   return false;
		 }
      var VerifyCode =document.getElementById("VerifyCode");
	  if(VerifyCode.value=="")
		 {
			 alert("请输入验证码！");
			 VerifyCode.focus();
		   return false;
		 }
	 var vcontent =document.getElementById("vcontent");
	  if(vcontent.value=="")
		 {
			 alert("请输入备注！");
			 vcontent.focus();
		   return false;
		 }
		 return true;
}

function show_liuyan(id)
{
	 for (i = 1; i<= 2; i++  )
    {
        if (id == i)
        {
		   
			document.getElementById("liuyan_"+id).style.display='block';
        }
        else
        {
			
			document.getElementById("liuyan_"+i).style.display='none';
        }
	}
	
}
function save(){
	 var zt =document.getElementById("zt");
	 if(zt.value=="")
		{
			 alert("请输入主题！");
			 zt.focus();
		     return false;
	    }
	 var vname =document.getElementById("vname");
	 if(vname.value=="")
	   {
		     alert("请输入姓名！");
			 vname.focus();
			 return false;
		 }
	 var vtel =document.getElementById("vtel");
	  if(vtel.value=="")
		 {
			 alert("请输入联系电话！");
			 vtel.focus();
		   return false;
		 }
      var VerifyCode =document.getElementById("VerifyCode");
	  if(VerifyCode.value=="")
		 {
			 alert("请输入验证码！");
			 VerifyCode.focus();
		   return false;
		 }
	 var vcontent =document.getElementById("vcontent");
	  if(vcontent.value=="")
		 {
			 alert("请输入留言内容！");
			 vcontent.focus();
		   return false;
		 }
		 return true;
}
/* 留言end */

