// JavaScript Document
function isValidEmail(s)
	{
		var reg1 = new RegExp('^[a-zA-Z0-9][a-zA-Z0-9@._-]{3,}[a-zA-Z]$');
		var reg2 = new RegExp('[@.]{2}');
		
		if (s.search(reg1) == -1
				|| s.indexOf('@') == -1
				|| s.lastIndexOf('.') < s.lastIndexOf('@')
				|| s.lastIndexOf('@') != s.indexOf('@')
				|| s.search(reg2) != -1)
			return false;
		
		return true;
	}
function checkPara()
{
	if(!isValidEmail(document.frmSendMapMail.toEmail.value)&&document.frmSendMapMail.toEmail.value.length<15)
	{
		alert('请输入收件人的正确的电子邮件地址!');
		document.frmSendMapMail.toEmail.focus();
		return false;
	}
	if(!isValidEmail(document.frmSendMapMail.fromEmail.value))
	{
		alert('请输入您的正确的电子邮件地址!');
		document.frmSendMapMail.fromEmail.focus();
		return false;
	}

    if(document.frmSendMapMail.subjectEmail.value.length=="")
	{
		alert("邮件标题不能为空");
		document.frmSendMapMail.subjectEmail.focus();
		return false;
	}
	if(document.frmSendMapMail.bodyEmail.value.length=="")
	{
		alert("邮件内容为空");
		document.frmSendMapMail.bodyEmail.focus();
		return false;
	}
	document.frmSendMapMail.urlPrev.value = window.location.href;
	document.frmSendMapMail.urlImg.value = document.all.MapName.src;
	return true;
	
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
/*
var OKMapPath = '/displaymap.asp';
function OKMapTo(p1,p2,p10,p88)
{
	var mapurl = OKMapPath + "?p1=" + p1 + "&p2=" + p2+"&p10=" + p10+"&p888="+p88;
	window.open(mapurl,null,"height=405,width=535,toolbar=0,location=0,directories=0,status=no,menubar=0,scrollbars=0,resizable=0,copyhistory=0" );
}
*/
function ShowOrHide(p)
{
    var obj = document.getElementById("div_"+p);
    var imgObj = document.getElementById(p);
	var imgObj2 =  document.getElementById(p+"_t");
	if (obj.style.display == "none")
	{
		obj.style.display = "";
		imgObj.src="/city/images/close_"+p+".gif";
		imgObj.title="点击关闭浮动栏";
		imgObj2.src="/city/images/close_"+p+".gif";
		imgObj2.title="点击关闭浮动栏";
	}
	else
	{
		obj.style.display = "none";
		imgObj.src="/city/images/open_"+p+".gif";
		imgObj.title="点击打开浮动栏";
		imgObj2.src="/city/images/open_"+p+".gif";
		imgObj2.title="点击打开浮动栏";
	}
}

