/* 
	STYLE SHEET FOR GLOBALRENTAVILLA.COM SITE
Created by Andrew Purnell

Table Of Contents

	1. title
	2. disablerightclick
	3. E-mail filter
	4. Popup
	5. Netscape Correction
	6. Bookmark
	
/* - 1. title - */


var urlAddress = "http://www.globalrentavilla.com"; 
var pageName = "Park Lane Technologies Ltd - Your first choice for Overseas and UK rental property"; 
function addToFavorites() { if (window.external) { window.external.AddFavorite(urlAddress,pageName) 
} else { alert("Sorry! Your browser doesn't support this function, press Control + D."); 
} } // -->


/* - 2. disablerightclick - */


var message="No right clicking please, contact +44 (0)845 094 0900 for copyright terms! Thank you :-)";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")


/* - 3. Email filter - */


var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(e){
var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Please enter a valid email address.")
e.select()
}
return returnval
}

/* - 4. popup - */

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}


/* - 5. Netscape correction - */
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
// * Dependencies * 
// this function requires the following snippet:
// JavaScript/readable_MM_functions/findObj


/* - 6. Bookmark - */

<!-- // 
var urlAddress = "http://www.globalrentavilla.com"; 
var pageName = "Your number 1 choice for holiday homes bookings with owners"; 
function addToFavorites() { if (window.external) { window.external.AddFavorite(urlAddress,pageName) 
} else { alert("Sorry! Your browser doesn't support this function, please press Control + D."); 
} } // -->


