//var schemaName="rezbase_v1";
//var subURL="http://localhost:8088/"+schemaName+"";
var schemaName="aceactivity";
var subURL="http://activity.funatlanticcity.com/"+schemaName+"";
var airTxtArr = new Array();
var _month = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
// hotel


//activity
function loadDataNew_A(){
	
	setFields("A");
	document.forms["ResPkgSearchForm"].action=subURL+"/packaging/reservation/ResPkgSearchCriteria.do?ActionType=ResSearchActivities";
	if (chkDates()){showError();return;}
	
	var searchStr = document.forms["form1"].hid_A_Loc.value.split("|");
	document.forms["ResPkgSearchForm"].searchCityId.value	= searchStr[0];
	document.forms["ResPkgSearchForm"].searchCityName.value	= searchStr[1];
	document.forms["ResPkgSearchForm"].searchStateId.value	= searchStr[2];
	document.forms["ResPkgSearchForm"].searchCountryId.value	= searchStr[3];
	document.forms["ResPkgSearchForm"].cmbCty_Activities.value	= document.forms["ResPkgSearchForm"].searchCityId.value;
	document.forms["ResPkgSearchForm"].cityLookup_Activities.value	= document.forms["ResPkgSearchForm"].searchCityName.value;
	document.forms["ResPkgSearchForm"].cmbCtry_Activities.value	= document.forms["ResPkgSearchForm"].searchCountryId.value;
	
	document.forms["ResPkgSearchForm"].cmbInYr_Activities.value	= Number(document.forms["form1"].elements["activity_InYear"].options[document.forms["form1"].elements["activity_InYear"].selectedIndex].value);
	document.forms["ResPkgSearchForm"].cmbInMn_Activities.value	= Number(document.forms["form1"].elements["activity_InMonth"].options[document.forms["form1"].elements["activity_InMonth"].selectedIndex].value)+1;
	document.forms["ResPkgSearchForm"].cmbInDt_Activities.value	= document.forms["form1"].elements["activity_InDate"].options[document.forms["form1"].elements["activity_InDate"].selectedIndex].value;
	
	document.forms["ResPkgSearchForm"].cmbOutYr_Activities.value	= Number(document.forms["form1"].elements["activity_OutYear"].options[document.forms["form1"].elements["activity_OutYear"].selectedIndex].value);
	document.forms["ResPkgSearchForm"].cmbOutMn_Activities.value	= Number(document.forms["form1"].elements["activity_OutMonth"].options[document.forms["form1"].elements["activity_OutMonth"].selectedIndex].value)+1;
	document.forms["ResPkgSearchForm"].cmbOutDt_Activities.value	= document.forms["form1"].elements["activity_OutDate"].options[document.forms["form1"].elements["activity_OutDate"].selectedIndex].value;
	
	document.forms["ResPkgSearchForm"].cmbInMn.value=Number(document.forms["form1"].elements["activity_InMonth"].options[document.forms["form1"].elements["activity_InMonth"].selectedIndex].value)+1;
	document.forms["ResPkgSearchForm"].cmbInYr.value=document.forms["form1"].elements["activity_InYear"].options[document.forms["form1"].elements["activity_InYear"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].cmbOutMn.value=Number(document.forms["form1"].elements["activity_OutMonth"].options[document.forms["form1"].elements["activity_OutMonth"].selectedIndex].value)+1;
	document.forms["ResPkgSearchForm"].cmbOutYr.value=document.forms["form1"].elements["activity_OutYear"].options[document.forms["form1"].elements["activity_OutYear"].selectedIndex].value;
	
	document.forms["ResPkgSearchForm"].cmbInDt.value=document.forms["form1"].elements["activity_InDate"].options[document.forms["form1"].elements["activity_InDate"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].cmbOutDt.value=document.forms["form1"].elements["activity_OutDate"].options[document.forms["form1"].elements["activity_OutDate"].selectedIndex].value;
	
	document.forms["ResPkgSearchForm"].cmbNgt_Activities.value	= Number(document.forms["form1"].elements["activity_nights"].options[document.forms["form1"].elements["activity_nights"].selectedIndex].value);
	document.forms["ResPkgSearchForm"].actType_Activities.value	= document.forms["form1"].elements["Act_type"].options[document.forms["form1"].elements["Act_type"].selectedIndex].value;
	document.forms["ResPkgSearchForm"].pkgType.value	= "A";
	befSubmit('A');
	document.forms["ResPkgSearchForm"].submit();
	
}


var checkMore_new=0;
function setCharSecond(ch,img){
var tmpArr = new Array();
	for (var j=0; j<airTxtArr.length; j++){
		if (airTxtArr[j][0].toUpperCase().indexOf(ch.value.toUpperCase())==0){
			if (!showAllLoc){checkMore_new++;if (checkMore_new>10){break;}}
			tmpArr[tmpArr.length]="<tr><td class=\"stripe"+((j%2)+3)+"\" style=\"padding-left:5px;cursor:pointer;\" onMouseOver=\"altcell('ov',this)\" onMouseOut=\"altcell('ou',this,'stripe"+((j%2)+3)+"')\" onClick=\"setValSecond("+j+",'"+ch.name+"')\">"+airTxtArr[j][0]+" - "+airTxtArr[j][1]+"</td></tr>";
		}
	}
	if (!showAllLoc){
		if (checkMore_new>10){tmpArr[tmpArr.length]="<tr><td class=\"morebg\" style=\"padding-left:5px;cursor:pointer;\" onClick=\"showAllLoc=true;setCharSecond(document.forms['form1'].elements['"+ch.name+"'],'"+img+"')\" title=\"Show All\" align=\"center\"><img src=\"images/more_arrow.gif\" width=\"9\" height=\"6\" border=\"0\" hspace=\"3\" alt=\"Show All\" align=\"absmiddle\">Show All</td></tr>";}
	}
	checkMore_new=0;
	
	var outSt="";
if (tmpArr.length==0){
	outSt="<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"3\" class=\"databorder\"><tr><td class=\"stripe4\" onClick=\"setObjPos('ixpDataFrame',0,0,180,0,'none');setObjPos('maskFrame',0,0,180,0,'none');\" align=\"center\">... No Results Available ...</td></tr></table>";
	showRes(img,outSt,1);
}else{
	outSt="<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"4\" class=\"databorder\">"+tmpArr.join("")+"</table>";
	showRes(img,outSt,tmpArr.length);
}
tmpArr.length=0;
}

function setValSecond(index,obj){
	document.forms["form1"].elements["hid_car_Loc1"].value=airTxtArr[index].join("|");
	document.forms["form1"].elements["hid_air_Loc1"].value=airTxtArr[index].join("|");
	document.forms["form1"].elements[obj].value=airTxtArr[index][0];
			
	setObjPos('ixpDataFrame',0,0,180,0,'none');
	setObjPos('maskFrame',0,0,180,0,'none');
	showAllLoc=false;
}

function altcell(st,obj,cls){
	if (st=="ov"){
	obj.className="overclass";
	}else{
	obj.className=cls;
	}
}

