
/******************************************************************************
**	Confirms logoff before redirecting to logout page
******************************************************************************/
function confirmLogoff(astrRoot) {
	var confirmedLogoff = window.confirm("Do you want to log out?\n\nClick 'OK' to proceed.");	
	if (confirmedLogoff) 
	{
		document.location.href = astrRoot+'/Logout.asp';
		return true;
	}	
}

/******************************************************************************
**	Window functions
******************************************************************************/
function popPDF(sFilename) {
	var winPDF = null;
	winPDF = open(sFilename,'winPDF','toolbar=no,location=0,directories=0,status=yes,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=800,height=600');
	winPDF.focus();	
}

function popWebMail() {
	var winWebMail = null;
	var sURL = "http://webmail.slingshot.com.au/";
	winWebMail = open(sURL,'winWebMail','toolbar=no,location=0,directories=0,status=yes,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=800,height=600');
	if (winWebMail) winWebMail.focus();		
}

function popWebMailDemo() {
	var winWebMailDemo = null;
	var sURL = "/images/misc/webmail-demo.gif";
	winWebMailDemo = open(sURL,'winWebMailDemo','toolbar=no,location=0,directories=0,status=yes,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=780,height=530');
	if (winWebMailDemo) winWebMailDemo.focus();		
}

function popTerms() {
	var winTerms = null;
	var sURL = "/?PageID=600&PageMode=Popup";
	winTerms = open(sURL,'winTerms','toolbar=no,location=0,directories=0,status=yes,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=800,height=600');
	if (winTerms) winTerms.focus();		
}

function popVisibill() {
	var winVisibill = null;
	var sURL = "http://callplus.visibill.co.nz/";
	winVisibill = open(sURL,'winVisibill','toolbar=no,location=0,directories=0,status=yes,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=800,height=600');
	if (winVisibill) winVisibill.focus();
}

function popPostcodeFinder() {	
	var winPostcodeFinder = null;
	var sURL = "http://www1.auspost.com.au/postcodes/";
	winPostcodeFinder = open(sURL,'winPostcodeFinder','toolbar=no,location=0,directories=0,status=yes,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=800,height=600');
	if (winPostcodeFinder) winPostcodeFinder.focus();		
}

function popDPSTerms() {
	var winDPSTerms = null;
	var sURL = "http://www.paymentexpress.com/privacypolicy.htm";
	winDPSTerms = open(sURL,'winDPSTerms','toolbar=no,location=0,directories=0,status=yes,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=800,height=600');
	if (winDPSTerms) winDPSTerms.focus();		
}

function popLocal(iPageID) {
	var winLocal = null;
	var sURL = "/?PageID=" + iPageID + "&PageMode=Popup";
	winLocal = open(sURL,'winLocal','toolbar=no,location=0,directories=0,status=yes,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=600,height=600');
	if (winLocal) winLocal.focus();		
}

function popSizedLocal(iPageID, iWidth, iHeight) {
	var winLocal = null;
	var sURL = "/?PageID=" + iPageID + "&PageMode=TinyPopup";
	winLocal = open(sURL,'winLocal','toolbar=no,location=0,directories=0,status=no,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=' + iWidth + ',height=' + iHeight);
	if (winLocal) winLocal.focus();		
}

function popTCNZLineChecker(sLineNumber) {
	var winLineCheck = null;
	var sURL = "/?PageID=20&PageMode=TinyPopup&LineNumber=" + sLineNumber;	
	winLineCheck = winLocal = open(sURL,'winLineCheck','toolbar=no,location=0,directories=0,status=yes,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=600,height=600');
	if (winLineCheck) winLineCheck.focus();						
}


/******************************************************************************
**	Google functions
******************************************************************************/

function checkEnter(e){ //e is event object passed from function invocation
	var characterCode 	

	 if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	 }
	 else{							
		e = event						
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	 }
	 
	 if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
		if (document.Form1.elements("SearchScope")[0].checked == false) {
			window.open('http://www.google.com/search?q='+escape(document.Form1.q.value)+'&sitesearch=www.slingshot.co.nz','','fullscreen=no,toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=yes,location=yes');			
		} else {
			window.open('http://www.google.com/search?q='+escape(document.Form1.q.value),'','fullscreen=no,toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=yes,location=yes');
		}
		return false 
	 }
	 else{
		return true 
	 }
}

function OpenGoogle() {

		var ret = window.open('http://www.google.com/search?q='+escape(document.Form1.q.value)+document.Form1.url.value,'','fullscreen=no,toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=yes,location=yes');
}


function setWWW() {

		document.Form1.url.value = ''
}

function setSS() {

		document.Form1.url.value = '&sitesearch=www.slingshot.co.nz'
}



/******************************************************************************
**	Rollover functions
******************************************************************************/
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

