﻿

function url(url)
{

return escape(url)
}





function sousuo(url,str)
{
   	if($("#"+str).val()=="")
	{
		alert("搜索关键字必须填写");
		$("#"+str).focus()
		return ;
	}
//   alert($("#txtsousuo2").val());
   window.location.href=url+"_"+encodeURI($("#"+str).val())+".html";

  //window.location.href=url+escape('飞机');
}

function headsousuo()
{
	if($("#Head1_txtsousuo").val()==""||$("#Head1_txtsousuo").val()=="请输入搜索关键字")
	{
		alert("搜索关键字必须填写");
		$("#Head1_txtsousuo").focus()
		return ;
	}
	var url="";
    switch($("#biaoji").html())
	{
		case "1":
		url="http://www.jmfcn.com/sell/searchsell_"+encodeURI($("#Head1_txtsousuo").val())+".html";
		break;
		
		case "2":
		url="http://www.jmfcn.com/buy/searchbuy_"+encodeURI($("#Head1_txtsousuo").val())+".html";
		break;
		
		case "3":
		url="http://www.jmfcn.com/technical/searchtechnical_"+encodeURI($("#Head1_txtsousuo").val())+".html";
		break;
		
	    case "4":
		url="http://www.jmfcn.com/news/searchnews_"+encodeURI($("#Head1_txtsousuo").val())+".html";
		break;
		
		 case "5":
		url="http://www.jmfcn.com/exhibition/searchexhibition_"+encodeURI($("#Head1_txtsousuo").val())+".html";
		break;
		
    }

   window.location.href=url;


}



//leibie=1首页无验证码登陆
//leibie=2 /login/有验证码登陆
//leibie=3 日志回复有验证码登陆

function checkdl(leibie)
{
  if(leibie=="1")
  {
  
   if($("#Head1_txtusername").val()=="")
   {
     
      alert("用户名必须填写");
      $("#Head1_txtusername").focus();
      return false;
   }
   if($("#Head1_txtpassword").val()=="")
   {
     
      alert("密码必须填写");
      $("#Head1_txtpassword").focus();
      return false;
   }
  txtusername=encodeURIComponent($('#Head1_txtusername').val());
  txtpassword=encodeURIComponent($('#Head1_txtpassword').val())
  yanzhengma=''
  }

   
   
   
   
  if(leibie=="2"||leibie=="3")
  { 
  
  
  
   if($("#txtusername").val()=="")
   {
     
      alert("用户名必须填写");
      $("#xtusername").focus();
      return false;
   }
   if($("#txtpassword").val()=="")
   {
     
      alert("密码必须填写");
      $("#txtpassword").focus();
      return false;
   }
   
   if($("#Verifycode").val()=="")
  {
	 alert('验证码必须填写'); 
	 $("#Verifycode").focus();
	 return false;
	  
  }
   txtusername=$("#txtusername").val();
   txtpassword=$("#txtpassword").val();
    yanzhengma=$("#Verifycode").val();
 }
   
   
   
   

   
   
    $.ajax({
   type: "POST",
   url: "/ashx/ajax.ashx",
   data: "timeid="+Math.random()+"&biaoji=dl&yanzhengma="+yanzhengma+"&username="+txtusername+"&password="+txtpassword+"",
   success: function(msg){
   
     ajaxdl(msg,leibie)
    // alert( "Data Saved: " + msg );
   }
}); 
    
}

function ajaxdl(msg,leibie)
{
  //alert(msg);
    if(msg=="1")
   {
     //AlertMsg('温馨提示','')
      alert('验证码错误！请重新填写');
    // AlertMsg('用户名或者密码错误！请重新填写');
      return false;
   }
  
  
   if(msg=="0")
   {
     //AlertMsg('温馨提示','')
      alert('用户名或者密码错误！请重新填写');
    // AlertMsg('用户名或者密码错误！请重新填写');
      return false;
   }
   
   if (leibie=="1")
   { 
    
      $("#Head1_denglu").html(msg+" 您好：<a href='/huiyuan/index.aspx' target='_top'>[返回管理中心]</a> <a href='/huiyuan/lout.aspx' target='_top'>[退出管理]</a>")
   }
   if (leibie=="2")
   { 
       location.href='/huiyuan';
   } 
   if (leibie=="3")
   { 
       
       $("#weifabiao").hide();
       $("#fabiao").show();
       
   }    
   
    
//this.denglu.InnerHtml = Session["username"].ToString() + ;



}


















$(document).ready(function(){
  $("#s1").css({"background":"url(/images/index_13.gif)"});
  
$("#biaoji").html("1");


  
  
}); 
function sou(id)
{
	$("#s1").css({"background":""});
	$("#s2").css({"background":""});
	$("#s3").css({"background":""});
	$("#s4").css({"background":""});
	$("#s5").css({"background":""});
	$("#s"+id).css({"background":"url(/images/index_13.gif)"});
	
	$("#cat_id").val(id);
	
	$("#biaoji").html(id);
	
	
	      
}

function overfenzhan()
{

  $("#divfenzhan").show();

}


function outfenzhan()
{
//alert('d');
  $("#divfenzhan").hide();

}







function changehangye(bigid)
{
  $.ajax({
   type: "POST",
   url: "/ashx/ajax.ashx",
   data: "timeid="+Math.random()+"&biaoji=hangyebig&bigid="+bigid+"",
   success: function(msg){
  
   $("#hangyesmall").html(msg);

   }
}); 
}




function changeqiyeleibie(bigid)
{
  $.ajax({
   type: "POST",
   url: "/ashx/ajax.ashx",
   data: "timeid="+Math.random()+"&biaoji=qiyeleibie&bigid="+bigid+"",
   success: function(msg){
  
   $("#qiyeleibiesmallid").html(msg);

   }
}); 
}






 
 function changepro(bigid)
{
  $.ajax({
   type: "POST",
   url: "/ashx/ajax.ashx",
   data: "timeid="+Math.random()+"&biaoji=probig&bigid="+bigid+"",
   success: function(msg){
	  // alert(msg);
   $("#prosmallid").html(msg);

   }
}); 
}



function changeProvince(shengid)
{
  $.ajax({
   type: "POST",
   url: "/ashx/ajax.ashx",
   data: "timeid="+Math.random()+"&biaoji=shengid&shengid="+shengid+"",
   success: function(msg){
	  // alert(msg);
   $("#city").html(msg);

   }
}); 
}


function changeCountry(value)
{
	if(value=="CN")
	{  
		  $("#idsheng,#idshi").show();
		
	}
	else
	{
		 $("#idsheng,#idshi").hide();
		
	}
}



