
function handleError() {
	return true;
}

window.onerror = handleError;

    function mailto(user) 
    { 
        document.location.href = "mailto:" + user + "@nanny-agency.com"; 
    }

function MainRegisterFamily() {
	if (document.all) {document.all.family.style.visibility = 'visible';
					   document.all.nanny.style.visibility = 'hidden'}
	if (document.layers) {document.family.style.visibility = "visible";
					      document.nanny.style.visibility = "hidden"}
	if (document.getElementById&&!document.all) {document.getElementById('family').style.visibility="visible";
												 document.getElementById('nanny').style.visibility="hidden"}
}


function MainRegisterNanny(){
	if (document.all) {document.all.nanny.style.visibility = "visible";
					   document.all.family.style.visibility = "hidden"}
	if (document.layers) {document.nanny.style.visibility = "visible";
					      document.family.style.visibility = "hidden"}
	if (document.getElementById&&!document.all) {document.getElementById('nanny').style.visibility="visible";
												 document.getElementById('family').style.visibility="hidden"}

}

function CloseHelpMenu(){
if (document.all) {document.all.tip.style.visibility = 'hidden'}
if (document.layers) {document.tip.visibility="hidden"}
if (document.getElementById&&!document.all){document.getElementById('tip').style.visibility="hidden"}	
}

var topposition=0
var leftposition=0
var x,y
var xdistance, ydistance
var xD,yD
var message



function Tip(cont,Type){
	if (cont==1){content='Guests and members click here to update, archive or delete your profile. If you archive your profile it won\'t appear on any searches and you can re-activate it at anytime, without the need to register again.'}
	if (cont==2){content='Guests and members click here to add, view or change the photos on your profile, a profile with photos generates 3 times more interest.'} 
	if (cont==3){content='When you browse through our lists, click the add to Wish-List button, you can then at any time click here to view all the nannies and aupairs on your Wish-List.'}
	if (cont==4){content='For members we have more advanced search options like exact matches.'} 
	if (cont==5){content='Members can add MS Word documents to their profile, for example a resume/CV or a letter to any prospective nanny or aupair'}
	if (cont==6){content='Members can record anything they like in their own journal for example observations on applicants or jobs, these are of course saved for any future visits to the site. The journal also records the list of applicants emails have been sent to.'} 
	if (cont==15){content='Members can email any other members or guests directly from the site and automatically add a link to their profile, no need for your own email client, this is recorded in the journal.'}
	if (cont==7){content='Help in regard to obtaining visas for the most popular destinations.'}
	if (cont==8){content='Change your email notification preferences and switch of these menu tips permanently.'}
	if (cont==9){content='We always welcome suggestions from our members to help improve this site in any possible way.'}
	if (cont==10){content='Purchase a membership in order to view all contact details and other benefits.'}
	if (cont==11){content='Details of different membership options and our terms for nannies and aupairs.'} 
	if (cont==12){content='Details of different membership options and our terms for families.'}
	if (cont==13){content='Please report any problems or remarks you have in regard to your membership.'}
	if (cont==14){content='If you are a nanny or aupair agency and wish to be added to our list find out the details here.'}    
    if (cont==16){content='<br>&nbsp;LEGEND:<br><br>&nbsp;<img src="Images/WishList.gif" width="22" height="22"  border="0">&nbsp;Add to Wish-List&nbsp<br>&nbsp;<img src="Images/WishListB.gif" width="22" height="22"  border="0">&nbsp;Remove from Wish-List&nbsp<br>&nbsp;<img src="Images/WishListY.gif" width="22" height="22"  border="0">&nbsp;Already on Wish-List&nbsp<br>&nbsp;<img src="Images/Email.gif" width="22" height="22"  border="0">&nbsp;Members send an email&nbsp<br>&nbsp;<img src="Images/EmailY.gif" width="22" height="22"  border="0">&nbsp;Already emailed<br><br>HAS:<br><br>&nbsp;<img src="Images/camera.gif" width="20" height="18"  border="0">&nbsp;More Photos<br>&nbsp;<img src="Images/CV.gif" width="20" height="18"  border="0">&nbsp;Documents<br>&nbsp;<img src="Images/earth.gif" width="20" height="18"  border="0">&nbsp;A website<b></b>'}
	if (cont==17){content='You need to be registered to have a Wish-List and a member to be able to email.'}
	if (cont==18){content='Click to view this profile.<br>To return to this page click <i>Back to previous page</i> at the end of profile page.'}
	if (cont==19){content='This column is for a membership of 1 month.'}
	if (cont==20){content='This column is for a membership of 3 months.'}
	if (cont==21){content='If you liked our site and found it useful, please add your testimonial.'}
	if (cont==22){content='Some tips on the best way to use this site.'}
	if (cont==23){content='If you have lost your ID or password please click here.'}
	if (cont==24){content='If you have any questions regarding how the site works, please email us..'}
	if (cont==25){content='Some of the most popular questions that we have been asked.'}	
	if (cont==26){content='If you know the ID of the family or nanny that you want, then please specify in the drop-down box, Family or Nanny and then enter the ID.'}	
	if (cont==27){content='As you can pay for your membership with either US Dollars, Pounds or Euros. Use our currency converter to calculate the current rate.'}
	if (cont==28){content='Please enter your nationality, not your ethnic origin, for example American, British...etc.'}
	if (cont==29){content='Please enter as much information as possible, this is the part families see when they are perusing the lists. But no contact information please.'}
	if (cont==30){content='click for full size photo.'}
	if (cont==31){content='<font color=#ff3333><I>NEW</I></font> As requested by our registered users &amp; members<br> you can now SWITCH OFF<br>the help and tips pop-ups. Just click YOUR SETTING on the left menu.'}
	if (cont==32){content='To view contact information for all our nannies, please purchase a membership.'}
	if (cont==33){content='Click to view your complete account information.'}
	if (cont==34){content='Click for Live Chat! members may chat to other members, members may also invite guests to chat.'}
	if (cont==35){content='Members and registered guests click to add to your Wish-List.'}
	if (cont==36){content='Click to add to your Wish-List.'}
	if (cont==37){content='Advertising opportunies on this site.'}
	if (cont==38){content='Email this applicant.'}
	if (cont==39){content='Members click to email this applicant.'}
	if (cont==40){content='Email this family.'}
	if (cont==41){content='Members click to email this family.'}
	if (cont==42){content='Full profile of next listing in your search results.'}
	if (cont==43){content='Back to your search results.'}
	
if (Type=='H'){	var HTMLcontent = "<Table border=0 width=100% align=center><TR><TD><img src='Images/Help.Gif' height=16 width=16></TD><TD bgcolor=#cccccc width=80% style='cursor:help;'><font color=#ff0000><b>&nbsp;&nbsp;HELP?</b></font></TD><TD align=center bgcolor=#808080 onclick='document.all.tip.style.visibility=\"hidden\"' style='cursor:hand;'><font color=#000000><b>X</b></font></TD></TR><TR><TD colspan=3><font color=black>"}
if (Type=='T'){	var HTMLcontent = "<Table border=0 width=100% align=center><TR><TD><img src='Images/Tip.Gif' height=16 width=16></TD><TD bgcolor=#cccccc width=80%><font color=#330066><b>&nbsp;&nbsp;TIP</b></font></TD><TD align=center bgcolor=#808080 onclick='document.all.tip.style.visibility=\"hidden\"' style='cursor:hand;'><font color=#000000><b>X</b></font></TD></TR><TR><TD colspan=3><font color=black>"}
HTMLcontent +=  content 
HTMLcontent += "</font></TD></TR><TR><TD colspan=3 style='color:blue;font-size:9px;'>To switch these off, adjust <i>Your settings</i> on the left menu.</TD></TR></TABLE>"	
tipheight= (content.length*1.2) + 60
if (cont==16){leftposition=663 ; topposition=107;} else if (cont==31){leftposition=320 ; topposition=10; setTimeout ("CloseHelpMenu()", 10000)}
else {leftposition=x+xdistance ; topposition=y+ydistance; setTimeout ("CloseHelpMenu()", 10000)}

	if (document.all) {	
		document.all.tip.style.posLeft=leftposition
		document.all.tip.style.posTop=topposition
		document.all.tip.style.visibility="visible"
     	tip.innerHTML=HTMLcontent
		
	}
	if (document.layers) {
        document.tip.left=leftposition
		document.tip.top=topposition
		document.tip.visibility="visible"
	   	document.tip.document.write(HTMLcontent)
		document.tip.document.close()
	}

	
	if (document.getElementById&&!document.all){
		document.getElementById('tip').style.left=leftposition
		document.getElementById('tip').style.top=topposition
		document.getElementById('tip').style.visibility="visible"
       	document.getElementById('tip').innerHTML=HTMLcontent
	}


}


function handlerMM(e){

	if (document.getElementById&&!document.all) {
	
	x = e.pageX
	y = e.pageY
	xD = e.screenX
	xY = e.screenY
	}
	else {
	
	x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
	y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
	xD = (document.layers) ? e.screenX : event.screenX
	yD = (document.layers) ? e.screenY : event.screenY
	}
	
		
	if ( xD <= window.screen.availWidth/2) { xdistance = 40;}
	else { xdistance = -240;}
    if ( yD <= window.screen.availHeight/2) { ydistance = 10;}
    else { ydistance = -10;}	
	
}

if (document.layers || (document.getElementById&&!document.all)){
	document.captureEvents(Event.MOUSEMOVE);
	}
document.onmousemove = handlerMM;

function LinkedTo(WhichHref) {
document.location.href = (WhichHref)
}


var months=new Array(13);
months[1]="Jan";
months[2]="Feb";
months[3]="Mar";
months[4]="Apr";
months[5]="May";
months[6]="Jun";
months[7]="Jul";
months[8]="Aug";
months[9]="Sep";
months[10]="Oct";
months[11]="Nov";
months[12]="Dec";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (navigator.appName == "Netscape"){year=1900 + year;}
year=year.toString()
year=year.substr(2);
var DisplayDate ="<font style='font-face:Courier New,Courier,monospace;font-size:9px'>"+date+"-"+lmonth+"-"+year+"</font>"
var JournalDate=date+"-"+lmonth+"-"+year

function ValidateLoginForm(){
				if (window.document.LoginForm.password.value==''){
				window.alert("Please enter your password!");
				window.document.LoginForm.password.focus();
				window.document.LoginForm.password.style.backgroundColor='red';
				return false;
				}				
				if (isNaN(parseInt(window.document.LoginForm.ID.value))){
				window.alert("Please enter your family or nanny ID as a number!");
				window.document.LoginForm.ID.focus();
				window.document.LoginForm.ID.style.backgroundColor='red';
				return false;
				}				
				
window.document.LoginForm.submit();
} 
function ValidateSearchForm(){
			
				if (isNaN(parseInt(window.document.SearchForm.ID.value))){
				window.alert("Please enter the family or nanny ID as a number!");
				window.document.SearchForm.ID.focus();
				window.document.SearchForm.ID.style.backgroundColor='red';
				return false;
				}		
				
window.document.SearchForm.submit();
} 

function ValidateThreadForm(){
if (window.document.Form.Name.value==''){
window.alert("Please enter your name!");
				window.document.Form.Name.focus();
				window.document.Form.Name.style.backgroundColor='red';
				return false;
				}
if (window.document.Form.Name.value.indexOf('http')!=-1){
window.alert("Html Tags are not allowed!");
				window.document.Form.Name.focus();
				window.document.Form.Name.style.backgroundColor='red';
				return false;
				}
				
if (window.document.Form.Subject.value==''){
window.alert("Please enter the subject of your post!");
				window.document.Form.Subject.focus();
				window.document.Form.Subject.style.backgroundColor='red';
				return false;
				}
if (window.document.Form.Subject.value.indexOf('http')!=-1){
window.alert("Html Tags are not allowed!");
				window.document.Form.Subject.focus();
				window.document.Form.Subject.style.backgroundColor='red';
				return false;
				}
if (window.document.Form.Body.value==''){
window.alert("Please enter a decription of your post!");
				window.document.Form.Body.focus();
				window.document.Form.Body.style.backgroundColor='red';
				return false;
				}
if (window.document.Form.Body.value.indexOf('http')!=-1){
window.alert("Html Tags are not allowed!");
				window.document.Form.Body.focus();
				window.document.Form.Body.style.backgroundColor='red';
				return false;
				}
if (window.document.Form.RTC[0].checked){
window.alert("You must confirm that you have read the forums Terms Of Use.");
				return false;
				}
if (window.document.Form.UploadFile.value!=''){
FileExtension=window.document.Form.UploadFile.value.substring(window.document.Form.UploadFile.value.length-3,window.document.Form.UploadFile.value.length);
FileExtension=FileExtension.toLowerCase();
if (FileExtension!='jpg' && FileExtension!='gif'){
window.alert("You can only send us .jpg or .gif files here.");
				return false;
				}
				}
window.document.Form.submit();
}


function ValidateMessageForm(){
if (window.document.Form.Name.value==''){
window.alert("Please enter your name!");
				window.document.Form.Name.focus();
				window.document.Form.Name.style.backgroundColor='red';
				return false;
				}

if (window.document.Form.Body.value==''){
window.alert("Please enter a decription of your post!");
				window.document.Form.Body.focus();
				window.document.Form.Body.style.backgroundColor='red';
				return false;
				}
if (window.document.Form.RTC[0].checked){
window.alert("You must confirm that you have read the forums Terms Of Use.");
				return false;
				}
window.document.Form.submit();
}



function HelpWindow(n){
var header = document.getElementById('h'+n).innerHTML;
var message= document.getElementById('m'+n).innerHTML;
var theobject = document.getElementById('nannyhelp');
theobject.style.visibility='visible';
document.getElementById('messageHeader').innerHTML=header;
document.getElementById('messageBody').innerHTML=message;

var dsoctop=document.all? window.document.body.scrollTop : window.pageYOffset
if (document.all||document.getElementById){
theobject.style.top=(dsoctop+10)+"px";
}
}


function mailpage(){
var mailText = 'mailto:?subject=This might interest you';
mailText +='&body= I found this at: ' + location.href;
location.href= mailText;
}

function properformat(FieldName){
var newString=''
var mytext=document.Form1[FieldName].value
for (i=0; i<mytext.length; i++){
if (i==0) {newString=mytext.substr(i,1).toUpperCase()}
else if (mytext.substr(i-1,1)!='.' && mytext.substr(i-1,1)!=' '){newString=newString+mytext.substr(i,1).toLowerCase()}
 
else {newString=newString+mytext.substr(i,1)}
}
document.Form1[FieldName].value=newString
}

//JQUERY STUFF
//Large Photo on home and list pages
$(document).ready(function(){
							$("img.nannyPhoto, img.familyPhoto").hover(function(e){
										if (($(this).attr('class'))=="nannyPhoto"){
										var imgSRC="Upload/"+$(this).attr('id')+".jpg";};
										if (($(this).attr('class'))=="familyPhoto"){
										var imgSRC="FUpload/"+$(this).attr('id')+".jpg";};
										var pos = $(this).position();
										var thisleft = e.pageX+10;
										var thistop = pos.top + "px";
										var thisposition = "top:"+thistop+"; left:"+thisleft
										$("body").prepend("<div class='NewDiv' style='display:none; position:absolute; border:2px groove brown; padding:3px; background-color:#F5F5DC; z-index:999;"+thisposition+"'><img src='"+imgSRC+"'></Div>");
										$("body div.NewDiv").fadeIn(2000);
													}, function(){
													$("body div.NewDiv").remove();	
													});
							

							$("span[class*='EnlargePhoto']").hover(function(e){
										var imgElementID = $(this).attr('id')
										if (($(this).attr('class'))=="NannyEnlargePhoto"){
										var imgSRC="Upload/"+imgElementID+".jpg";};
										if (($(this).attr('class'))=="FamilyEnlargePhoto"){
										var imgSRC="FUpload/"+imgElementID+".jpg";};
										var thisleft = e.pageX+20;
										var thistop = 0;									
										var thisposition = "top:"+thistop+"; left:"+thisleft
										$("body").prepend("<div style='position:absolute; border:2px groove brown; padding:3px; background-color:#F5F5DC; z-index:999;"+thisposition+"' Class='NewDiv'><img src='"+imgSRC+"'></Div>");
										var imgHeight = $("div.NewDiv img").height();
										thistop = e.pageY - imgHeight/2;
										$("div.NewDiv").animate({top:thistop}, 1000);
										
										
													}, function(){
													$("body div.NewDiv").remove();
													//$("body div:first").remove();	
													});		  
		  
		  
		  });



	
	
	