/*function qt(url)
{
	window.open(url+'quicktour/qt1.php','quicktour','height=572,width=800,toolbar=no,menubar=no,scrollbars=no,top=50,left=100,resizable=no');
}*/
function referafriend(url)
{
	window.open(url+"prreferafriend.php",'popuptellothers','height=485,width=392,toolbar=no,menubar=no,scrollbars=no,top=90,left=200,resizable=no');
}
function terms(url)
{
	window.open(url+'prtermscondition.php?popup=1','ARPOPUP', 'height=600,width=500,toolbar=no,scrollbars=yes,top=50,left=100,resizable=no');
	return false;
}
function personalguarantee(url)
{
	window.open(url+"prgurantee-popup.php",'personalguarantee','height=280,width=392,toolbar=no,menubar=no,scrollbars=no,top=90,left=200,resizable=no');
}
function ValidatorTrim(s) {
    var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
    return (m == null) ? "" : m[1];
}
function checkEmail(strng)
{
	var error = "";
	if (strng == "")
		{
		error = "You did not enter an email-address.\n";
		}
	var emailFilter=/^.+@.+\..{2,4}$/;
	if (!(emailFilter.test(strng))) 
		{ 
		error = "Please enter a valid email address.\n";
		}
		if(ck(strng)>1)
		{
		error = "Please enter a valid email address.\n";
		}
	var illegalChars= /[\~\~\!\#\$\%\^\&\*\(\)\ \-\=\+\|\-\[\]\{\}\'\:\;\?\>\<\,\(\)\<\>\,\;\:\\\/\"\[\]]/;
	if(strng.match(illegalChars))
		{
		error = "The email address contains illegal characters.\n";
		}
	return error;
}
function ck(valstring) {
 var _m = "@".toLowerCase(); // pattern to match.
 var _s = valstring.toLowerCase();
 var _c = 0; // count
 for (var i=0;i<_s.length;i++) {
   if (_m == _s.substr(i,_m.length))
     _c++;
 }
 return _c;
}
function tellfriend(url,id,title,vtitle)
{
	var url = url+'prreferafriend.php';
	if(typeof(id)!="undefined")
	url = url + "?articleid=" + escape(id);
	if(typeof(title)!="undefined")
	url = url + "&title=" + escape(title);
	if(typeof(vtitle)!="undefined")
	url = url + "&videotitle=" + escape(vtitle);
	window.open(url,'popuptellothers','height=485,width=392,toolbar=no,menubar=no,scrollbars=no,top=150,left=200,resizable=no');
}
function addcomment(url,id,title)
{
	var url = url+'articles/popup-addcomments.php';
	if(typeof(id)!="undefined")
	url = url + "?articleID=" + escape(id);
	if(typeof(title)!="undefined")
	url = url + "&title=" + escape(title);
	//window.open(url+"articles/popup-addcomments.php",'popupaddcomment','height=420,width=392,toolbar=no,menubar=no,scrollbars=no,top=90,left=200,resizable=no');
	window.open(url,'popupaddcomment','height=420,width=392,toolbar=no,menubar=no,scrollbars=no,top=90,left=200,resizable=no');
}
function viewcomment(url,id,title)
{
	var url = url+'articles/popup-viewcomments.php';
	if(typeof(id)!="undefined")
	url = url + "?articleID=" + escape(id);
	if(typeof(title)!="undefined")
	url = url + "&title=" + escape(title);
	//window.open(url+"articles/popup-viewcomments.php",'popviewcomment','height=380,width=392,toolbar=no,menubar=no,scrollbars=yes,top=90,left=200,resizable=no');
	window.open(url,'popviewcomment','height=380,width=392,toolbar=no,menubar=no,scrollbars=yes,top=90,left=200,resizable=no');
}