function loginpopup(category){
	if(category == "moviecatalogue"){
		/*document.loginform.username.disabled = false;
		document.loginform.password.disabled = false;*/
		document.getElementById("username").style.visibility = "visible";
		document.getElementById("password").style.visibility = "visible";
		document.getElementById("loginsubmit").style.visibility = "visible";
		document.getElementById("forgottenpwd").style.visibility = "visible";
	} else {
		/*document.loginform.username.value = "";
		document.loginform.password.value = "";
		document.loginform.username.disabled = true;
		document.loginform.password.disabled = true;*/
		document.getElementById("username").style.visibility = "hidden";
		document.getElementById("password").style.visibility = "hidden";
		document.getElementById("loginsubmit").style.visibility = "hidden";
		document.getElementById("forgottenpwd").style.visibility = "hidden";
		
		var strURL = "http://svc076.wic005sp.server-sharepoint.com/";
		var objPhotoWindow = window.open(strURL,'sharepoint','height=600,width=800,directories=0,location=0,menubar=0,scrollbars=1,resizable=1,status=0,toolbar=0');
	}
}

function PopUp(id){
	if(id!=""){
		var strURL = "/inflight/movie.asp?id=" + id
		var objPhotoWindow = window.open(strURL,'photo','height=500,width=600,left=10,top=10,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=1,resizable=0,status=0,toolbar=0');
	}

}

function printpg(id) {
	var strURL = "/inflight/default.asp?m=print&id="+id;
	
	var objPhotoWindow = window.open(strURL,'photo','height=500,width=610,left=10,top=10,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=1,resizable=0,status=0,toolbar=0');
}

function DisplayPassword(){
	var obj = xDOM("forgotPassword",0);
	if(obj.style.height == "0px"){
		obj.style.height = "190px";
		setTimeout("setPassFocus()",10);
	}else{
		obj.style.height = "0px";
	}	
}



function setPassFocus(){
	var objInput = xDOM("forgotForm",0);
	objInput.username.focus();	
}

function ChangeLogin(strVal){
		if(strVal=='movie'){
			xDOM("username",1).display="block";
			xDOM("password",1).display="block";
			xDOM("loginsubmit",1).display="block";		
			xDOM("forgottenpwd",1).display="block";						
		}else{
			xDOM("username",1).display="none";
			xDOM("password",1).display="none";
			xDOM("loginsubmit",1).display="none";		
			xDOM("forgottenpwd",1).display="none";						
			if(strVal=='eStar'){
				document.location.href="http://www.stellarinflight.com";	
			}
		}
}

function ToggleStaff(strDivID){
	var obj = xDOM(strDivID,1)
	//firstly hide all the items
	xDOM("syd",1).display="none"
	xDOM("losa",1).display="none"
	xDOM("kl",1).display="none"

	//now disply the one we want
	obj.display="block";
}



function ShowStaff(intStaffID){
	var isFinished = true
	xmlhttp.open("GET", "/remote/getStaffDetails.asp?id=" + intStaffID,true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			var arrItems = xmlhttp.responseText.split('{|}')
			xDOM("StaffTitle").innerHTML = arrItems[0];
			xDOM("StaffDetail").innerHTML = arrItems[1];
			isFinished = true
		}else if (xmlhttp.readyState==1) {
			isFinished = false
		}
	}
	xmlhttp.send(null)	
	
}











function ValidateForgottenForm(obj){
	var strAlert = "";
	strAlert = "______________________________________\n\nPlease\n\n";
	var isAlert = false;

		var strEmail = strTrim(obj.username.value);
		if(strEmail == "") {
			strAlert += "- Enter your username\n";
			isAlert = true;
		}
	if (isAlert == true){
		strAlert += "\n\n______________________________________";
		alert (strAlert);
		return false;
	}else{
		return true;
	}	
	
	
}




// Cross Browser DOM Functions used to create objects and get top / left coords
// copyright Stephen Chapman, 4th Jan 2005
// you may copy this code but please keep the copyright notice as well
var aDOM = 0, ieDOM = 0, nsDOM = 0
var stdDOM = document.getElementById;
if (stdDOM) aDOM = 1; else {
  ieDOM = document.all;
  if (ieDOM) aDOM = 1; else {
    nsDOM = (
      (navigator.appName.indexOf('Netscape') != -1)
      && (parseInt(navigator.appVersion) ==4));
    if (nsDOM) aDOM = 1;
  }
}
function xDOM(objectId, withStyle) {
var st = ''; if (withStyle) st = '.style';
if (stdDOM) return (eval('document.getElementById(objectId)'+st));
if (ieDOM) return (eval('document.all[objectId]'+st));
if (nsDOM) return (document.layers[objectId]);
}


function strTrim(strText) {
	for (i=0; i<strText.length; ++i) {
		if (strText.charAt(i) != ' ') break;
	}
	if (i >= strText.length) return ('');
	if (i > 0) strText = strText.substring(i, strText.length);
	for (j=strText.length-1; j > i; --j) {
		if (strText.charAt(j) != ' ') break;
	}
	if (j < strText.length -1)
		strText = strText.substring(0, j+1);
	return strText;
}
function ValidEmail(s){
    var i = 1;
    var sLength = s.length;
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }
    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
} 


// Load XMLHttpRequest Object for User detail lookups
// DO NOT DELETE ANY OF THE CODE BELOW. What appaers to be comments is IE conditional code
var xmlhttp=false;
function CreateXMLHttpRequestObject(){
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	 try {
	  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	  try {
	   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
	   xmlhttp = false;
	  }
	 }
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	  xmlhttp = new XMLHttpRequest();
	}	
}
CreateXMLHttpRequestObject();



