function closeOtherMenus(category){
	switch (category){
		case "travelpro":
			document.getElementById('atlanticcollections').style.display = 'none';
			document.getElementById('viewbystyle').style.display = 'none';
			document.getElementById('austinhouse').style.display = 'none';
			document.getElementById('customerService').style.display = 'none';
		break;
		case "atlanticcollections":
			document.getElementById('travelpro').style.display = 'none';
			document.getElementById('viewbystyle').style.display = 'none';
			document.getElementById('austinhouse').style.display = 'none';
			document.getElementById('customerService').style.display = 'none';
		break;
		case "viewbystyle":
			document.getElementById('travelpro').style.display = 'none';
			document.getElementById('atlanticcollections').style.display = 'none';
			document.getElementById('austinhouse').style.display = 'none';
			document.getElementById('customerService').style.display = 'none';
		break;
		case "austinhouse":
			document.getElementById('travelpro').style.display = 'none';
			document.getElementById('atlanticcollections').style.display = 'none';
			document.getElementById('viewbystyle').style.display = 'none';
			document.getElementById('customerService').style.display = 'none';
		break;
		case "customerService":
			document.getElementById('travelpro').style.display = 'none';
			document.getElementById('atlanticcollections').style.display = 'none';
			document.getElementById('viewbystyle').style.display = 'none';
			document.getElementById('austinhouse').style.display = 'none';
		break;
	}
}

function toggleView(category){
	//alert(document.getElementById("travelpro").style.display);
	//var currentSetting = "'" + document.getElementById("travelpro").style.display + "'";
	//alert(currentSetting);
	if(document.getElementById(category).style.display == 'none'){
		document.getElementById(category).style.display = 'block';
	}else{
		document.getElementById(category).style.display = 'none';
	}
	closeOtherMenus(category);
}

function openMenu(category){
	document.getElementById(category).style.display = 'block';
	closeOtherMenus(category);
}

function updateSearchForm() { 
	switch (document.getElementById('keywords').value){
		case "Product Search":
			document.getElementById('keywords').value = '';
		break;
		case "":
			document.getElementById('keywords').value = 'Product Search';
		break;
	}
}

// Rollover
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];}
}

function dwfaq_getCSSPropertyValue(obj,cP,jP){//v1.0 
//Copyright © 2004 Angela C. Buraglia & DWfaq.com
//All Rights Reserved. Not for distribution. support@dwfaq.com
//Support Newsgroup: news://support.dwfaq.com/support
	if(typeof(obj)!='object'){var obj=document.getElementById(obj);}
	if(typeof(obj.currentStyle)!='object'){
		return (typeof(document.defaultView)=='object')?
		document.defaultView.getComputedStyle(obj,'').getPropertyValue(cP):
		obj.style.getPropertyValue(cP);}
	else{
		return (navigator.appVersion.indexOf('Mac')!=-1)?
		obj.currentStyle.getPropertyValue(cP):
		obj.currentStyle.getAttribute((jP)?jP:cP);}
}

function dwfaq_ToggleOMaticDisplay(){//v1.0
//Copyright © 2004 Angela C. Buraglia & DWfaq.com
//All Rights Reserved. Not for distribution. support@dwfaq.com
//Support Newsgroup: news://support.dwfaq.com/support
	var obj,cS,args=dwfaq_ToggleOMaticDisplay.arguments;document.MM_returnValue=(typeof(args[0].href)!='string')?true:false;
	for(var i=1;i<args.length;i++){obj=document.getElementById(args[i]);
		if(obj){cS=dwfaq_getCSSPropertyValue(obj,'display');
			if(!obj.dwfaq_OD){obj.dwfaq_OD=(cS!='none'&&cS!='')?cS:(obj.tagName.toUpperCase()=='TR' && cS!=='none')?'':
			(obj.tagName.toUpperCase()=='TR' && typeof(obj.currentStyle)!='object')?'table-row':'block';}
			obj.style.display=(cS!='none')?'none':obj.dwfaq_OD}}
}

function clearForm(fieldName){
	currentField = document.getElementById(fieldName).value = '';
}

function restoreForm(fieldName){
	if(document.getElementById(fieldName).value == ''){
		switch (fieldName){
			case 'airlineCode':
				document.getElementById('airlineCode').value = 'Airline Code: ';
			break;
			case 'employeeID':
				document.getElementById('employeeID').value = 'Employee ID#: ';
			break;
		}
	}
}

function validateAirlineLogin( ){
    valid = true;
    if (document.airlineLogin.airlineCode.value == "" || document.airlineLogin.airlineCode.value == "Airline Code: " || document.airlineLogin.employeeID.value == "" || document.airlineLogin.employeeID.value == "Employee ID#: ")
    {
        alert ( "Please complete both fields prior to login" );
        valid = false;
    } else {
		if(document.airlineLogin.employeeID.value.length < 4 || document.airlineLogin.employeeID.value.length > 6){
			alert ( "Invalid login credentials" );
			valid = false;
		} else{
			var strAirlineCodes = "AM,AR,JR,AC,AF,JM,FL,ZW,AS,AZ,AG,AQ,HP,AA,5Y,UP,BA,BW,KX,CH,CO,CJ,DL,U2,XE,IH,FX,F9,HA,QX,B6,KL,LI,LH,MP,YV,XJ,MX,GL,YX,NW,OY,9E,FE,JS,QF,RW,RD,S3,S5,YT,SA,WN,NK,SY,XQ,SR,LX,TA,JJ,PM,UA,UP,US,U5,RG,VX,VS,WO,WS,V2,5Y,9N,1L,EN,5T,9S";
			var strString = document.airlineLogin.airlineCode.value.toUpperCase();
				//Alert(strString);
				//Alert(strAirlineCodes.indexOf(strString));
				if (strAirlineCodes.indexOf(strString) == -1){
					alert('Invalid login credentials');
					valid = false;
				}
		}
	  }
    return valid;
}

function findPOBox(){
	var valid = true;
	var shipAddress1 = document.PlaceOrder.cstShpAddress1.value.toUpperCase();
	var shipAddress2 = document.PlaceOrder.cstShpAddress2.value.toUpperCase();
				
	if (shipAddress1.indexOf("PO BOX") != -1){
		alert('Shipping to post office boxes is not available.');
		valid = false;
	}
	if (shipAddress1.indexOf("P.O. BOX") != -1){
		alert('Shipping to post office boxes is not available.');
		valid = false;
	}
	if (shipAddress1.indexOf("POST OFFICE BOX") != -1){
		alert('Shipping to post office boxes is not available.');
		valid = false;
	}
	if (shipAddress2.indexOf("PO BOX") != -1){
		alert('Shipping to post office boxes is not available.');
		valid = false;
	}
	if (shipAddress2.indexOf("P.O. BOX") != -1){
		alert('Shipping to post office boxes is not available.');
		valid = false;
	}
	if (shipAddress2.indexOf("POST OFFICE BOX") != -1){
		alert('Shipping to post office boxes is not available.');
		valid = false;
	}
	return valid;
}