﻿// default.aspx
function alertLogin()
{ 
    var pop=new Popup({contentType:1, isReloadOnClose:false,scrollType:'no', width:400, height:300});
    pop.setContent('title','登录');
    pop.setContent('contentUrl','loginDiv.aspx');
    pop.build();
    pop.show();
}

function alertCounty()
{ 
    var pop=new Popup({contentType:1, isReloadOnClose:false,scrollType:'no', width:400, height:300});
    pop.setContent('title','选择地区');
    pop.setContent('contentUrl','http://www.1shai.com/listProvinceAreaCounty.aspx');
    pop.build();
    pop.show();
}

function alertDuty(url,title)
{ 
    var pop=new Popup({contentType:1, isReloadOnClose:false,scrollType:'no', width:540, height:300});
    pop.setContent('title',title);
    pop.setContent('contentUrl',url);
    pop.build();
    pop.show();
}
//告诉朋友，发邮件
function alertSendRecommend(xrinfoID)
{ 
    var pop=new Popup({contentType:1, isReloadOnClose:false,scrollType:'no', width:500, height:500});
    pop.setContent('title','告诉朋友');
    pop.setContent('contentUrl', 'sendRecommend.aspx?ID=' + xrinfoID);
    pop.build();
    pop.show();
}

//register.aspx
var popSys=null;
function popSys_RegOK(strHtml)
{
    if (document.readyState !="complete") return;
    popSys=new Popup({ contentType:2,isReloadOnClose:false,width:350,height:170});
    popSys.setContent("contentHtml",strHtml);
    popSys.setContent("title","中国寻人网提示");
    popSys.build();
    popSys.show();
}

function popSysClose ()
{
    popSys.close();
    window.location.href="Default.aspx";
}

//setting.aspx
function addPhoto()
{
	var pop=new Popup({contentType:1, isReloadOnClose:false,scrollType:'no', width:400, height:300});
	pop.setContent("title","你的大头照");
	pop.setContent("contentUrl",'uploadHeadPhoto.aspx');
	pop.build();
	pop.show();
}

//通用alert
function ShowAlert(title,alertContent)
{
    var pop=new Popup({ contentType:4,isReloadOnClose:false,width:340,height:80});
    pop.setContent("title",title);
    pop.setContent("alertCon",alertContent);
    pop.build();
    pop.show();
}

//跳出登录窗口
function alertLogin()
{
    var pop=new Popup({contentType:1, isReloadOnClose:false,scrollType:'no', width:400, height:300});
    pop.setContent('title','登录');
    pop.setContent('contentUrl','loginDiv.aspx');
    pop.build();
    pop.show();
}
//转到登录页面
function goLogin()
{
    window.location.href='login.aspx?toUrl='+ window.location.href;
}
//收藏一晒
function Add1Shai()
{ 
    url = "http://www.zgxrw.com";
    title = "中国寻人网，失踪人登记！"; 
    window.external.AddFavorite(url,title);
} 

//检查是否是邮件
function isEmail(s)   
{   
    var patrn=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;///^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;   
    if (!patrn.test(s)) 
    {
        return false;
    }
    else
    {
        return true ;
    } 
}
