﻿
lastDiv = null;
function onMouseOverDiv(theDiv)
{	
	theDiv.style.cursor = "hand";
	theDiv.style.border = "1 solid #fd9c04";	
}

function onMouseOutDiv(theDiv)
{
	theDiv.style.border = "1 solid #CCCCCC";
}

function divClick(theDiv,filename) {
	
	if (lastDiv) {
		lastDiv.style.border = "1 solid #CCCCCC";
	}
	lastDiv = theDiv;
	
	theDiv.style.border = "1 solid #ff0000";
	theDiv.style.cursor = "hand";
	
	if(document.getElementById("FileToDelete")!=null)
	{
		document.getElementById("FileToDelete").value = filename;
	}
}

function gotoFolder(newfolder) {
	window.navigate("ftb.imagegallery.aspx?frame=1&cif=" + newfolder);
}		

function returnImage(imagename,width,height) {
	var arr = new Array();
	arr["filename"] = imagename;  
	arr["width"] = width;  
	arr["height"] = height;			 
	window.parent.returnValue = arr;
	window.parent.close();	
}	

function ConfirmSubmitGuestbook()
{
	var result=window.confirm("我们将在第一时间予以回复您的咨询或跟您联系,请继续关注本站！");
	
	/*
	if(result==false)
	{
		window.event.returnValue =false;
	}
	*/
}

function KeyDownForSubmit()
{
    if (event.keyCode == 13)
    {
        event.returnValue=false;
        event.cancel = true;        
        aspnetForm._ctl0_MainContent_ProductList__ctl0_btnSearch.click();
    }
}

function KeyDownForSubmit2()
{
    if (event.keyCode == 13)
    {
        event.returnValue=false;
        event.cancel = true;        
        aspnetForm._ctl0_MainContent_ProductDetail__ctl0_btnSearch.click();
    }
}

function AddFav()
{ 
	url = "http://www.txrmyy.com/zh-CN/Default.html"; 
	title = "东莞市塘厦医院"; 
	window.external.AddFavorite(url,title); 
}


function overColor(Obj) {
    var elements = Obj.childNodes;
    for (var i = 0; i < elements.length; i++) {
        elements[i].className = "tdmouseover"
        Obj.bgColor = "";
    }

}
function outColor(Obj) {
    var elements = Obj.childNodes;
    for (var i = 0; i < elements.length; i++) {
        elements[i].className = "tdmouseout";
        Obj.bgColor = "";
    }
}

function MM_jumpMenu(targ, selObj, restore) { //v3.0
    if (selObj.selectedIndex != 0) {
        window.open(selObj.options[selObj.selectedIndex].value);     
        if (restore) selObj.selectedIndex = 0;
    }  
}


function CheckForm()
 {
     if (aspnetForm._ctl0_MainContent_MailToUs__ctl0_txtName.value == "") {
        alert("请填写好您的姓名！");
        aspnetForm._ctl0_MainContent_MailToUs__ctl0_txtName.focus();
        return (false);
    }

    if (aspnetForm._ctl0_MainContent_MailToUs__ctl0_txtMail.value == "") {
        alert("请填写好您的E-MAIL！");
        aspnetForm._ctl0_MainContent_MailToUs__ctl0_txtMail.focus();
        return (false);
    }
    else {
        //开始验证
        var email = aspnetForm._ctl0_MainContent_MailToUs__ctl0_txtMail.value;
        var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
        chkFlag = pattern.test(email);
        if (chkFlag) {
            return true;
        }
        else {
            alert("邮箱地址的格式不正确！");
            aspnetForm._ctl0_MainContent_MailToUs__ctl0_txtMail.focus();
            return false;
        }
     }

      
    if (aspnetForm._ctl0_MainContent_MailToUs__ctl0_txtTel.value == "") {
        alert("请填写好您的联系电话！");
        aspnetForm._ctl0_MainContent_MailToUs__ctl0_txtTel.focus();
        return (false);
    }

    if (aspnetForm._ctl0_MainContent_MailToUs__ctl0_txtContent.value == "") {
        alert("详细内容不能为空！");
        aspnetForm._ctl0_MainContent_MailToUs__ctl0_txtContent.focus();
        return (false);
    }
   // return (true);  
}