// Refreshing Time


// Tel Aviv
//----------------------------------------------------------------------------------
function startclock2(){


var thetime=new Date();

var nhours=thetime.getHours()+7;
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var AorP=" ";


if(nhours > 12)
    nhours = nhours - 12;



if (nhours<=12)
    AorP="pm";
else
    AorP="am";

if (nhours>=13)
    nhours-=12;

if (nhours==0)
   nhours=12;

if (nsecn<10)
 nsecn="0"+nsecn;

if (nmins<10)
 nmins="0"+nmins;

if(nhours<0)
 nhours=nhours*-1;


//document.clockform.clockspot2.value = nhours+":"+nmins+":"+nsecn+""+AorP;
document.clockform.clockspot2.value = nhours+":"+nmins+" "+AorP;



setTimeout('startclock2()',1000);

} 

//----------------------------------------------------------------------------------


// Antwerp
//----------------------------------------------------------------------------------
function startclock3(){


var thetime=new Date();

var nhours=thetime.getHours() + 6;
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var AorP=" ";



if(nhours > 12)
    nhours = nhours - 12;



if (nhours<=12)
    AorP="pm";
else
    AorP="am";

if (nhours>=13)
    nhours-=12;

if (nhours==0)
   nhours=12;

if (nsecn<10)
 nsecn="0"+nsecn;

if (nmins<10)
 nmins="0"+nmins;

if(nhours<0)
 nhours=nhours*-1;


document.clockform.clockspot3.value = nhours+":"+nmins+" "+AorP;



setTimeout('startclock3()',1000);

} 

//----------------------------------------------------------------------------------


// New York
//----------------------------------------------------------------------------------
function startclock4(){


var thetime=new Date();

var nhours=thetime.getHours();
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var AorP=" ";

if (nhours>=12)
    AorP="pm";
else
    AorP="am";

if (nhours>=13)
    nhours-=12;

if (nhours==0)
   nhours=12;

if (nsecn<10)
 nsecn="0"+nsecn;

if (nmins<10)
 nmins="0"+nmins;

if(nhours<0)
 nhours=nhours*-1;


document.clockform.clockspot4.value = nhours+":"+nmins+" "+AorP;



setTimeout('startclock4()',1000);

} 

//----------------------------------------------------------------------------------


// Hong Kong
//----------------------------------------------------------------------------------
function startclock5(){


var thetime=new Date();

var nhours=thetime.getHours()+13;
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var AorP=" ";


if(nhours > 12)
    nhours = nhours - 12;



if (nhours<=12)
    AorP="pm";
else
    AorP="am";

if (nhours>=13)
    nhours-=12;

if (nhours==0)
   nhours=12;

if (nsecn<10)
 nsecn="0"+nsecn;

if (nmins<10)
 nmins="0"+nmins;


if(nhours<0)
 nhours=nhours*-1;	


document.clockform.clockspot5.value = nhours+":"+nmins+" "+AorP;



setTimeout('startclock5()',1000);

} 

//----------------------------------------------------------------------------------


// Namibia
//----------------------------------------------------------------------------------
function startclock6(){


var thetime=new Date();

var nhours=thetime.getHours()+7;
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var AorP=" ";


if(nhours > 12)
    nhours = nhours - 12;




if (nhours<=12)
    AorP="pm";
else
    AorP="am";

if (nhours>=13)
    nhours-=12;

if (nhours==0)
   nhours=12;

if (nsecn<10)
 nsecn="0"+nsecn;

if (nmins<10)
 nmins="0"+nmins;

if(nhours<0)
 nhours=nhours*-1;


document.clockform.clockspot6.value = nhours+":"+nmins+" "+AorP;



setTimeout('startclock6()',1000);

} 

//----------------------------------------------------------------------------------


// Yellowknife
//----------------------------------------------------------------------------------
function startclock7(){


var thetime=new Date();

var nhours=thetime.getHours()-2;
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var AorP=" ";


if(nhours > 12)
    nhours = nhours - 12;



if (nhours>=12)
    AorP="pm";
else
    AorP="am";

if (nhours>=13)
    nhours-=12;

if (nhours==0)
   nhours=12;

if (nsecn<10)
 nsecn="0"+nsecn;

if (nmins<10)
 nmins="0"+nmins;

if(nhours<0)
 nhours=nhours*-1;


document.clockform.clockspot7.value = nhours+":"+nmins+" "+AorP;



setTimeout('startclock7()',1000);

} 

//----------------------------------------------------------------------------------




//------------------------------------------------------------------------------------------------------

// Validate Email Address


function validateEmail(formName,inputName) {
	
// Validate email address

	var inputObject = document.forms[formName].elements[inputName];
	var atSign = inputObject.value.indexOf('@');
	var dot = inputObject.value.lastIndexOf('.');
	var space = inputObject.value.indexOf(' ');
	var emailLength = inputObject.value.length - 1;

	if ((atSign < 1) || (space != -1) || (dot <= atSign + 1) || (dot == emailLength)) { 
 		alert('Please enter a valid email address');
		inputObject.focus();
		return false;
	}
	return true;
}


//------------------------------------------------------------------------------------------------------


// Validate Password to Submit


function validatepassword(formName,password,passwordconfirm) {

	var inputObject = document.forms[formName].elements[password];
	var first = document.forms[formName].elements[password].value;
	var second = document.forms[formName].elements[passwordconfirm].value;	

	if (first != second) { 
 		alert('Your password did not confirm, please try again');
		document.forms[formName].elements[password].value = "";
		document.forms[formName].elements[passwordconfirm].value = "";
		inputObject.focus();
		return false;
	}
	return true;
}


//------------------------------------------------------------------------------------------------------

// Swap Image



function swapimage(name,image){
		
	document[name].src = "images/" + image;
}


//------------------------------------------------------------------------------------------------------


// Open Window - No Self Close



function newWindow(file,width,height,window,toolbar,resize,scroll,status){

var wintopval = (height/2) + 50;
var winleftval = (width/2) + 10;
	
var winTop = (screen.height / 2) - wintopval;
var winLeft = (screen.width / 2) - winleftval;

windowFeatures = "width= " + width + ", height= " + height + ",";
windowFeatures = windowFeatures + "left=" + winLeft + ",";
windowFeatures = windowFeatures + "top=" + winTop + ",";

windowFeatures = windowFeatures + "toolbar= " + toolbar + ", location=no, resizable= " + resize + ", scrollbars= " + scroll + ", status= " + status;

	 msgWindow=open(file, window, windowFeatures);
    if (msgWindow.opener == null) msgWindow.opener = self;
	}


//---------------------------------------------------------------------------------------------------------


// Login - Forgot Password


function forgotpass() {
var winTop = (screen.height / 2) - 250;
var winLeft = (screen.width / 2) - 175;
windowFeatures = "width=350, height=180,";
windowFeatures = windowFeatures + "left=" + winLeft + ",";
windowFeatures = windowFeatures + "top=" + winTop + ",";
windowFeatures = windowFeatures + "toolbar=no, location=no, resizable=no, scrollbars=no, status=no";


     window.open('forgotpass.cfm', 'window3',windowFeatures);
}


//------------------------------------------------------------------------------------------------------


// Cert Window


function cert(number) {

var file = "cert_window.cfm?cert=" + number;

var winTop = (screen.height / 2) - 330;
var winLeft = (screen.width / 2) - 380;
windowFeatures = "width=765, height=550,";
windowFeatures = windowFeatures + "left=" + winLeft + ",";
windowFeatures = windowFeatures + "top=" + winTop + ",";
windowFeatures = windowFeatures + "toolbar=no, location=no, resizable=no, scrollbars=yes, status=yes";


     window.open(file,'cert',windowFeatures);
}


//------------------------------------------------------------------------------------------------------


