﻿<!--
//-----------------------------------------
function CheckLogin(){
    if(document.getElementById("ctl00_SiteContentPlaceHolder_txtMemberNick").value==""){
      alert('会员名不能为空！');
      document.getElementById("ctl00_SiteContentPlaceHolder_txtMemberNick").focus();
      return false;
    }
    if(document.getElementById("ctl00_SiteContentPlaceHolder_txtMemberPWD").value==""){
      alert('登录密码不能为空！');
      document.getElementById("ctl00_SiteContentPlaceHolder_txtMemberPWD").focus();
      return false;
    }
}
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 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;
	return 	d.src = o.substring(0,o.length-5) + o.substring(o.length-5,o.length-4) + "_.gif";
}
function mout(d) {
	var o = d.src;
	return 	d.src = o.substring(0,o.length-6) + o.substring(o.length-6,o.length-5) + ".gif";
}
//-------------------------------------=================================JQUERY Documnet=================---------------
$(function(){
	$("#SiteNav li a img:not([@id])").hover(function(){mon(this);}, function(){mout(this);});
	$("#LeftTitleList li a img:not([@id])").hover(function(){mon(this);}, function(){mout(this);});
})
//-------------------------------------=================================JQUERY Documnet=================---------------

//-->
