// JavaScript Document
function xianshiguanbi(a){
	var i;
	var f = new Array('show_sybz','show_xtgnjj_1','show_xtgnjj_2','show_xtgnjj_3');
	for(i=0;i<f.length;i++){
		document.getElementById(f[i]).style.display='none';
	}
	var e = a.split(',');
	for(i=0;i<e.length;i++){
		document.getElementById(e[i]).style.display='block';
	}
}

function temp(){
	document.getElementById("pass").value="123456";
	document.getElementById("url").value="http://www.access2008.cn/temp/api.asp";
	document.getElementById("form1").submit();
	//alert("请点击提交!")
}
function FsaveApi(){
	if($('saveApi').checked){
		//Cookie.write("saveApi",$('url').value,{duration: 365});
		writeCookie("saveApi",$('url').value,2400);
	}else{
		writeCookie("saveApi","")
	}
	$('form1').submit();
}

// Example:

// writeCookie("myCookie", "my name", 24);

// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.

function writeCookie(name, value, hours)

{

  var expire = "";

  if(hours != null)

  {

    expire = new Date((new Date()).getTime() + hours * 3600000);

    expire = "; expires=" + expire.toGMTString();

  }

  document.cookie = name + "=" + escape(value) + expire;

}

// Example:

// alert( readCookie("myCookie") );

function readCookie(name)

{

  var cookieValue = "";

  var search = name + "=";

  if(document.cookie.length > 0)

  { 

    offset = document.cookie.indexOf(search);

    if (offset != -1)

    { 

      offset += search.length;

      end = document.cookie.indexOf(";", offset);

      if (end == -1) end = document.cookie.length;

      cookieValue = unescape(document.cookie.substring(offset, end))

    }

  }

  return cookieValue;

}

