﻿<!--
//-----------------------------------------
function CheckSave(){
    if(document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestName").value==""){
      alert('称呼不能为空！');
      document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestName").focus();
      return false;
    }
    if(document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestTitle").value==""){
      alert('留言标题不能为空！');
      document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestTitle").focus();
      return false;
    }
    if(document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestContent").value==""){
      alert('留言内容不能为空！');
      document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestContent").focus();
      return false;
    }
    
    var regemail=/^([_a-zA-Z0-9-]{2,})+@(([_a-zA-Z0-9-]{2,})+\.)+[a-zA-z]{2,3}$/;
    if (!regemail.test(document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestMail").value)){
		alert("邮箱格式不正确！");
		document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestMail").focus();
		return false;
	}
}
function CheckSave1(){
    if(document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestName").value==""){
      alert('Call can not be empty！');
      document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestName").focus();
      return false;
    }
    if(document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestTitle").value==""){
      alert('Title of the message can not be empty！');
      document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestTitle").focus();
      return false;
    }
    if(document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestContent").value==""){
      alert('Content of the message can not be empty！');
      document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestContent").focus();
      return false;
    }
    
    var regemail=/^([_a-zA-Z0-9-]{2,})+@(([_a-zA-Z0-9-]{2,})+\.)+[a-zA-z]{2,3}$/;
    if (!regemail.test(document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestMail").value)){
		alert("E-mail format is incorrect！");
		document.getElementById("ctl00_SiteContentPlaceHolder_txtGuestMail").focus();
		return false;
	}
}
function checkImg(theURL, winName) {
	if (typeof(imgObj) == "object"){
		if ((imgObj.width != 0) && (imgObj.height != 0)) {
			//让弹出窗口居中显示判断开始 -----------------------------------------------==============
			var x = window.screen.width - 10;
			var y = window.screen.height;
			var w = imgObj.width + 20;
			var h = imgObj.height + 30;
			var left,top;
			if(x > w) {
				left = (x - w) / 2;
			}
			else {
				left = 0;
			}
			if(y > h) {
				top = (y - h) / 2;
			}
			else {
				top = 0;
			}
			var str = ",width=" + w + ",height=" + h + ",left=" + left + ",top=" + top;
			//居中显示判断结束 			-----------------------------------------------==============
			OpenFullSizeWindow(theURL, winName, str); 
		}
		else {
			setTimeout("checkImg('" + theURL + "','" + winName + "')", 100);
		}
	}
}

function OpenFullSizeWindow(theURL, winName, features) {
	sBaseCmd = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,";
	if (features == null || features == ""){
		imgObj = new Image();
		imgObj.src = theURL;
		checkImg(theURL, winName);
	}
	else{
		aNewWin = window.open(theURL, winName, sBaseCmd + features);
		aNewWin.focus(); 
	}
}

function ChkImgSize(strImg, iWidth, iHeight) {
	imgObj = new Image();
	imgObj.src = strImg;
	if (imgObj.width >= iWidth){
		document.write("<img src='" + strImg + "' width='" + iWidth + "' border='0' />"); 
	}
	else if (imgObj.height >= iHeight){
		document.write("<img src='" + strImg + "' height='" + iHeight + "' border='0 />"); 
	}
	else{
		document.write("<img src='" + strImg + "' width='" + imgObj.width + "' border='0 />"); 
	}
}

function imgOpen(obj) {
	var u = obj.src;
	OpenFullSizeWindow(u.substr(0,u.length-5)+u.substr(u.length-4,u.length),"","")
}
//打开居中显示指定大小的窗口
function fOpenCenterWin(theURL,winName,w,h,otherFeatures){
	var x = window.screen.width - 10;
	var y = window.screen.height;
	var left,top;
	if(x > w) {
		left = (x - w) / 2;
	}
	else {
		left = 0;
	}
	if(y > h) {
		top = (y - h) / 2;
	}
	else {
		top = 0;
	}
	if(otherFeatures + '' == ''){
		otherFeatures = ",resizable=yes";
	}
	var str = "width=" + w + ",height=" + h + ",left=" + left + ",top=" + top + otherFeatures;
	window.open(theURL,winName,str);
}
function mon(d) {
	var o = d.src;
	var img = new Image();
	img.src = o + ".gif";
	d.src = img.src;
}
function mout(d) {
	var o = d.src;
	if(o.indexOf(".gif.gif") != -1) {
		var img = new Image();
		img.src = o.substr(0, o.length - 4);
		d.src = img.src;
	}
}
//-------------------------------------=================================JQUERY Documnet=================---------------
$(function(){
//	$("#SiteMenu").hover(function(){
//		$("#SiteMenu ul li").each(function(){
//				$(this).click(function(){
//					$(this).find("div").slideDown('fast');
//					$(this).siblings().find("div").slideUp('fast');
//				});
//		})
//		},
//		function(){window.setTimeout(function(){$("#SiteMenu ul li div").slideUp('fast');}, 2000);}
//	);
	var bigMenuID = -1;
	$("#SiteMenu ul li").each(function(i){
		$(this).click(function(){
			$(this).find("div").slideDown('fast');
			$(this).siblings().find("div").slideUp('fast');
			if(bigMenuID > 0) {
				var o = $("#SiteMenu ul li img[@name=image"+ bigMenuID +"]");
				o.attr("src", pic[bigMenuID]);
				//o.parent().attr("onmouseout", function(){MM_swapImgRestore()});
			}
			//alert($("#SiteMenu ul li img[@name=image"+ bigMenuID +"]").parent().attr("onmouseout"));
			bigMenuID = i;
			$("#SiteMenu ul li img[@name=image"+ i +"]").attr("src", pic1[i]);
			//$("#SiteMenu ul li img[@name=image"+ bigMenuID +"]").parent().removeAttr("onmouseout");
		});
			//$(this).find("a").find("img").attr("src", o + ".gif")
	});
	$("#SiteMenu ul li div a img").hover(function(){mon(this);},function(){mout(this);});
})
//-------------------------------------=================================JQUERY Documnet=================---------------

//-->