function ValidateEmail(email) {
	var rx = new RegExp("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
	var matches = rx.exec(email);
	return (matches != null && email == matches[0]);
}
function Trim(s) {
    var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
    return (m == null) ? "" : m[1];
}
/*
Keep the user's cookie alive
*/
function MakeKeepAliveRequest(){
	if (!KeepAliveUrl)
		return;
	if (KeepAliveTimer != null)
		window.clearTimeout(KeepAliveTimer);
	var x = null;
	if (typeof XMLHttpRequest != "undefined") {
		x = new XMLHttpRequest();
	} 
	else {
		try {
			x = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				x = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {
			}
		}
	}	
	try{
		// don't do this asynchronously
		x.open("GET", KeepAliveUrl, false, "", "");
		x.send(null);
	}
	catch (e){
	}
	KeepAliveTimer = window.setTimeout(MakeKeepAliveRequest, 599999);
}
var KeepAliveUrl = "/KeepAlive.aspx";
var KeepAliveTimer = window.setTimeout(MakeKeepAliveRequest, 599999);
function OpenCertDetails(){
    thewindow =window.open('https://seal.thawte.com/thawtesplash?form_file=fdf/thawtesplash.fdf&dn=WWW.ISRAEL-DIAMONDS.COM&lang=en', 'anew','height=620,width=540,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes');
	thewindow.focus();
}
function Nothing(){}
var commonIsIE = (document.all) ? 1 : 0;
function ClickButtonWhenEnterKeyPress(e, btnID){
    var chr = (commonIsIE) ? e.keyCode : e.which;
    var ch = String.fromCharCode(chr);
    if (chr == 13){//Enter key was pressed
        //click wanted button
        if(btnID != ''){
            if(commonIsIE){
                document.getElementById(btnID).click();
            }
            else{
                document.getElementById(btnID).onclick();
            }
        }
        //prevent default button click
        if(commonIsIE){
            e.returnValue = false;
        }
        else{
            e.preventDefault();
        }
    }
}
//See: http://bytes.com/topic/javascript/answers/598383-how-display-textarea-value-span-innerhtml-br-netscape
function GetTextareaLines(s, alternativeLine){
    return s.
    replace(/&/g, "&amp;").
    replace(/</g, "&lt;").
    replace(/>/g, "&gt;").
    replace(/\r\n/g, alternativeLine).
    replace(/\r/g, alternativeLine).
    replace(/\n/g, alternativeLine);
}
function SearchSiteBoxSearch(txtSearchSite){
    if(document.getElementById(txtSearchSite).value != '')
        window.location = '/Search/Site/Default.aspx?q='+document.getElementById(txtSearchSite).value.replace(/ /g, '+');
}