
function OnPrintPage(){
	var oWnd = window;
	var oDoc = oWnd.document;

	strLoc = "print.asp";
	if (window.navigator.userAgent.indexOf("MSIE ")!=-1 && navigator.appVersion.substr(0, 1) >= 4){

	if( typeof(frmRatings)=="object" ){
		var oPrint = frmRatings.document.getElementById("Print");
		if(oPrint != null) oPrint.click();
	}
	else{
		if( oWnd.printHiddenFrame == null){
			oDoc.body.insertAdjacentHTML("beforeEnd", "<iframe name='printHiddenFrame' width='0' height='0'></iframe>");
			framedoc = oWnd.printHiddenFrame.document;
			framedoc.open();
			framedoc.write(
				"<frameset name=test onload='printMe.focus();printMe.print();' rows=\"100%\">" +
				"<frame name=printMe src=\""+strLoc+"\">" +
				"</frameset>");
			framedoc.close();
		}
		else{
			oWnd.printHiddenFrame.printMe.focus();
			oWnd.printHiddenFrame.printMe.print();
		}
	}		
	}
	else{
		oWnd.location.href = strLoc;
	}
	return true;
}


function up_check(LoginForm) {
var un = LoginForm.username.value;
var pw = LoginForm.password.value;
if (un == "" && pw == "")
   {
   alert("Please enter your username and password...");
   return false;
   }
else if (un == "" && pw != "")
   {
   alert("Please enter your username...");
   return false;
   }
else if (un != "" && pw == "")
   {
   alert("Please enter your password...");
   return false;
   }
else
   return true;
}


function user_check(PassForm) {
var un = PassForm.username.value;
if (un == "")
   {
   alert("Please enter your username...");
   return false;
   }
else
   return true;
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function gb_check(LoginForm) {
pn = LoginForm.propername.value;
em = LoginForm.email.value;
re = getCheckedValue(LoginForm.elements['region'])
LoginForm.region.value;
if (pn == "" )
   { pn = "name, "; }
else
   { pn = "";  }
if (em == "" )
   { em = "email, "; }
else
   { em = "";  }
if (re == 0 )
   { re = "region "; }
else
   { re = "";  }
//if (re == null )
//   { re = "region "; }
//else
//   { re = "";  }
if (pn+em+re != "")  {
   alert("Please enter "+pn+em+re+"...");
   return false;
   }
else
   { return true; }
}

function pass_check(LoginForm) {
var un = LoginForm.username.value;
var pw1 = LoginForm.password1.value;
var pw2 = LoginForm.password2.value;
if (un == "" && ((pw1 == "") || (pw2 == "")))
   {
   alert("Please enter your username and new password...");
   return false;
   }
else if (un == "")
   {
   alert("Please enter your username...");
   return false;
   }
else if ((pw1 == "") || (pw2 == ""))
   {
   alert("Please enter your new password...");
   return false;
   }
else if (pw1 != pw2)
   {
   alert("Your 2 new passwords must be the same...");
   return false;
   }
else
   return true;
}

function pro_check(LoginForm) {
var ft = LoginForm.fty.value;
var fn = LoginForm.firstname.value;
var sn = LoginForm.lastname.value;
var ct = LoginForm.countryId.value;
var em1 = LoginForm.email1.value;
var em2 = LoginForm.email2.value;
var un = LoginForm.uname.value;
var pw1 = LoginForm.pass1.value;
var pw2 = LoginForm.pass2.value;
var tcx = LoginForm.tcchk.checked;

if (fn=="" || sn=="" || ct=="" || em1=="" || un=="" || (pw1=="" && ft=="new"))
   {
   alert("Error - please ensure all required fields are complete.");
   return false
   }

if (ct > 224)
   {
   alert("Error - please select a country.");
   LoginForm.countryId.focus();
   return false
   }

if (un.length < 6)
   {
   alert("Error - your username must be at least 6 characters long.");
   LoginForm.uname.focus();
   return false
   }
   
if (((ft=="new") && (pw1.length<6)) || ((ft=="upd") && (pw1.length<6) && (pw1.length>0)))
   {
   alert("Error - your password must be at least 6 characters long.");
   LoginForm.pass1.focus();
   return false
   }
   
if (pw1 != pw2)
   {
   alert("Error - your two passwords must be the same.");
   LoginForm.pass1.focus();
   return false
   }
   
if (em1 != em2)
   {
   alert("Error - your two email addresses must be the same.");
   LoginForm.email1.focus();
   return false
   }

if (!tcx)
   {
   alert("You must confirm that you have read the Terms & Conditions.");
   LoginForm.tcchk.focus();
   return false
   }

return true;
}

function list(node)
{ if (node.nextSibling.style.display == 'none')
	{ if (node.childNodes.length > 0)
		{ if (node.childNodes.item(0).nodeName == "IMG")
			{ node.childNodes.item(0).src = "images/minus.gif";
			}
		}
		node.nextSibling.style.display = 'block';
	}
	else
	{ if (node.childNodes.length > 0)
		{ if (node.childNodes.item(0).nodeName == "IMG")
			{ node.childNodes.item(0).src = "images/plus.gif";
			}
		}
		node.nextSibling.style.display = 'none';
	}
}

function listnp(node)
{ if (node.nextSibling.style.display == 'none')
	{ if (node.childNodes.length > 0)
		node.nextSibling.style.display = 'block';
	}
	else
	{ if (node.childNodes.length > 0)
		node.nextSibling.style.display = 'none';
	}
}

function popimage(imagesrc,winwidth,winheight,ttl) {
LPos = (screen.width) ? (screen.width-winwidth)/2 : 0;
TPos = (screen.height) ? (screen.height-winheight)/2 : 0;
ttl = (ttl != '') ? (ttl +' :: ') : ttl;
var ImageDir= "";
imagesrc = ImageDir + imagesrc;
timg = new Image();
timg.src = imagesrc;
var wid=timg.width;
var hei=timg.height;
var scrl = 'no';
if ((wid+60>screen.availWidth) || (hei+60>screen.availHeight)) {scrl = 'yes';}
var look='width='+winwidth+',height='+winheight+',scrollbars='+scrl+',resizable=no,top='+TPos+',left='+LPos;
popwin=window.open("","",look);
popwin.document.open();
popwin.document.write('<title>'+ttl+' Rowden Surname</title><META HTTP-EQUIV="imagetoolbar" CONTENT="no">');
popwin.document.write('<SCRIPT language="JavaScript">')
popwin.document.write('<!--')
popwin.document.write('pic1= new Image(wid,hei); ')
popwin.document.write('pic1.src=imagesrc; ')
popwin.document.write('//-->')
popwin.document.write('</SCRIPT>')
popwin.document.write('<body MARGINHEIGHT=0 MARGINWIDTH=0 topmargin=0 rightmargin=0 leftmargin=0 bgcolor=white>');
popwin.document.write('<SCR'+'IPT LANGUAGE=""JavaScript"">');
popwin.document.write('<!--');
popwin.document.write('function Fitit() {var hClip=1;var vClip=1;var image=document.images.FullImage;var width=image.width; var height=image.height;');
popwin.document.write('if (width>screen.availWidth){width+60=screen.availWidth;  hClip=0;}if(height+60>screen.availHeight){height=screen.availHeight;vClip=0;}');
popwin.document.write('window.resizeTo(width,  height);if(document.body&&document.body.clientWidth)window.resizeBy((width-document.body.clientWidth)*hClip,(height-document.body .clientHeight)*vClip );}');
popwin.document.write('function noRightClick(){if(event.button==2){alert("Rowden Surname ©  2007")}}document.onmousedown=noRightClick');
popwin.document.write('// -->');
popwin.document.write('</SCR'+'IPT>');
popwin.document.write('<img onClick="window.close(); return true" name="FullImage"  src="'+imagesrc+'" title="Click to Close" onload="Fitit()"> </body>');
popwin.document.close();
}

//function noRightClick()
//{
//	if (event.button==2)
//	{
//		alert("Rowden Surname © 2007")
//	}
//}
//document.onmousedown=noRightClick

function popwindow(url, w, h, srcl) {
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'left='+LeftPosition+',top='+TopPosition+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+srcl+',resizable=0,height='+h+',width='+w
link=window.open(url,"Link",settings);
}

function disable_enable() {
if (document.all || document.getElementById){
if (document.profile.septId.value!="0")
	{document.profile.septchk[0].disabled=false;
	document.profile.septchk[1].disabled=false;
	document.profile.emchk[0].disabled=false;
	document.profile.emchk[1].disabled=false }
else 
	{document.profile.septchk[0].disabled=true;
	document.profile.septchk[1].disabled=true;
	document.profile.emchk[0].disabled=true;
	document.profile.emchk[1].disabled=true }
if (document.profile.septId.value=="0" || document.profile.phoneno.value=="")
	{document.profile.phchk[0].disabled=true;document.profile.phchk[0].checked=false;
	document.profile.phchk[1].disabled=true;document.profile.phchk[1].checked=true }
else
	{document.profile.phchk[0].disabled=false;
	document.profile.phchk[1].disabled=false }
if (document.profile.septId.value=="0" || document.profile.skype.value=="")
	{document.profile.skchk[0].disabled=true;document.profile.skchk[0].checked=false;
	document.profile.skchk[1].disabled=true;document.profile.skchk[1].checked=true }
else
	{document.profile.skchk[0].disabled=false;
	document.profile.skchk[1].disabled=false }
}
}

function validEmail(email){      
	var emailReg = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
	return emailReg.test(email); 
}

function setVisible(obj) {

$(document).ready(function() {

	obj = document.getElementById(obj);
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
	$("div#dialog").empty() ;
	
	$('a[name=modal]').mouseover(function(e) {

	e.preventDefault();
	var id = $(obj).attr('href');
	var winH = $(window).height();
	var winW = $(window).width();
//	alert("width=" +winW +"px:  height="+winH +"px");
//	$("div#dialog").css('top', winH/2-$("div#dialog").height()/2);
	$("div#dialog").css('left', winW/2-$("div#dialog").width()/2);
	
}); 		// end of show_dialog mouseover function
}); 		// end of doc load
}


function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
}
} 


