// JavaScript Document
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function mmLoadMenus() {

}
//返回页面使用
	function load_position() { //返回时使用
		var cookieString = new String(document.cookie);
		var cookieHeader = "current_position";
		var beginPosition = cookieString.indexOf(cookieHeader);
		if (beginPosition != -1) {
			var current_position = cookieString.substring(beginPosition + cookieHeader.length + 1);
			if (current_position.indexOf(";") == -1) {
				MM_goToURL('parent',current_position); return document.MM_returnValue
			} else {
				MM_goToURL('parent',current_position.substring(0, current_position.indexOf(";"))); return document.MM_returnValue
			}
		} else {
			MM_goToURL('parent','http://www.goldenfish.com.cn');return document.MM_returnValue//如果找不到要返回的网页，则返回首页
		}
	}
	
	function get_position_user() { //点击“注册”按钮时调用
		var then = new Date();
		then.setTime(then.getTime() + 7 * 24 * 60 * 60 * 1000);
		document.cookie = "current_position=" + window.location.pathname; 
        MM_goToURL('parent','/login/user_name_add.htm');return document.MM_returnValue
	}
	
	
	function get_position_logon() { //点击“登录”按钮时调用
           
		if(document.logon.username.value==""){
   		//用户名不能为空
   			alert("用户名没有填写");
   			document.logon.username.focus();
   			return false;
   		}
      	if(document.logon.password.value==""){
   		//用户名不能为空
   			alert("密码没有填写");
   			document.logon.password.focus();
   			return false;
   		}
		var then = new Date();
		then.setTime(then.getTime() + 7 * 24 * 60 * 60 * 1000);
		document.cookie = "current_position=" + window.location.pathname; 
   		document.logon.submit();
	}


		function get_position_password() { //点击“找回密码”时调用
		var then = new Date();
		then.setTime(then.getTime() + 7 * 24 * 60 * 60 * 1000);
		document.cookie = "current_position=" + window.location.pathname; 
        MM_goToURL('parent','/login/password.htm');return document.MM_returnValue
	}
		function get_position_loginerror() { //没有登录出现登录页面调用时调用
		var then = new Date();
		then.setTime(then.getTime() + 7 * 24 * 60 * 60 * 1000);
		document.cookie = "current_position=" + document.referrer; 
        //MM_goToURL('parent','/login/user_name_add.htm');return document.MM_returnValue
	}

function change_title_name () {
	if (document.form2.classLabel.value == "全部") {
		document.form2.title_name.value = "全部新闻";
	} else if (document.form2.classLabel.value == "企业") {
		document.form2.title_name.value = "企业新闻";
	} else if (document.form2.classLabel.value == "产品") {
		document.form2.title_name.value = "产品新闻";
	} else if (document.form2.classLabel.value == "招商招聘") {
		document.form2.title_name.value = "招商招聘";
	}
}

function ProductSearch(formName){
	if (formName.keyword_product.value=="") {
			if (confirm("您没有选择搜索条件，网站将为您列出所有的产品")){
					formName.submit();			
			} else {
					formName.keyword_product.focus();
			}
	} else {
			formName.submit();
	}
}
