//------------------------------------------------------------------------------
// Interchange Group PVCS Authorised Header
// (c) Copyright 2003 Interchange Group Limited.  All rights reserved.
//
// $Header:   R:/htmc/public.jsV   1.0.1.0   Sep 17 2003 09:32:32   R.Clarke  $
//------------------------------------------------------------------------------
//
// Name    : com_public.js
// Date    : 17/09/2003
// Author  : R.Clarke
//
// Process : Public Javascript function library for the customer portal.
//
//------------------------------------------------------------------------------
//
// (c) Copyright 2003 Interchange Group Limited.  All rights reserved.
//
//      This software is furnished under a licence and may only be used
//      or copied in accordance with the terms of such licence.
//
//----------------------------------------------------------------------------->

function hoverOver(MessageID){
// Javascript function: hoverOver
// usage: onmouseover='return hoverOver();'
//
	if (MessageID==0){	
		window.status='';
	}
	if (MessageID==1){	
		window.status='Click here to go back';
	}
	if (MessageID==2){	
		window.status='Click here for more details';
	}
	if (MessageID==3){	
		window.status='Click here to continue';
	}
	
	return true
}

function hoverOut(){
// Javascript function: hoverOut
// usage: onmouseout='return hoverOut();'
//
	
	window.status='';
	return true;

}

function closeWindow(){
	parent.close();
	return true
}

function signIn(secureMode){
	var topCorner=Math.floor((screen.availHeight - 550)/2);
	if (topCorner<0) topCorner=0;
	var leftCorner=Math.floor((screen.availWidth - 780)/2);
	if (leftCorner<0) leftCorner=0;

	var newwindow = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no";
	newwindow = newwindow + ",width=780,height=550";
	newwindow = newwindow + ",top=" + topCorner + ",left=" + leftCorner;
	newwindow = newwindow + ",screenY=" + topCorner + ",screenX=" + leftCorner;

	if (secureMode==0) {

		var nw = window.open("about:blank","_igportal",newwindow);

		document.forms[0].action = "http://customer.interchange.co.uk/default.asp";
		document.forms[0].target = "_igportal";
		document.forms[0].submit();
		document.forms[0].reset();
		document.forms[0].UID.focus();
		nw.focus();
		return false;
	}

	if (secureMode==1) {
		var nw = window.open("about:blank","_igportal",newwindow);

		document.forms[0].action = "https://customer.interchange.co.uk/default.asp";
		document.forms[0].target = "_igportal";
		document.forms[0].submit();
		document.forms[0].reset();
		document.forms[0].UID.focus();
		nw.focus();
		return false;
	}

}

function disableRightClick(){
//Disable right mouse click Script

	var message="That function is not available!";
	///////////////////////////////////
	function clickIE() {if (document.all) {alert(message);return false;}}
	function clickNS(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=clickNS;}
	else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

	document.oncontextmenu=new Function("return false")
}

disableRightClick();
