function show_chat_window()
{
    var WHeight = 360;
    var WWidth = 460;
	var Sheight = screen.availHeight-50;
	var Swidth = screen.availWidth;
	var Wleft = (Swidth-WWidth)/2;
	var Wtop = (Sheight-WHeight)/2;
	window.open("http://www.privatewriting.com/chat/request.php?l=admin&x=1&deptid=1&page=http%3A//www.privatewriting.com/index.php", "_blank", "left="+Wleft+", top="+Wtop+", height="+WHeight+", width="+WWidth+", scrollbars=no, resizable=no, status=no, toolbar=no, menubar=no, location=no");	
}
function show_contact_us()
{
    var WHeight = contactUsWin.height;
    var WWidth = contactUsWin.width;
	var Sheight = screen.availHeight-50;
	var Swidth = screen.availWidth;
	var Wleft = (Swidth-WWidth)/2;
	var Wtop = (Sheight-WHeight)/2;
	window.open('./?op=contact_us','contact_us', 'scrollbars=no, resizable=no, status=no, toolbar=no, menubar=no, location=no, left='+Wleft+', top='+Wtop+',height='+WHeight+', width='+WWidth);
}
function show_terms()
{
	var WHeight = termsWin.height;
	var WWidth = termsWin.width;
	var Sheight = screen.availHeight-50;
	var Swidth = screen.availWidth;
	var Wleft = (Swidth-WWidth)/2;
	var Wtop = (Sheight-WHeight)/2;
	window.open('./?op=terms','terms', 'scrollbars=yes, resizable=yes, status=no, toolbar=no, menubar=no, location=no, left='+Wleft+', top='+Wtop+', height='+WHeight+', width='+WWidth);
}
function show_privacy()
{
	var WHeight = policyWin.height;
	var WWidth = policyWin.height;
	var Sheight = screen.availHeight-50;
	var Swidth = screen.availWidth;
	var Wleft = (Swidth-WWidth)/2;
	var Wtop = (Sheight-WHeight)/2;
	window.open('./?op=privacy_policy','terms', 'scrollbars=yes, resizable=yes, status=no, toolbar=no, menubar=no, location=no, left='+Wleft+', top='+Wtop+', height='+WHeight+', width='+WWidth);
}

function show_forgot_pass()
{
    var WHeight = forgotPassWin.height;
    var WWidth = forgotPassWin.width;
	var Sheight = screen.availHeight-50;
	var Swidth = screen.availWidth;
	var Wleft = (Swidth-WWidth)/2;
	var Wtop = (Sheight-WHeight)/2;

	window.open("./?op=show_forgot_pass", "_blank", "left="+Wleft+", top="+Wtop+", height="+WHeight+", width="+WWidth+", scrollbars=yes, resizable=yes, status=no, toolbar=no, menubar=no, location=no");	
}

function show_discount_table()
{
    var WHeight = discountTable.height;
    var WWidth = discountTable.width;
	var Sheight = screen.availHeight-50;
	var Swidth = screen.availWidth;
	var Wleft = (Swidth-WWidth)/2;
	var Wtop = (Sheight-WHeight)/2;
	window.open("./?op=discount_table", "_blank", "left="+Wleft+", top="+Wtop+", height="+WHeight+", width="+WWidth+", scrollbars=no, resizable=yes, status=no, toolbar=no, menubar=no, location=no");	
}
function show_ssl_info()
{
	var WHeight = sslInfoWin.height;
    var WWidth = sslInfoWin.width;
	var Sheight = screen.availHeight-50;
	var Swidth = screen.availWidth;
	var Wleft = (Swidth-WWidth)/2;
	var Wtop = (Sheight-WHeight)/2;
	window.open('./?op=ssl_info','ssl', "scrollbars=yes, resizable=yes, status=no, toolbar=no, menubar=no, location=no, left="+Wleft+", top="+Wtop+", height="+WHeight+", width="+WWidth);
}
function show_pci_compliance()
{
    var WHeight = contactUsWin.height;
    var WWidth = contactUsWin.width;
	var Sheight = screen.availHeight-50;
	var Swidth = screen.availWidth;
	var Wleft = (Swidth-WWidth)/2;
	var Wtop = (Sheight-WHeight)/2;
	window.open('./?op=pci_compliance','pci_compliance', 'scrollbars=no, resizable=yes, status=no, toolbar=no, menubar=no, location=no, left='+Wleft+', top='+Wtop+',height='+WHeight+', width='+WWidth);
}
function download_sample(s)
{
	if (s!=0)
	{
		window.open(s);
	}
	else
		alert("Please select sample to download.");
}

function addBookmark() {
	if (window.sidebar)
	{
		window.sidebar.addPanel(document.title,window.location.href,"");
	}
	else if( document.all )
	{
		window.external.AddFavorite(window.location.href, document.title);
	}
	else
	{
		return true;
	}
}

function echeck(str) 
{ 
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)

		if (lstr==0) {
			return true;
		}

		if (str.indexOf(at)==-1){
		   alert("Incorrect e-mail address.")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Incorrect e-mail address.")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Incorrect e-mail address.")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Incorrect e-mail address.")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Incorrect e-mail address.")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Incorrect e-mail address.")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Incorrect e-mail address.")
		    return false
		 }
	return true					
}

