/////////////////	onload	/////////////////
window.onload = function (){
var allA = document.getElementById('main').getElementsByTagName('a');
	for(var i=0;i<allA.length;i++){
		allA[i].onmouseover = function (){window.status = this.title;return true}
		allA[i].onmouseout = function (){window.status = '';return true}
	}


window.moveTo(0,0);
if(document.all){
	window.resizeTo(screen.availWidth, screen.availHeight);
}else if(document.layers || document.getElementById){
	if(window.outerHeight < screen.availHeight || window.outerWidth < screen.availWidth){
		window.outerHeight = screen.availHeight;
		window.outerWidth = screen.availWidth;
	}
}

};

/////////////////	end onload	/////////////////

var win=null;
function popWindow(mypage,myname,w,h,scroll){

LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;

settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);

}

//***************

function select_country(x){
	
	var select_box = document.getElementById('strCountry');

	for(i = 0 ; i < select_box.length ; i++){
		if(select_box.options[i].text == x){
		select_box.options[i].selected="selected";
		}
	}
}

function login(){
	var email = document.getElementById("strUsernameLog").value;
	var pw = document.getElementById("strPasswordLog").value;

	isEmail(email);

	if(email == ""){
	alert("Please enter your email address.");
	document.getElementById("strUsernameLog").focus();
	return false;
	}else 	if(isEmail(email) == false){
	alert("The email address you entered is invalid.");
	document.getElementById("strUsernameLog").focus();
	return false;
	}else if(pw ==""){
	alert("Please enter password.");
	document.getElementById("strPasswordLog").focus();
	return false;
	}
}

function isEmail(string){
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1){
		return true;
	}else{
		return false;
	}
}

//***************

function changeBanner(foto){
	document.getElementById("bigPic").innerHTML = document.getElementById(foto).innerHTML;
}

//***************

function submitNotifiedA(){

var notifiedFname = new Array();
var notifiedLname = new Array();
var notifiedEmail = new Array();
var theresult = "";

for(i=1; i<=5; i++){

	notifiedFname[i] = document.getElementById("frmFirstname"+i).value;
	notifiedLname[i] = document.getElementById("frmLastname"+i).value;
	notifiedEmail[i] = document.getElementById("frmEmail"+i).value;

	if(notifiedFname[i].length <= 0 && notifiedLname[i].length <= 0 && notifiedEmail[i].length <= 0){
		document.getElementById("error"+i).style.display = "none";
	}else{
		if(notifiedFname[i].length <= 0 || notifiedLname[i].length <= 0 || notifiedEmail[i].length <= 0){
			document.getElementById("error"+i).style.display = "block";
			document.getElementById("error"+i).innerHTML = "<img src='images/_error.gif' alt='!' /> Please enter all information for this person.";
			theresult = "not pass";
		}else{
			if(isEmail(notifiedEmail[i]) == false){
				document.getElementById("error"+i).style.display = "block";
				document.getElementById("error"+i).innerHTML = "<img src='images/_error.gif' alt='!' /> The email address you entered is invalid.";
			}else{
				document.getElementById("error"+i).style.display = "none";
				theresult = "pass";
			}
		}
	}

}	//for

if(theresult == "not pass" || theresult == ""){
	return false;
}else{
	return true;
}

};

function submitNotifiedB(){

var notifiedFname2 = new Array();
var notifiedLname2 = new Array();
var theresult2 = "";

for(i=1; i<=5; i++){

	notifiedFname2[i] = document.getElementById("frmFirstname2"+i).value;
	notifiedLname2[i] = document.getElementById("frmLastname2"+i).value;

	if(notifiedFname2[i].length <= 0 && notifiedLname2[i].length <= 0){
		document.getElementById("error2"+i).style.display = "none";
	}else{
		if(notifiedFname2[i].length <= 0 || notifiedLname2[i].length <= 0){
			document.getElementById("error2"+i).style.display = "block";
			document.getElementById("error2"+i).innerHTML = "<img src='images/_error.gif' alt='!' /> Please enter all information for this person.";
			theresult2 = "not pass";
		}else{
			document.getElementById("error2"+i).style.display = "none";
			theresult2 = "pass";
		}
	}

}	//for

if(theresult2 == "not pass" || theresult2 == ""){
	return false;
}else{
	return true;
}

};
