var strDQ =  String.fromCharCode(34);
var strSQ =  String.fromCharCode(39);
var strBestBuyImage = "img/gifts/packages/onebit_43.png";
var strBestBuyImageIn = "img/gifts/packages/blank_48.png";
var strSeasonIn = "img/gifts/packages/blank_32.png";
var strRibbonPath = "img/gifts/packages/";
var strSeasonPath = "img/gifts/packages/";
var houseTypeAmt = "0";
var selectedID = "0";
var totFlowersAmt = "0";
var isLoaded = "0";
var arrCommunities = new Array();

var arrGiftTitles = new Array();
var arrTitleImages = new Array();
var arrGiftPackages = new Array();
var arrGiftHouseType = new Array();
var arrSched = new Array();
var currSchedDate = new Date();
var strAddnl = "1";
var strInterval = "d";
var msgReturn = "";
var arrBath = new Array();
var arrPets = new Array();
var arrOth = new Array();
var arrBed = new Array();
var arrPersonal = new Array();
var arrFamily = new Array();
var arrSecurity = new Array();
var arrHouseList = new Array();
var arrCoupon = new Array();
var arrFloors = new Array();
var arrCeiling = new Array();
var arrGlassDoor = new Array();
var arrFire = new Array();
var arrWindows = new Array();
var arrFlowers = new Array();
var arrFlowersDict = new Array();
var arrErrors = new Array();
var arrCartItems = new Array();

var strCoupons = "";
var arrCouponTypes = new Array();
var arrHalfBath = new Array();
var arrKitchen = new Array();
var arrDen = new Array();
var arrDeck = new Array();
var arrSunroom = new Array();
var arrBasement = new Array();
var arrHouseCond = new Array();
var arrHouseAge = new Array();
var strGreenCleanID ="";
var errZip2 = "";
var basicRate = '50.00';
var hourlyRate = '50.00';
var houseIDX=0;
var pkgIndex=0;
var itemID = '';
var ezPayCharge=0;

var pubItemDetails = '';

var arrDropContent = new Array();
var arrDropPrice = new Array();
var arrDropStatus = new Array();
var arrDropFlowers = new Array();
var arrAddDrop = new Array();
var arrFloDrop = new Array();
var arrSchedID = new Array();
var cartItemTyp = new Array();

var houseZip = '';
var houseDistance = '';
var houseDirection = '';


function getErrorInfo() {
	arrErrors['ok']= new Array(msg="Ok Message",btn="OK_Cance");
	
	//alertX(arrErrors['ok'][0]);
	
}
function getTableInfo() {
	getErrorInfo();
	getdata('Rates');
	getdata('br');
	getdata('bd');
	getdata('pets');
	getdata('floors');
	getdata('ceiling');
	getdata('fireplace');
	getdata('windows');
	getdata('scheduletype');
	getdata('others');
	getdata('flowers');
	getdata('personal');
	getdata('HALFBATH');
	getdata('KITCHEN');
	getdata('DEN');
	getdata('DECK');
	getdata('SUNROOM');
	getdata('BASEMENT');
	getdata('HOUSECOND');
	getdata('HOUSEAGE');
	getdata('GLASSDOOR');

	loadData('security');
	loadData('tab1_me');

}

function loadData(c) {
	var a = 0;
	
	if ( c == "tab1_me" ) {
		//if (isTab1_Me_Fetched == "no") {
			document.getElementById('fldRefID').value = arrPersonal[0];
			document.getElementById('fldFName').value = arrPersonal[1];
			document.getElementById('fldLName').value = arrPersonal[3];
			document.getElementById('fldEmail').value = arrPersonal[14];
			document.getElementById('fldWorkPhone').value = arrPersonal[26];
			document.getElementById('fldPhone').value = arrPersonal[12];
			document.getElementById('fldAddress').value = arrPersonal[5];
			document.getElementById('fldAddress2').value = arrPersonal[6];
			document.getElementById('fldCity').value = arrPersonal[7];
			document.getElementById('fldState').value = arrPersonal[8];
			document.getElementById('fldZip2').value = arrPersonal[9];
			document.getElementById('fldReferral').value = arrPersonal[19];
			
			document.getElementById('fldFavFlower').value = arrPersonal[21];
			document.getElementById('fldLeastFlower').value = arrPersonal[22];
			
			document.getElementById('fldGender').value = arrPersonal[10];
			document.getElementById('fldMobile').value = arrPersonal[13];
			document.getElementById('fldCompany').value = arrPersonal[4];
			document.getElementById('fldPriority').value = arrPersonal[17];
			
			if (arrPersonal[23] == "true") {
			    document.getElementById('fldChoco').checked = true;
			 } 
			 else {
			    document.getElementById('fldChoco').checked = false;
			 } 

			if (arrPersonal[24] == "true") {
			    document.getElementById('fldNuts').checked = true;
			 } 
			 else {
			    document.getElementById('fldNuts').checked = false;
			 } 
			 	
			document.getElementById('fldResto').value = arrPersonal[25];

			document.getElementById('fldSecQ').value = arrPersonal[15];
			document.getElementById('fldSecA').value = arrPersonal[16];

			document.getElementById('fldPrefCall').value = arrPersonal[27];
			document.getElementById('fldBestCall').value = arrPersonal[28];
			document.getElementById('fldAnniv').value = arrPersonal[29];
			document.getElementById('fldHoliday').value = arrPersonal[30];
			document.getElementById('fldLanguage').value = arrPersonal[31];
			

		//	isTab1_Me_Fetched = "yes";
		//	isTab1_Favorites_Fetched = "yes";
		//	isTab1_Security_Fetched = "yes";
		//}
	}
	else if ( c == "tab1_family") {
			getdata('family');
			
			document.getElementById('fldSpouseName').value = arrFamily[1];
			document.getElementById('fldSpouseNo').value = arrFamily[2];
			document.getElementById('fldSpouseBDay').value = arrFamily[3];
			document.getElementById('fldChild1_Name').value = arrFamily[6];
			document.getElementById('fldChild2_Name').value = arrFamily[9];
			document.getElementById('fldChild3_Name').value = arrFamily[12];
			document.getElementById('fldChild4_Name').value = arrFamily[15];
			document.getElementById('fldChild5_Name').value = arrFamily[18];

			document.getElementById('fldChild1_Sex').value = arrFamily[7];
			document.getElementById('fldChild2_Sex').value = arrFamily[10];
			document.getElementById('fldChild3_Sex').value = arrFamily[13];
			document.getElementById('fldChild4_Sex').value = arrFamily[16];
			document.getElementById('fldChild5_Sex').value = arrFamily[19];

			document.getElementById('fldChild1_BDay').value = arrFamily[8];
			document.getElementById('fldChild2_BDay').value = arrFamily[11];
			document.getElementById('fldChild3_BDay').value = arrFamily[14];
			document.getElementById('fldChild4_BDay').value = arrFamily[17];
			document.getElementById('fldChild5_BDay').value = arrFamily[20];
			
			document.getElementById('fldPets').value = arrFamily[4];
			document.getElementById('fldAllergy').value = arrFamily[5];

			isTab1_Family_Fetched = "yes";

	}
	else if ( c == 'security' ) {
			getdata('security');
	}
	else if ( c == "houselist") {
		//if (isTab2_Houses_Fetched == "no" ) {
			getdata(c);
			isTab2_Houses_Fetched = "yes"
		//}	
	}
	else if ( c == "tab_coupon") {
		getdata(c);
	}
}

function loadInfo() {

	// personal info
	document.getElementById('fldFName').value = arrPersonal[1];
	document.getElementById('fldLName').value = arrPersonal[3];
	document.getElementById('fldEmail').value = arrPersonal[14];
	document.getElementById('fldPhone').value = arrPersonal[12];
	document.getElementById('fldAddress').value = arrPersonal[5];
	document.getElementById('fldAddress2').value = arrPersonal[6];
	document.getElementById('fldCity').value = arrPersonal[7];
	document.getElementById('fldState').value = arrPersonal[8];
	document.getElementById('fldZip2').value = arrPersonal[9];
	document.getElementById('fldReferral').value = arrPersonal[19];

}





function getdata(id,zip) {
	var xmlhttp;
	var JSONstring = new Object;
	var tmpOut = "";
	var tmpOut2 = "";
	if (window.XMLHttpRequest){
          // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			var response =  xmlhttp.responseText;
			var tempRecs = new Array();
			var tempRec = new Array();
			var a=0;
			
			//alert(response);

			if (id == "scheduletype") {
				tempRecs = response.split("|");
				arrSched.length = tempRecs.length;
				tmpOut ="";
				tmpOut1 ="";
				for (a=1;a<tempRecs.length;a++) {
					arrSched[a] = new Array(2);
					tempRec = tempRecs[a].split("^");
					arrSched[a][0] = tempRec[0];
					arrSched[a][1] = tempRec[1];	
					arrSched[a][2] = tempRec[2];
					
					tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					tmpOut1 = tmpOut1 +  "<option value='" + tempRec[0] + "'>" + tempRec[0] + "</option>";
					
				}
				document.getElementById("fldSchedType").innerHTML = tmpOut;
				document.getElementById("fldModSchedType").innerHTML = tmpOut;
			}
			else if (id == 'COUPONTYPES') {
				tempRecs = response.split('|');
				arrCouponTypes.length = tempRecs.length;
				tmpOut='';
					for (a=1;a<tempRecs.length;a++) {
						arrCouponTypes[a] = new Array(2);
						tempRec = tempRecs[a].split('^');
						arrCouponTypes[a][0] = tempRec[0];
						arrCouponTypes[a][1] = tempRec[1];
						arrCouponTypes[a][2] = tempRec[2];
						tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					}
					
					strCoupons = tmpOut;
			}
			else if (id == 'FALSEPRICE') {
				falsePrice = response;
			}
			else if (id == 'COMMUNITY') {
				tempRecs = response.split('|');
				arrCommunities.length = tempRecs.length;
				tmpOut='';
					tmpOut = tmpOut +  "<option value=''></option>";
					for (a=1;a<tempRecs.length;a++) {
						arrCommunities[a] = new Array(3);
						tempRec = tempRecs[a].split('^');
						arrCommunities[a][0] = tempRec[0];
						arrCommunities[a][1] = tempRec[1];
						arrCommunities[a][2] = tempRec[2];
						arrCommunities[a][3] = tempRec[3];
						tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					}
					document.getElementById('fldCommunity').innerHTML = tmpOut;
				}
			else if (id == 'HALFBATH') {
				tempRecs = response.split('|');
				arrHalfBath.length = tempRecs.length;
				tmpOut='';
					for (a=1;a<tempRecs.length;a++) {
						arrHalfBath[a] = new Array(4);
						tempRec = tempRecs[a].split('^');
						arrHalfBath[a][0] = tempRec[0];
						arrHalfBath[a][1] = tempRec[1];
						arrHalfBath[a][2] = tempRec[2];
						arrHalfBath[a][3] = tempRec[3];
						arrHalfBath[a][4] = tempRec[4];
						tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					}
					document.getElementById('fldBA2').innerHTML = tmpOut;
				}
			else if (id == 'GLASSDOOR') {
				tempRecs = response.split('|');
				arrGlassDoor.length = tempRecs.length;
				tmpOut='';
					for (a=1;a<tempRecs.length;a++) {
						arrGlassDoor[a] = new Array(4);
						tempRec = tempRecs[a].split('^');
						arrGlassDoor[a][0] = tempRec[0];
						arrGlassDoor[a][1] = tempRec[1];
						arrGlassDoor[a][2] = tempRec[2];
						arrGlassDoor[a][3] = tempRec[3];
						arrGlassDoor[a][4] = tempRec[4];
						tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					}
					document.getElementById('fldGlassDoor').innerHTML = tmpOut;
				}
			else if (id == 'KITCHEN') {
				tempRecs = response.split('|');
				arrKitchen.length = tempRecs.length;
				tmpOut='';
					for (a=1;a<tempRecs.length;a++) {
						arrKitchen[a] = new Array(4);
						tempRec = tempRecs[a].split('^');
						arrKitchen[a][0] = tempRec[0];
						arrKitchen[a][1] = tempRec[1];
						arrKitchen[a][2] = tempRec[2];
						arrKitchen[a][3] = tempRec[3];
						arrKitchen[a][4] = tempRec[4];
						tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					}
					document.getElementById('fldKitchen').innerHTML = tmpOut;
				}
			else if (id == 'DEN') {
				tempRecs = response.split('|');
				arrDen.length = tempRecs.length;
				tmpOut='';
					for (a=1;a<tempRecs.length;a++) {
						arrDen[a] = new Array(4);
						tempRec = tempRecs[a].split('^');
						arrDen[a][0] = tempRec[0];
						arrDen[a][1] = tempRec[1];
						arrDen[a][2] = tempRec[2];
						arrDen[a][3] = tempRec[3];
						arrDen[a][4] = tempRec[4];
						tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					}
					document.getElementById('fldDen').innerHTML = tmpOut;
				}
			else if (id == 'DECK') {
				tempRecs = response.split('|');
				arrDeck.length = tempRecs.length;
				tmpOut='';
					for (a=1;a<tempRecs.length;a++) {
						arrDeck[a] = new Array(4);
						tempRec = tempRecs[a].split('^');
						arrDeck[a][0] = tempRec[0];
						arrDeck[a][1] = tempRec[1];
						arrDeck[a][2] = tempRec[2];
						arrDeck[a][3] = tempRec[3];
						arrDeck[a][4] = tempRec[4];
						tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					}
					document.getElementById('fldDeck').innerHTML = tmpOut;
				}
			else if (id == 'SUNROOM') {
				tempRecs = response.split('|');
				arrSunroom.length = tempRecs.length;
				tmpOut='';
					for (a=1;a<tempRecs.length;a++) {
						arrSunroom[a] = new Array(4);
						tempRec = tempRecs[a].split('^');
						arrSunroom[a][0] = tempRec[0];
						arrSunroom[a][1] = tempRec[1];
						arrSunroom[a][2] = tempRec[2];
						arrSunroom[a][3] = tempRec[3];
						arrSunroom[a][4] = tempRec[4];
						tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					}
					document.getElementById('fldSunroom').innerHTML = tmpOut;
				}
			else if (id == 'BASEMENT') {
				tempRecs = response.split('|');
				arrBasement.length = tempRecs.length;
				tmpOut='';
					for (a=1;a<tempRecs.length;a++) {
						arrBasement[a] = new Array(4);
						tempRec = tempRecs[a].split('^');
						arrBasement[a][0] = tempRec[0];
						arrBasement[a][1] = tempRec[1];
						arrBasement[a][2] = tempRec[2];
						arrBasement[a][3] = tempRec[3];
						arrBasement[a][4] = tempRec[4];
						tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					}
					document.getElementById('fldBsmt').innerHTML = tmpOut;
				}
			else if (id == 'HOUSECOND') {
				tempRecs = response.split('|');
				arrHouseCond.length = tempRecs.length;
				tmpOut='';
					for (a=1;a<tempRecs.length;a++) {
						arrHouseCond[a] = new Array(4);
						tempRec = tempRecs[a].split('^');
						arrHouseCond[a][0] = tempRec[0];
						arrHouseCond[a][1] = tempRec[1];
						arrHouseCond[a][2] = tempRec[2];
						arrHouseCond[a][3] = tempRec[3];
						arrHouseCond[a][4] = tempRec[4];
						tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					}
					document.getElementById('fldHouseCond').innerHTML = tmpOut;
				}
			else if (id == 'HOUSEAGE') {
				tempRecs = response.split('|');
				arrHouseAge.length = tempRecs.length;
				tmpOut='';
					for (a=1;a<tempRecs.length;a++) {
						arrHouseAge[a] = new Array(4);
						tempRec = tempRecs[a].split('^');
						arrHouseAge[a][0] = tempRec[0];
						arrHouseAge[a][1] = tempRec[1];
						arrHouseAge[a][2] = tempRec[2];
						arrHouseAge[a][3] = tempRec[3];
						arrHouseAge[a][4] = tempRec[4];
						tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
					}
					document.getElementById('fldHouseAge').innerHTML = tmpOut;
				}

			else if  (id == "flowers") {

																
				tempRecs = response.split("|");
				arrFlowers.length = tempRecs.length;
				
				tmpModOut = "";
				tmpModOut1 = "";
				
				
				tmpOut ="<img src='img/resources/flower popup.png' />";
				
				tmpOut +="<p>Choose premium flowers from the selection below</p>";
				tmpOut +='<div style="overflow:auto; height:300px; border:#CCCCCC 3px solid; border-radius: 5px;">';
				tmpOut +='<table cellpadding="0" cellspacing="0" border="0" width="570" >';

				tmpModOut ="<img src='img/resources/flower popup.png' />";
				tmpModOut +="<p>Choose premium flowers from the selection below</p>";
				tmpModOut +='<div style="overflow:auto; height:300px; border:#CCCCCC 3px solid; border-radius: 5px;">';
				tmpModOut +='<table cellpadding="0" cellspacing="0" border="0" width="470" >';
				
				
				var tmpOut1 ="";
				
				tmpOut1 +='<table cellpadding="0" cellspacing="0" border="0" width="500" >';
				tmpModOut1 +='<table cellpadding="0" cellspacing="0" border="0" width="500" >';

				//alert('a');
				for (a=1;a<tempRecs.length;a++) {
					arrFlowers[a] = new Array(4);;
					tempRec = tempRecs[a].split("^");
					arrFlowersDict[tempRec[0]] = a;
					arrFlowers[a][0] = tempRec[0];
					arrFlowers[a][1] = tempRec[1];
					arrFlowers[a][2] = tempRec[2];
					arrFlowers[a][3] = tempRec[3];
					arrFlowers[a][4] = tempRec[4];
					
					tmpOut +='<tr id="sel_flower_' + tempRec[0] + '">';
					tmpOut +='<td width="70"><img src="' + tempRec[4] + '" height="64" width="64" style="border:1px solid #000" /></td>';
					tmpOut +='<td width="240">' + tempRec[1] + '</td>';
					tmpOut +='<td width="70"><h2>$' + tempRec[3] + '</h2></td>';
					tmpOut +='<td width="120">';
					tmpOut +='<input type="checkbox" id="chk_sel_flower_' + tempRec[0] + '" onclick="checkFlowerItem(' + strSQ + tempRec[0] + strSQ + ')" /> &nbsp;&nbsp;';
					tmpOut +='<input type="text" class="shortfield" style="width:30px;" id="fld_sel_flower_' + tempRec[0] + '" disabled="disabled" onkeypress="getItemAmt(' + strSQ + a + strSQ + ')" onblur="getItemAmt(' + strSQ + a + strSQ + ')" /> &nbsp;&nbsp;'+ tempRec[2] +'</td>';
					tmpOut +='<td with="60"><h2 id="amt_sel_'+ tempRec[0] +'"></h2></td></tr>'


					tmpOut1 +='<tr id="sum_flower_' + tempRec[0] + '" style="display:none;">';
					tmpOut1 +='<td width="70"><img src="' + tempRec[4] + '" height="64" width="64" /></td>';
					tmpOut1 +='<td width="240"><span id="sum_flower_desc_'+ tempRec[0]+'">' + tempRec[1] + '</span></td>';
					tmpOut1 +='<td width="0"></td>';
					tmpOut1 +='<td width="0">';
					tmpOut1 +='<span id=sum_flower_tot_'+ tempRec[0] +'></span>';
					tmpOut1 +='<input type="checkbox" id="chk_sum_flower_' + tempRec[0] + '" style="display:none;" /> &nbsp;&nbsp;';
					tmpOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_flowerPRICE_' + tempRec[0] + '" value="' + tempRec[3] + '" disabled="disabled" style="display:none;"/>'
					tmpOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_flowerCTR_' + tempRec[0] + '" value="' + a + '" disabled="disabled" style="display:none;"/>'
					tmpOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_flowerID_' + tempRec[0] + '" value="' + tempRec[0] + '" disabled="disabled" style="display:none;"/>'
					tmpOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_flower_' + tempRec[0] + '" disabled="disabled" style="display:none;"/></td></tr>';

					//MODIFY SCHEDULE
					tmpModOut +='<tr id="sel_Modflower_' + tempRec[0] + '">';
					tmpModOut +='<td width="70"><img src="' + tempRec[4] + '" height="64" width="64" /></td>';
					tmpModOut +='<td width="240">' + tempRec[1] + '</td>';
					tmpModOut +='<td width="70"><h2>$' + tempRec[3] + '</h2></td>';
					tmpModOut +='<td width="120">';
					tmpModOut +='<input type="checkbox" id="chk_sel_Modflower_' + tempRec[0] + '" onclick="checkFlowerItemMod(' + strSQ + tempRec[0] + strSQ + ')" /> &nbsp;&nbsp;';
					tmpModOut +='<input type="text" class="shortfield" style="width:30px;" id="fld_sel_Modflower_' + tempRec[0] + '" disabled="disabled" onkeypress="getItemAmtMod(' + strSQ + a + strSQ + ')" onblur="getItemAmtMod(' + strSQ + a + strSQ + ')" /> &nbsp;&nbsp;'+ tempRec[2] +'</td>';
					tmpModOut +='<td with="60"><h2 id="amt_sel_Mod'+ tempRec[0] +'"></h2></td></tr>'


					tmpModOut1 +='<tr id="sum_Modflower_' + tempRec[0] + '" style="display:none;">';
					tmpModOut1 +='<td width="70"><img src="' + tempRec[4] + '" height="64" width="64" style="border:1px solid #000"/></td>';
					tmpModOut1 +='<td width="240"><span id="sum_Modflower_desc_'+ tempRec[0]+'">' + tempRec[1] + '</span></td>';
					tmpModOut1 +='<td width="0"></td>';
					tmpModOut1 +='<td width="0">';
					tmpModOut1 +='<span id=sum_Modflower_tot_'+ tempRec[0] +'></span>';
					tmpModOut1 +='<input type="checkbox" id="chk_sum_Modflower_' + tempRec[0] + '" style="display:none;" /> &nbsp;&nbsp;';
					tmpModOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_ModflowerPRICE_' + tempRec[0] + '" value="' + tempRec[3] + '" disabled="disabled" style="display:none;"/>'
					tmpModOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_ModflowerCTR_' + tempRec[0] + '" value="' + a + '" disabled="disabled" style="display:none;"/>'
					tmpModOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_ModflowerID_' + tempRec[0] + '" value="' + tempRec[0] + '" disabled="disabled" style="display:none;"/>'
					tmpModOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_Modflower_' + tempRec[0] + '" disabled="disabled" style="display:none;"/></td></tr>';
					
					
					
				}
				
				tmpOut +='</table></div>';
				tmpOut +='<a class="frmButtonBlue" onClick="displaySelectedFlowers('+ strSQ + 'HOUSE' + strSQ + '); document.getElementById(' + strSQ + 'divFlowerSelection' + strSQ + ').style.display=' + strSQ + 'none' + strSQ + '; document.getElementById(' + strSQ + 'mask_div' + strSQ + ').style.display = ' + strSQ + 'none' + strSQ + ';" title="Confirm Selection">Confirm</a>';
				tmpOut +='<a class="frmButtonBlue" onClick="document.getElementById(' + strSQ + 'divFlowerSelection' + strSQ + ').style.display=' + strSQ + 'none' + strSQ + '; document.getElementById(' + strSQ + 'mask_div' + strSQ + ').style.display = ' + strSQ + 'none' + strSQ + ';" title="Cancel Selection">Cancel</a>';
				
				tmpOut1 +='</table>';
				document.getElementById("divFlowerSelection").innerHTML = tmpOut;
				document.getElementById("divFlowerSummary").innerHTML = tmpOut1;
				
				//MODIFY SCHEDULE
				tmpModOut +='</table></div>';
				tmpModOut +='<a class="frmButtonBlue" onClick="displaySelectedFlowers('+ strSQ + 'MODIFY' + strSQ + '); document.getElementById(' + strSQ + 'divModFlowerSelection' + strSQ + ').style.display=' + strSQ + 'none' + strSQ + ';" title="Confirm Selection">Confirm</a>';
				tmpModOut +='<a class="frmButtonBlue" onClick="document.getElementById(' + strSQ + 'divModFlowerSelection' + strSQ + ').style.display=' + strSQ + 'none' + strSQ + ';" title="Cancel Selection">Cancel</a>';
				
				
				tmpModOut1 +='</table>';
				
				//alert(tmpModOut1);
				document.getElementById("divModFlowerSelection").innerHTML = tmpModOut;
				document.getElementById("divModFlowerSummary").innerHTML = tmpModOut1;
				//alert(document.getElementById("divModFlowerSummary").innerHTML);
			}
			
			else if  (id == "br") {
				tempRecs = response.split("|");
				arrBed.length = tempRecs.length;
				
				tmpOut ="";
				for (a=1;a<tempRecs.length;a++) {
					arrBed[a] = new Array(4);
					tempRec = tempRecs[a].split("^");
					arrBed[a][0] = tempRec[0];
					arrBed[a][1] = tempRec[1];
					arrBed[a][2] = tempRec[2];
					arrBed[a][3] = tempRec[3];
					arrBed[a][4] = tempRec[4];
					tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
				}
				
				document.getElementById("fldBR").innerHTML = tmpOut;
			}
			else if  (id == "bd") {
				tempRecs = response.split("|");
				arrBath.length = tempRecs.length;
				tmpOut="";
				for (a=1;a<tempRecs.length;a++) {
					arrBath[a] = new Array(4);
					tempRec = tempRecs[a].split("^");
					arrBath[a][0] = tempRec[0];
					arrBath[a][1] = tempRec[1];
					arrBath[a][2] = tempRec[2];
					arrBath[a][3] = tempRec[3];
					arrBath[a][4] = tempRec[4];
					tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
				}
				
				document.getElementById("fldBA").innerHTML = tmpOut;
			}

			else if  (id == "floors") {
				tempRecs = response.split("|");
				arrFloors.length = tempRecs.length;
				tmpOut="";
				for (a=1;a<tempRecs.length;a++) {
					arrFloors[a] = new Array(4);;
					tempRec = tempRecs[a].split("^");
					arrFloors[a][0] = tempRec[0];
					arrFloors[a][1] = tempRec[1];
					arrFloors[a][2] = tempRec[2];
					arrFloors[a][3] = tempRec[3];
					arrFloors[a][4] = tempRec[4];
					tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
				}
				document.getElementById("fldNoFloor").innerHTML = tmpOut;
			}

			else if  (id == "ceiling") {
				tempRecs = response.split("|");
				arrCeiling.length = tempRecs.length;
				tmpOut="";
				for (a=1;a<tempRecs.length;a++) {
					arrCeiling[a] = new Array(4);;
					tempRec = tempRecs[a].split("^");
					arrCeiling[a][0] = tempRec[0];
					arrCeiling[a][1] = tempRec[1];
					arrCeiling[a][2] = tempRec[2];
					arrCeiling[a][3] = tempRec[3];
					arrCeiling[a][4] = tempRec[4];
					tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
				}
				
				document.getElementById("fldClFans").innerHTML = tmpOut;
			}

			else if  (id == "fireplace") {
				tempRecs = response.split("|");
				arrFire.length = tempRecs.length;
				tmpOut="";
				for (a=1;a<tempRecs.length;a++) {
					arrFire[a] = new Array(4);
					tempRec = tempRecs[a].split("^");
					arrFire[a][0] = tempRec[0];
					arrFire[a][1] = tempRec[1];
					arrFire[a][2] = tempRec[2];
					arrFire[a][3] = tempRec[3];
					arrFire[a][4] = tempRec[4];
					tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
				}
				
				document.getElementById("fldFirePlace").innerHTML = tmpOut;
			}

			else if  (id == "windows") {
				tempRecs = response.split("|");
				arrWindows.length = tempRecs.length;
				tmpOut="";
				for (a=1;a<tempRecs.length;a++) {
					arrWindows[a] = new Array(4);;
					tempRec = tempRecs[a].split("^");
					arrWindows[a][0] = tempRec[0];
					arrWindows[a][1] = tempRec[1];
					arrWindows[a][2] = tempRec[2];
					arrWindows[a][3] = tempRec[3];
					arrWindows[a][4] = tempRec[4];
					tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
				}
				
				document.getElementById("fldWindows").innerHTML = tmpOut;
			}

			else if  (id == "pets") {
				tempRecs = response.split("|");
				arrPets.length = tempRecs.length;
				tmpOut = "";
				for (a=1;a<tempRecs.length;a++) {
					arrPets[a] = new Array(4);;
					tempRec = tempRecs[a].split("^");
					arrPets[a][0] = tempRec[0];
					arrPets[a][1] = tempRec[1];
					arrPets[a][2] = tempRec[2];
					arrPets[a][3] = tempRec[3];
					arrPets[a][4] = tempRec[4];

					tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
				}
				
				document.getElementById("fldNoPets").innerHTML = tmpOut;
			}
			else if  (id == "Rates") {
				tempRecs = response.split("^");
				basicRate = tempRecs[0];
				hourlyRate = tempRecs[1];
			}
			else if  (id == "others") {
				tempRecs = response.split("|");
				arrOth.length = tempRecs.length;
				tmpOut = "";
				tmpModOut = "";
				for (a=1;a<tempRecs.length;a++) {
					arrOth[a] = new Array(5);;
					tempRec = tempRecs[a].split("^");
					arrOth[a][0] = tempRec[0]; //name
					arrOth[a][1] = tempRec[1]; //Amount
					arrOth[a][2] = tempRec[2]; //Cleaning time
					arrOth[a][3] = tempRec[3]; //Amt Init Clean
					arrOth[a][4] = tempRec[4]; // wala lang
					arrOth[a][5] = tempRec[5]; //image Path
					
					if (zip == undefined || zip == '') {
						if(tempRec[0].toUpperCase().indexOf('GREEN CLEAN') >=0) {
							document.getElementById('lblGreenClean').style.display = 'block';
							strGreenCleanID = 'opt' + a;
						} else {
							document.getElementById('lblGreenClean').style.display = 'none';
						}
					}
					//alert('getdata Oth=' + a);
					tmpOut = tmpOut +  "<p style='margin:2px 5px'><input  type='checkbox' id='opt" + a + "' value='" + tempRec[0] + "' onclick='computeEstimate(" + strDQ + "opt" + a + strDQ + ");' disabled='disabled'/>&nbsp;&nbsp;" + tempRec[0] + "</p>";
					tmpModOut = tmpModOut + "<p style='margin:2px 5px'><input  type='checkbox' id='optMod" + a + "' value='" + tempRec[0] + "' onclick='computeEstimate(" + strDQ + "mod" + strDQ + ");reflectEstimates()' />&nbsp;&nbsp;" + tempRec[0] + "</p>";
					//alert(tmpOut);
				}
				
				tmpOut = tmpOut + "<br /><p style='margin:2px 5px'><input  type='checkbox' id='optX' value='Complimentary flowers and chocolates (subject to availability and seasonal restrictions apply)' onclick='computeEstimate();' disabled='disabled'/>&nbsp;&nbsp;Avail of FREE flowers (subject for availability)</p>";
				if (zip == undefined || zip == '') {
					document.getElementById("frm_hsprofile_addnl").innerHTML = tmpOut;
					document.getElementById("frm_mod_addnl").innerHTML = tmpModOut;
				}
			}
			else if  (id == "houselist") {
				//alert(response);
				//.replace(/\\n/g, "")
				//alert(response.replace(/\n/g,"<br />"));
				tempRecs = response.split("|");
				arrHouseList.length = tempRecs.length;
				tmpOut = "";
				tmpOut2 = "";
				for (a=1;a<tempRecs.length;a++) {
					arrHouseList[a] = new Array(104);;
					tempRec = tempRecs[a].split("^");
					arrHouseList[a][0] = tempRec[0];  // 0 = $row['userID'] . "^" .
					arrHouseList[a][1] = tempRec[1];  // 1 = $row['regionID'] . "^" .
					arrHouseList[a][2] = tempRec[2];  // 2 = $row['id'] . "^" .
					arrHouseList[a][3] = tempRec[3];  // 3 = $row['distanceMI'] . "^" .
					arrHouseList[a][4] = tempRec[4];  // 4 = $row['duration'] . "^" .
					arrHouseList[a][5] = tempRec[5];  // 5 = $row['direction'] . "^" .
					arrHouseList[a][6] = tempRec[6];  // 6 = $row['status'] . "^" .
					arrHouseList[a][7] = tempRec[7];  // 7 = $row['houseName'] . "^" .
					arrHouseList[a][8] = tempRec[8];  // 8 = $row['houseType'] . "^" .
					arrHouseList[a][9] = tempRec[9];  // 9 = $row['Address'] . "^" .
					arrHouseList[a][10] = tempRec[10];  // 10 = $row['Address2'] . "^" .
					arrHouseList[a][11] = tempRec[11];  // 11 = $row['City'] . "^" .
					arrHouseList[a][12] = tempRec[12];  // 12 = $row['State'] . "^" .
					arrHouseList[a][13] = tempRec[13];  // 13 = $row['Zip'] . "^" .
					arrHouseList[a][14] = tempRec[14];  // 14 = $row['pets'] . "^" .
					arrHouseList[a][15] = tempRec[15];  // 15 = $row['levels'] . "^" .
					arrHouseList[a][16] = tempRec[16];  // 16 = $row['br'] . "^" .
					arrHouseList[a][17] = tempRec[17];  // 17 = $row['bd'] . "^" .
					arrHouseList[a][18] = tempRec[18];  // 18 = $row['den'] . "^" .
					arrHouseList[a][19] = tempRec[19];  // 19 = $row['basement'] . "^" .
					arrHouseList[a][20] = tempRec[20];  // 20 = $row['ceilingfan'] . "^" .
					arrHouseList[a][21] = tempRec[21];  // 21 = $row['fireplace'] . "^" .
					arrHouseList[a][22] = tempRec[22];  // 22 = $row['win_ext'] . "^" .
					arrHouseList[a][23] = tempRec[23];  // 23 = $row['housecond'] . "^" .
					arrHouseList[a][24] = tempRec[24];  // 24 = $row['initClean'] . "^" .
					arrHouseList[a][25] = tempRec[25];  // 25 = $row['schedType'] . "^" .
					arrHouseList[a][26] = tempRec[26];  // 26 = $row['schedException'] . "^" .
					arrHouseList[a][27] = tempRec[27];  // 27 = $row['schedPref'] . "^" .
					arrHouseList[a][28] = tempRec[28];  // 28 = $row['schedPrefTime'] . "^" .
					arrHouseList[a][29] = tempRec[29];  // 29 = $row['schedPrefTimeOth'] . "^" .
					arrHouseList[a][30] = tempRec[30];  // 30 = $row['startDate'] . "^" .
					arrHouseList[a][31] = tempRec[31];  // 31 = $row['additionals'] . "^" .
					arrHouseList[a][32] = tempRec[32];  // 32 = $roomExclude . "^" .
					arrHouseList[a][33] = tempRec[33];  // 33 = $overlooked . "^" .
					arrHouseList[a][34] = tempRec[34];  // 34 = $row['cleanBasement'] . "^" .
					arrHouseList[a][35] = tempRec[35];  // 35 = $cleanBasementText . "^" .
					arrHouseList[a][36] = tempRec[36];  // 36 = $petPeeves . "^" .
					arrHouseList[a][37] = tempRec[37];  // 37 = $lastcleanerBackJob . "^" .
					arrHouseList[a][38] = tempRec[38];  // 38 = $row['cleaningProduct'] . "^" .
					arrHouseList[a][39] = tempRec[39];  // 39 = $cleaningProductText . "^" .
					arrHouseList[a][40] = tempRec[40];  // 40 = $damages . "^" .
					arrHouseList[a][41] = tempRec[41];  // 41 = $trash . "^" .
					arrHouseList[a][42] = tempRec[42];  // 42 = $recycling . "^" .
					arrHouseList[a][43] = tempRec[43];  // 43 = $row['turnAC'] . "^" .
					arrHouseList[a][44] = tempRec[44];  // 44 = $row['lights'] . "^" .
					arrHouseList[a][45] = tempRec[45];  // 45 = $row['garage'] . "^" .
					arrHouseList[a][46] = tempRec[46];  // 46 = $garageDoorCode . "^" .
					arrHouseList[a][47] = tempRec[47];  // 47 = $garageDoorAddl . "^" .
					arrHouseList[a][48] = tempRec[48];  // 48 = $row['provideKey'] . "^" .
					arrHouseList[a][49] = tempRec[49];  // 49 = $provideKeyText . "^" .
					arrHouseList[a][50] = tempRec[50];  // 50 = $row['hwKey'] . "^" .
					arrHouseList[a][51] = tempRec[51];  // 51 = $row['keyUse'] . "^" .
					arrHouseList[a][52] = tempRec[52];  // 52 = $keyLeft . "^" .
					arrHouseList[a][53] = tempRec[53];  // 53 = $row['keyCompleted'] . "^" .
					arrHouseList[a][54] = tempRec[54];  // 54 = $keyCompletedText . "^" .
					arrHouseList[a][55] = tempRec[55];  // 55 = $keyAlarmDeact . "^" .
					arrHouseList[a][56] = tempRec[56];  // 56 = $keyAlarmReact . "^" .
					arrHouseList[a][57] = tempRec[57];  // 57 = $siEntrance . "^" .
					arrHouseList[a][58] = tempRec[58];  // 58 = $siParking . "^" .
					arrHouseList[a][59] = tempRec[59];  // 59 = $row['minorQ'] . "^" .
					arrHouseList[a][60] = tempRec[60];  // 60 = $minorQText . "^" .
					arrHouseList[a][61] = tempRec[61];  // 61 = $notify . "^" .
					arrHouseList[a][62] = tempRec[62];  // 62 = $row['isHead'] . "^" .
					arrHouseList[a][63] = tempRec[63];  // 63 = $row['econtname'] . "^" .
					arrHouseList[a][64] = tempRec[64];  // 64 = $row['econtrel'] . "^" .
					arrHouseList[a][65] = tempRec[65];  // 65 = $row['econtno'] . "^" .
					arrHouseList[a][66] = tempRec[66];  // 66 = $row['econtdob'] . "^" .
					arrHouseList[a][67] = tempRec[67];  // 67 = $row['petlist'] . "^" .
					arrHouseList[a][68] = tempRec[68];  // 68 = $allergies . "^" . 
					arrHouseList[a][69] = tempRec[69];  // 69 = getMembers($row['id']) . "^" . 
					arrHouseList[a][70] = tempRec[70];  // 70 = getFlowers($row['id']) . "^" . 
					arrHouseList[a][71] = tempRec[71];  // 71 = $image . "^";
					arrHouseList[a][72] = tempRec[72];  // 72 = freeFlowers . "^";
					arrHouseList[a][73] = tempRec[73];  // 73 = ba2 . "^";
					arrHouseList[a][74] = tempRec[74];  // 74 = kitchen . "^";
					arrHouseList[a][75] = tempRec[75];  // 75 = deck . "^";
					arrHouseList[a][76] = tempRec[76];  // 76 = sunroom . "^";
					arrHouseList[a][77] = tempRec[77];  // 77 = houseage . "^";
					arrHouseList[a][78] = tempRec[78];  // 78 = $allergies . "^" . 
					arrHouseList[a][79] = tempRec[79];  // 79 = getMembers($row['id']) . "^" . 
					arrHouseList[a][80] = tempRec[80];  // 80 = getFlowers($row['id']) . "^" . 
					arrHouseList[a][81] = tempRec[81];  // 81 = $image . "^";
					arrHouseList[a][82] = tempRec[82];  // 82 = freeFlowers . "^";
					arrHouseList[a][83] = tempRec[83];  // 83 = ba2 . "^";
					arrHouseList[a][84] = tempRec[84];  // 84 = kitchen . "^";
					arrHouseList[a][85] = tempRec[85];  // 85 = deck . "^";
					arrHouseList[a][86] = tempRec[86];  // 86 = sunroom . "^";
					arrHouseList[a][87] = tempRec[87];  // 87 = houseage . "^";
					arrHouseList[a][88] = tempRec[88];  // 88 = $allergies . "^" . 
					arrHouseList[a][89] = tempRec[89];  // 89 = getMembers($row['id']) . "^" . 
					arrHouseList[a][90] = tempRec[90];  // 90 = getFlowers($row['id']) . "^" . 
					arrHouseList[a][91] = tempRec[91];  // 91 = $image . "^";
					arrHouseList[a][92] = tempRec[92];  // 91 = $image . "^";
					arrHouseList[a][93] = tempRec[93];  // 91 = $image . "^";
					arrHouseList[a][94] = tempRec[94];  // 91 = $image . "^";
					arrHouseList[a][95] = tempRec[95];  // 91 = $image . "^";
					arrHouseList[a][96] = tempRec[96];  // 91 = $image . "^";
					arrHouseList[a][97] = tempRec[97];  // 91 = $image . "^";
					arrHouseList[a][98] = tempRec[98];  // 91 = $image . "^";
					arrHouseList[a][99] = tempRec[99];  // 91 = $image . "^";
					arrHouseList[a][100] = tempRec[100];  // 91 = $image . "^";
					arrHouseList[a][101] = tempRec[101];  // 91 = $image . "^";
					arrHouseList[a][102] = tempRec[102];  // 91 = $image . "^";
					arrHouseList[a][103] = tempRec[103];  // 91 = $image . "^";
					arrHouseList[a][104] = tempRec[104];  // 104 = $totsavings . "^";
					if (a == 1) {
						houseZip = arrHouseList[a][13];
						houseDistance = arrHouseList[a][3];
						houseDirection = arrHouseList[a][5];
					}
					
					statusStyle = "background: #808080;";
					if (tempRec[6] == "active") {
						tmpOut2 = tmpOut2 + "<option value=" + strDQ + a  + strDQ  + ">" + tempRec[7] + "</option>";
						statusStyle = "background: #008000;"; // GREEN
					
					} else if(tempRec[6] == "inactive") {
						statusStyle = "background: #800000;"; // RED
					} else if(tempRec[6] == "pending") {
						statusStyle = "background: #ff8000; color:#000000;"; //ORANGE
					}
					
					
					
					tmpOut = tmpOut + '<div class="frm_house_list"  >';
					tmpOut = tmpOut + '<div class="housedetails" style="height: 100px;" onclick="display('+ strSQ + 'tab2_basic' + strSQ +',21,' + strSQ + a + strSQ + ')">';
					tmpOut = tmpOut + '<img src="' + tempRec[71] + '" class="house" />';
					tmpOut = tmpOut + '<h4>' + tempRec[7] + '</h4>';
					tmpOut = tmpOut + '<p>' + tempRec[9] + ' ' + tempRec[10] + '</p>';
					tmpOut = tmpOut + '<p>' + tempRec[11] + ' ' + tempRec[12] + ' ' + tempRec[13] + '</p>';
					tmpOut = tmpOut + '<p>Status : <span id="lblHouseStatus' + a + '" class="houseStatus" style="' + statusStyle + '">'+ tempRec[6] +'</span></p>';
					tmpOut = tmpOut + '</div>';
					
					tmpOut = tmpOut + '<div class="houseBtnContainer" >';
					tmpOut = tmpOut + '<div class="houseButton" ><img src="img/resources/house/settings.png" title="Status Setting" style="height: 32px; width:32px; border:none" id="cmdSetting' + a + '" onclick="showSetting('+ a +')"></div>';
					tmpOut = tmpOut + '<div class="houseButton" ><img src="img/resources/house/picture_edit.png" title="Upload House Picture" style="height: 32px; width:32px; border:none" id="cmdPic' + a + '" onclick="uploadHousePic('+ strSQ + tempRec[2]  + strSQ + ')"></div>';
					tmpOut = tmpOut + '<div class="houseButton" ><img src="img/resources/house/viewschedule.png" title="View Schedule" style="height: 32px; width:32px; border:none" onclick="loadData(' + strSQ +'tab_coupon' + strSQ +');displayHouseSchedule(' + strSQ + strSQ +');display(' + strSQ +'tab_schedule' + strSQ +',0)"></div>';
					tmpOut = tmpOut + '<div class="houseNotification"><p>Savings to date <b><span style="font-size:16px;">$ ' + tempRec[103] + '</span></b></p></div>';
					tmpOut = tmpOut + '</div>';
					tmpOut = tmpOut + '</div>';
					/*
					if (a == 1) {
						houseZip = arrHouseList[a][13];
						houseDistance = arrHouseList[a][3];
						houseDirection = arrHouseList[a][5];
					}
					if (tempRec[6] == "active") {
						tmpOut2 = tmpOut2 + "<option value=" + strDQ + a  + strDQ  + ">" + tempRec[7] + "</option>"
					}
					
					tmpOut = tmpOut +  "<div class=" + String.fromCharCode(34) + "frm_house_list" + String.fromCharCode(34) + "> " +
									   "<img src=" + strDQ + "img/button/house_summary.gif" + strDQ + " class=" + strDQ + "button" + strDQ + " title=" + strDQ +"View Summary" + strDQ + " onclick=" + strDQ + "viewSummary('" + a + "')" + strDQ + " />"
					if ( arrHouseList[a][6] != "active") {
						tmpOut = tmpOut + "<img src=" + strDQ + "img/button/accept.png" + strDQ + " class=" + strDQ + "button" + strDQ + " title=" + strDQ +"Activate" + strDQ + " onclick=" + strDQ + "activateHouse('" + a + "')" + strDQ + " />"
					}
				   else {
						tmpOut = tmpOut + "<img src=" + strDQ + "img/button/cross.png" + strDQ + " class=" + strDQ + "button" + strDQ + " title=" + strDQ +"Deactivate" + strDQ + " onclick=" + strDQ + "deactivateHouse('" + a + "')" + strDQ + " />" 
					}
					tmpOut = tmpOut + "<img src=" + strDQ + "img/button/image_1.png" + strDQ + " class=" + strDQ + "button" + strDQ + " title=" + strDQ +"Upload House Picture" + strDQ + " onclick=" + strDQ + "uploadHousePic('" + tempRec[2] + "')" + strDQ + " />"
					tmpOut = tmpOut + "<img src=" + strDQ + "loadinfo.gif" + strDQ + " id=" + strDQ + "loading" + a + strDQ + " class=" + strDQ + "button" + strDQ + " title=" + strDQ +"Upload House Picture" + strDQ + " style=" + strDQ + "display:none;" + strDQ + " onclick=" + strDQ + "uploadHousePic('" + tempRec[2] + "')" + strDQ + " />"
					//style=" + strDQ + "display:none;" + strDQ + "
					
					tmpOut = tmpOut + "<img src=" + strDQ + tempRec[71] + strDQ + " onclick=" + strDQ + "display('tab2_basic',21," + a + ")" + strDQ + " /> " +
					                   "<h4 onclick=" + strDQ + "display('tab2_basic',21," + a + ")" + strDQ + ">" + tempRec[7] + "<h4>" +
					                   "<p>" + tempRec[9] + " " + tempRec[10] + "</p>" +
					                   "<p>" + tempRec[11] + " " + tempRec[12] + " " + tempRec[13] + "</p>" +
					                   "<p><b>Status : " + tempRec[6] + "</b></p>" +
								    "</div>";
					*/
				}		
				
				tmpOut = tmpOut + '<div class="frm_house_list" >';
				tmpOut = tmpOut + '<div class="housedetails" style="height: 100px;" onclick="PopUpDiv('+ strSQ + 'new_house_tab' + strSQ +',' + strSQ +'tab_houselist' + strSQ + ', 30, 60, true)">';
				tmpOut = tmpOut + '<img src="img/resources/new_house.png"  class="house" />';
				tmpOut = tmpOut + '<h4>Add a New House</h4>';
				tmpOut = tmpOut + '</div>';
				tmpOut = tmpOut + '<div class="houseBtnContainer" ></div>';
				tmpOut = tmpOut + '</div>';
					/*
					tmpOut = tmpOut +  "<div class=" + String.fromCharCode(34) + "frm_house_list" + String.fromCharCode(34) + " onclick=" + String.fromCharCode(34) + "PopUpDiv('new_house_tab','tab_houselist', 30, 60, true)" + String.fromCharCode(34) + "> " +	
								    "<img src=" + String.fromCharCode(34) + "img/resources/new_house.png"  + String.fromCharCode(34) + " /> " +
								    "<h4>Add a New House</h4>" +
								    "</div>";
					*/
				
				document.getElementById('tab2_house_list').innerHTML = tmpOut;
				document.getElementById('selHouseName').innerHTML =  tmpOut2;
				
			}
			else if  (id == "personal") {
				tempRecs = response.split("|");
				//alert(response);
				arrPersonal = tempRecs[1].split("^");
			}
			else if  (id == "family") {
				tempRecs = response.split("|");
				arrFamily = tempRecs[1].split("^");
			}
			else if  (id == "security") {
				arrSecurity = response.split("|");
				var tmpStr = '<option value="">Select secutity question</option>' ;
				for (a=1;a<arrSecurity.length;a++) {
					tmpStr = tmpStr + '<option value="' + arrSecurity[a] + '">' + arrSecurity[a] + '</option>';
				}
				document.getElementById('fldSecQ').innerHTML = tmpStr;
			}
			else if  (id == "tab_coupon") {
				tmpStr = "<table cellpadding='0' cellspacing='0'>" + "<tr>" +  "<th width='90'>Coupon Code</th>" + 
                         "<th width='220'>Description</th>" + "<th width='80'>Date Received</th>" + "<th width='80'>Validity</th>" +
                         "<th width='150'>Remarks</th> </tr>";
				if (response != "NO") {
					tempRecs = response.split("|");

					arrCoupon.length = tempRecs.length;
					
					for (a=1;a<tempRecs.length;a++) {
						arrCoupon[a] = new Array(38);
						arrCoupon[a] = tempRecs[a].split("^");
						
						/*
						
				        0   $row['id']	 . "^" .
						1	$row['cType'] . "^" .
						2	$row['cCode'] . "^" .
						3	$row['cDesc'] . "^" .
						4	$row['cDollarValue'] . "^" .
						5	$row['dateClaimed'] . "^" .
						6	$row['validity'] . "^" .
						7	$row['combinable'] . "^" .
						8	$row['tansferable'] . "^" .
						9	$row['status'] . "^" .
						10	$row['regionID'] . "^" .
						11	$row['maxUsage'] . "^" .
						12	$row['remUsage'];
						
						*/
						
						tmpStr +=  "<tr valign=" + strDQ  + "top" + strDQ + " onclick=" + strDQ + 
						            "couponDetails('" +  a + "');PopUpDiv('coupon_details_tab','frm_register_coupon', 30, 30, true)" + strDQ + " title=" + strDQ +  "Click to view details" + strDQ + ">" +
									"<td>" +  arrCoupon[a][2] + "</td>" +
									"<td>" +  arrCoupon[a][1] + "  - <br /> " +  arrCoupon[a][3] + "</td>" +
									"<td>" +  arrCoupon[a][5] + "</td>" +
									"<td>" +  arrCoupon[a][6] + "</td>" +
									"<td>" +  arrCoupon[a][9] + "</td>" ;
					}

				}
				document.getElementById('tab5_couponlist').innerHTML = tmpStr + "</table>";
			}
		}

	   }
		
	    var param = ""
			if (zip == undefined) {
				param = "getData.php?id=" + id;
			}
			else {
				param = "getData.php?id=" + id + "&zip=" + zip;
			}
			xmlhttp.open("GET",param,false);
			xmlhttp.send();
}




function computeEstimate(id,idplus) {
	var cnt = 0;
	var totHours = "90";
	var fromModify = "";
//	alert(arrSched[document.getElementById('fldSchedType').value][2] + " : " + basicRate);
//alert("0");
	if ( id =='mod') {
//alert("01");
		fldBasicEst = arrSched[document.getElementById('fldModSchedType').value][2] * basicRate;
	}
	else if(id==strGreenCleanID) {
//alert("02");
		//alert("aa");
		document.getElementById('fldGreenClean').checked = document.getElementById(strGreenCleanID).checked;
		id='';
	}
	
	else {
//alert("03");

		fldBasicEst = arrSched[document.getElementById('fldSchedType').value][2] * basicRate;
	}
//alert("1");	
	TotalAddEst = "0";
	if (!(id == "undefined" || id == "")) {
		if ( id =='mod') {
			fromModify = "Y";
		}
		else if ( id =='fldNoFloor') {
			if (parseInt(arrFloors[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).style.display = "none";
				document.getElementById(idplus).value = "";
			}
		}
//alert("2");	
		if ( id =='fldBR') {
			if (parseInt(arrBed[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
//alert("3");	
		if ( id =='fldBA') {
			if (parseInt(arrBath[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
		if ( id =='fldNoPets') {
			if (parseInt(arrPets[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
//alert("4");	
		if ( id =='fldClFans') {
			if (parseInt(arrCeiling[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
		if ( id =='fldClFans') {
			if (parseInt(arrCeiling[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
//alert("5");	
		if ( id =='fldFirePlace') {
			if (parseInt(arrFire[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
		if ( id =='fldWindows') {
			if (parseInt(arrWindows[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
		if ( id =='fldBA2') {
			if (parseInt(arrHalfBath[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
//alert("6");	
		if ( id =='fldKitchen') {
			if (parseInt(arrKitchen[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
		if ( id =='fldDeck') {
			if (parseInt(arrDeck[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
		if ( id =='fldSunroom') {
			if (parseInt(arrSunroom[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
//alert("7");	
		if ( id =='fldDen') {
			if (parseInt(arrDen[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
		if ( id =='fldGlassDoor') {
			if (parseInt(arrGlassDoor[document.getElementById(id).value][4]) > 0 ) {
				document.getElementById(idplus).style.display = "inline";
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).focus();
			} 
			else {
				document.getElementById(idplus).value = "";
				document.getElementById(idplus).style.display = "none";
			}
		}
	}
//alert("8");	
		//alert(arrBed[document.getElementById('fldBR').value][4]);
		//alert(parseFloat(document.getElementById('fldBRPlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrBed[document.getElementById('fldBR').value][4]) * parseFloat('0'+document.getElementById('fldBRPlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrBath[document.getElementById('fldBA').value][4])  * parseFloat('0'+document.getElementById('fldBAPlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrPets[document.getElementById('fldNoPets').value][4])  * parseFloat('0'+document.getElementById('fldNoPetsPlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrFloors[document.getElementById('fldNoFloor').value][4])  * parseFloat('0'+document.getElementById('fldNoFloorPlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrCeiling[document.getElementById('fldClFans').value][4])  * parseFloat('0'+document.getElementById('fldClFansPlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrFire[document.getElementById('fldFirePlace').value][4]) * parseFloat('0'+document.getElementById('fldFirePlacePlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrWindows[document.getElementById('fldWindows').value][4]) * parseFloat('0'+document.getElementById('fldWindowsPlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrHalfBath[document.getElementById('fldBA2').value][4]) * parseFloat('0'+document.getElementById('fldBA2Plus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrKitchen[document.getElementById('fldKitchen').value][4]) * parseFloat('0'+document.getElementById('fldKitchenPlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrDeck[document.getElementById('fldDeck').value][4]) * parseFloat('0'+document.getElementById('fldDeckPlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrSunroom[document.getElementById('fldSunroom').value][4]) * parseFloat('0'+document.getElementById('fldSunroomPlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrGlassDoor[document.getElementById('fldGlassDoor').value][4]) * parseFloat('0'+document.getElementById('fldGlassDoorPlus').value));
		TotalAddEst = parseFloat(TotalAddEst) + (parseFloat(arrDen[document.getElementById('fldDen').value][4]) * parseFloat('0'+document.getElementById('fldDenPlus').value));

//alert("9");	
	
	if (document.getElementById('fldInitClean').checked == false) {
//		alert("ronald11");
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrBed[document.getElementById('fldBR').value][1]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrBath[document.getElementById('fldBA').value][1]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrPets[document.getElementById('fldNoPets').value][1]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrFloors[document.getElementById('fldNoFloor').value][1]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrCeiling[document.getElementById('fldClFans').value][1]);
//		alert("ronald12");
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrFire[document.getElementById('fldFirePlace').value][1]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrWindows[document.getElementById('fldWindows').value][1]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrHalfBath[document.getElementById('fldBA2').value][1]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrKitchen[document.getElementById('fldKitchen').value][1]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrDeck[document.getElementById('fldDeck').value][1]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrSunroom[document.getElementById('fldSunroom').value][1]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrGlassDoor[document.getElementById('fldGlassDoor').value][1]);
//		alert("ronald13");
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrDen[document.getElementById('fldDen').value][1]);
//		alert("ronald13a");
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrBasement[document.getElementById('fldBsmt').value][1]);
//		alert("ronald13b");
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrHouseAge[document.getElementById('fldHouseAge').value][1]);
//		alert("ronald13c");
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrHouseCond[document.getElementById('fldHouseCond').value][1]);
//		alert("ronald14");
//alert("10");	
        
		if (fromModify == "Y") {
			for (var i=1; i < arrOth.length; i++) {
				if (document.getElementById('optMod' + i).checked) {
					cnt++;
					if (cnt == 1) {
						othServices =  document.getElementById('optMod' + i).value;
					}
					else {
						othServices =  othServices + "~" + document.getElementById('optMod' + i).value;
					}
					
					TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrOth[i][1]);
				}
			} 
		
		}
		else {
			for (var i=1; i < arrOth.length; i++) {
				if (document.getElementById('opt' + i).checked) {
					cnt++;
					if (cnt == 1) {
						othServices =  document.getElementById('opt' + i).value;
					}
					else {
						othServices =  othServices + "~" + document.getElementById('opt' + i).value;
					}
					
					TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrOth[i][1]);
				}
			} 
		}
		document.getElementById('fldInitHours').value = "";
		document.getElementById('fldInitEst').value = "";
		document.getElementById('divEstInitCleaning').style.display = "none";
//alert("11");	

	}

	else { 
//		alert("ronald11");
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrBed[document.getElementById('fldBR').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrBath[document.getElementById('fldBA').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrPets[document.getElementById('fldNoPets').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrFloors[document.getElementById('fldNoFloor').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrCeiling[document.getElementById('fldClFans').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrFire[document.getElementById('fldFirePlace').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrWindows[document.getElementById('fldWindows').value][3]);
//		alert("ronald12");
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrHalfBath[document.getElementById('fldBA2').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrKitchen[document.getElementById('fldKitchen').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrDeck[document.getElementById('fldDeck').value][3]);
//		alert("ronald13");
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrSunroom[document.getElementById('fldSunroom').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrGlassDoor[document.getElementById('fldGlassDoor').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrDen[document.getElementById('fldDen').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrBasement[document.getElementById('fldBsmt').value][3]);
//		alert("ronald14");
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrHouseAge[document.getElementById('fldHouseAge').value][3]);
		TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrHouseCond[document.getElementById('fldHouseCond').value][3]);
//		alert("ronald15");
//alert("12");	
		
	    totHours = parseFloat(totHours) + parseFloat(arrBed[document.getElementById('fldBR').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrBath[document.getElementById('fldBA').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrPets[document.getElementById('fldNoPets').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrFloors[document.getElementById('fldNoFloor').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrCeiling[document.getElementById('fldClFans').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrFire[document.getElementById('fldFirePlace').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrWindows[document.getElementById('fldWindows').value][2]);
//		alert("ronald16");
		totHours = parseFloat(totHours) + parseFloat(arrHalfBath[document.getElementById('fldBA2').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrKitchen[document.getElementById('fldKitchen').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrDeck[document.getElementById('fldDeck').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrSunroom[document.getElementById('fldSunroom').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrDen[document.getElementById('fldDen').value][2]);
//		alert("ronald17");
		totHours = parseFloat(totHours) + parseFloat(arrBasement[document.getElementById('fldBsmt').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrHouseAge[document.getElementById('fldHouseAge').value][2]);
		totHours = parseFloat(totHours) + parseFloat(arrHouseCond[document.getElementById('fldHouseCond').value][2]);
//		alert("ronald18");
//alert("13");	
		
		if (fromModify == "Y") {
			for (var i=1; i < arrOth.length; i++) {
				if(document.getElementById('optMod' + i).checked) {
					cnt++;
					if (cnt == 1) {
						othServices =  document.getElementById('optMod' + i).value;
					}
					else {
						othServices =  othServices + "~" + document.getElementById('optMod' + i).value;
					}
					TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrOth[i][3]);
					totHours = parseFloat(totHours) + parseFloat(arrOth[i][2]);
				}
			} 
		}
		else {
			for (var i=1; i < arrOth.length; i++) {
				if(document.getElementById('opt' + i).checked) {
					cnt++;
					if (cnt == 1) {
						othServices =  document.getElementById('opt' + i).value;
					}
					else {
						othServices =  othServices + "~" + document.getElementById('opt' + i).value;
					}
					TotalAddEst = parseFloat(TotalAddEst) + parseFloat(arrOth[i][3]);
					totHours = parseFloat(totHours) + parseFloat(arrOth[i][2]);
				}
			} 
		}
		var num = parseInt(totHours) / 60;
		var result = num.toFixed(0);
		document.getElementById('fldInitHours').value = "";
		document.getElementById('fldInitEst').value = "";
		document.getElementById('fldInitHours').value = result;
		document.getElementById('fldInitEst').value = "$" + parseFloat(result) * parseFloat(hourlyRate);
		document.getElementById('divEstInitCleaning').style.display = "block";
//alert("14");	
	} 
	
	TotalAddEst = parseInt(TotalAddEst) + parseInt(totFlowersAmt);

	if (falsePrice == "0" || falsePrice == "") {
		falsePrice = "0";
		document.getElementById('fldBasic').value = "$" + fldBasicEst;
		document.getElementById('fldDiscount').value = "";
		document.getElementById('lblDiscount').style.display = "none";
	}
	else {
		fldBasicEst = parseFloat(fldBasicEst) + parseFloat(falsePrice)
		document.getElementById('fldBasic').value = "$" + fldBasicEst;
		document.getElementById('fldDiscount').value = "$" + falsePrice;
		document.getElementById('lblDiscount').style.display = "block";
	}
//	alert("ronald");
//	alert(houseIDX);
//alert("15");	

	document.getElementById('fldAdditionals').value = "$" + TotalAddEst;
	
	//fldTotalEst = parseFloat(TotalAddEst) + parseFloat(fldBasicEst) + parseFloat(falsePrice)  ;
	fldTotalEst = parseFloat(TotalAddEst) + parseFloat(fldBasicEst);
	
	document.getElementById('fldTotalEst').value = "$" + fldTotalEst  ;
	if (arrHouseList[houseIDX][98]  == "" || arrHouseList[houseIDX][98]  == "0"  ) {
		document.getElementById('fldOverride').value = "";
		document.getElementById('lblOverride').style.display = "none";
		document.getElementById('fldTotalPay').value = "$" + (parseFloat(fldTotalEst) - parseFloat(falsePrice));
		document.getElementById('lblDiscount').style.display = "block";
	} 
	else {
	
		document.getElementById('lblDiscount').style.display = "none";
		document.getElementById('fldOverride').value = "$" + arrHouseList[houseIDX][98];
		document.getElementById('lblOverride').style.display = "block";
		document.getElementById('fldTotalPay').value = "$" + arrHouseList[houseIDX][98];
	}
	
//alert("16");	
	
	
	
}

function navigateSked(id) {
	if (id == "prev") {
		if (curmonth == 1) {
			curmonth = 12;
			curyear--;
			}
		else
		 {
			curmonth--;
		}
	}
	else {
		if (curmonth == 12) {
			curyear++;
			curmonth = 1;
		} 
		else {
			curmonth++;
		}
	}
	getSchedule("0");
}
function getSchedule(id) {
	var xmlhttp;

	if (window.XMLHttpRequest){
          // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	var br = "";
	var brPlus = "";
	br = arrBed[document.getElementById("fldBR").value][0];
	brPlus = "0" + document.getElementById("fldBRPlus").value;

	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			var response = xmlhttp.responseText;
			var temp = new Array();
			var a=0;
			var b=0;
			var c=0;
			var d=0;
			var lastMonth="0";
			temp = response.split("|");
			for (a=0;a<32;a++) {
				arrLoad[0][a] = "";
			}
			for (a=1;a < temp.length;a++) {
				var temp2 = new Array();
				temp2 = temp[a].split("-");
				d = parseInt(temp2[2],10);
				if ( a == 1) {
					arrLoad[c][d] = parseInt(temp2[3]);
				}	
				else {
					if ( temp2[1] == lastMonth ) {
						arrLoad[c][d] = parseInt(temp2[3]);
					}	 
					else {
						c = c + 1;
						arrLoad[c][d] = parseInt(temp2[3]);
					}	
				}
				lastMonth = temp2[1];
			}
			computeEstimate();
			//document.getElementById("tab3_sched").style.display = "block";
			document.getElementById('embeddedCalendar1').innerHTML  = buildCal(curmonth ,curyear, 0, arrLoad[0], maxLoad);
			document.getElementById('embeddedCalendar2').innerHTML  = buildCal2(curmonth ,curyear, 0, arrLoad[0], maxLoad);
			document.getElementById('embeddedCalendar3').innerHTML  = buildCal3(curmonth ,curyear, 0, arrLoad[0], maxLoad);
			
			//if (id == "1") {
			//	document.getElementById("tab3_sched").style.display = "none";
			//}

		}

	   }
	    var param = ""

			param = "getSched4.php?regionid="  + regionid + "&year=" + curyear + "&month=" + curmonth +
			 "&zip="  + houseZip + "&distance=" + houseDistance + "&direction=" + houseDirection + "&br=" + br + "&brPlus=" + brPlus;
			xmlhttp.open("GET",param,false);
			xmlhttp.send();
	
}

	function saveUpdates(id) {
		
		if (validateData(id)) {
			saveData(id);
		} 
		
	}
	
	function validateData(id) {
		
		return true;
	}
	
	function saveData(id) {
		var xmlhttp;

		if (window.XMLHttpRequest){
			  // code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		}
		else
		{// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}

		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
			{
				var response = xmlhttp.responseText;
				if (response == "-1") {
					alertX("Session Expired!");
					<!--
					window.location = "http://wwww.housewarmersinc.com/";
					//-->					
				}
				else if (response.indexOf("0") < 0 )  {
					//function msgBox(errCode, addMsg, iconImg, strButtons, strTitle) {				
					msgBox("Save successful!","","check","OK","Save Data","","ok");
					
					if (id == "newhouse") {
						getdata('houselist'); loadData('houselist');display('tab_houselist',0);
					}
					else {
					formEnable(id,false);
					}
					save_ok = "1";
				} 
				else {
					alertX("Error occured during saving!");
					save_ok = "0";
				}
			}

		   }
			var param = ""
			var paramData = ""
			if (id == 'frm_hsprofile_basic') {
//				alert("ronald1");
				paramData +=  "~" + document.getElementById('fldNewHouseID').value;
//				alert("ronald1aa");
				paramData +=  "~" + document.getElementById('fldNewHouseName').value;
//				alert("ronald1bb");
				paramData +=  "~" + document.getElementById('fldNewHouseType').value;
				;
//				alert("ronald1a");
				paramData +=  "~" + document.getElementById('fldNewAddress').value;
				paramData +=  "~" + document.getElementById('fldNewAddress2').value;
				paramData +=  "~" + document.getElementById('fldNewCity').value;
				paramData +=  "~" + document.getElementById('fldNewState').value;
//				alert("ronald1b");
				paramData +=  "~" + document.getElementById('fldNewZip').value;
				paramData +=  "~" + arrPets[document.getElementById('fldNoPets').value][0];
				paramData +=  "~" + arrFloors[document.getElementById('fldNoFloor').value][0];
				paramData +=  "~" + arrBed[document.getElementById('fldBR').value][0];
				paramData +=  "~" + arrBath[document.getElementById('fldBA').value][0];
//				alert("ronald1c");
				paramData +=  "~" + arrHalfBath[document.getElementById('fldBA2').value][0];
				paramData +=  "~" + arrKitchen[document.getElementById('fldKitchen').value][0];
				paramData +=  "~" + arrDeck[document.getElementById('fldDeck').value][0];
				paramData +=  "~" + arrSunroom[document.getElementById('fldSunroom').value][0];
//				alert("ronald1d");
				paramData +=  "~" + arrDen[document.getElementById('fldDen').value][0];
				paramData +=  "~" + arrBasement[document.getElementById('fldBsmt').value][0];
				paramData +=  "~" + arrCeiling[document.getElementById('fldClFans').value][0];
				paramData +=  "~" + arrFire[document.getElementById('fldFirePlace').value][0];
				paramData +=  "~" + arrWindows[document.getElementById('fldWindows').value][0];
//				alert("ronald1e");
				paramData +=  "~" + arrHouseCond[document.getElementById('fldHouseCond').value][0];
				paramData +=  "~" + arrHouseAge[document.getElementById('fldHouseAge').value][0];
				paramData +=  "~" + document.getElementById('fldInitClean').checked;
				paramData +=  "~" + arrSched[document.getElementById('fldSchedType').value][0];
				paramData +=  "~" + document.getElementById('fldSchedException').value;
//				alert("ronald1f");
				paramData +=  "~" + document.getElementById('fldTimePrefText').value;
				paramData +=  "~" + document.getElementById('f_date_c').value;

//				alert("ronald2");
				
					var fldTimePref = "";
				    if (document.getElementById('chkTimePref_0').checked == true) {
						fldTimePref = fldTimePref + ", 0";
					}
//				alert("ronald2a");
				    if (document.getElementById('chkTimePref_1').checked == true) {
						fldTimePref = fldTimePref + ", 1"
					}
				    if (document.getElementById('chkTimePref_2').checked == true) {
						fldTimePref = fldTimePref + ", 2";
					}
//				alert("ronald2b");
				    if (document.getElementById('chkTimePref_3').checked == true) {
						fldTimePref = fldTimePref + ", 3";
					}
//				alert("ronald2c");
				    if (document.getElementById('chkTimePref_4').checked == true) {
						fldTimePref = fldTimePref + ", 4";
					}
//				alert("ronald2d");
				    if (document.getElementById('chkTimePref_5').checked == true) {
						fldTimePref = fldTimePref + ", 5";
					}

//				alert("ronald3");
					
					var fldSchedPref = "";
				    if (document.getElementById('chkSchedPref_0').checked == true) {
						fldSchedPref = fldSchedPref + ", 0";
					}
				    if (document.getElementById('chkSchedPref_1').checked == true) {
						fldSchedPref = fldSchedPref + ", 1";
					}
				    if (document.getElementById('chkSchedPref_2').checked == true) {
						fldSchedPref = fldSchedPref + ", 2";
					}
				    if (document.getElementById('chkSchedPref_3').checked == true) {
						fldSchedPref = fldSchedPref + ", 3";
					}

					paramData += "~" + fldSchedPref + "~" + fldTimePref; 
				
					paramData += "~" + document.getElementById('fldInitEst').value.replace("$","") + "~" +
	                            document.getElementById('fldTotalEst').value.replace("$","");
								
					paramData +=  "~" + arrGlassDoor[document.getElementById('fldGlassDoor').value][0];				
					paramData += "~" + document.getElementById('fldBRPlus').value;			
					paramData += "~" + document.getElementById('fldBAPlus').value;			
					paramData += "~" + document.getElementById('fldNoPetsPlus').value;			
					paramData += "~" + document.getElementById('fldNoFloorPlus').value;			
					paramData += "~" + document.getElementById('fldClFansPlus').value;			
					paramData += "~" + document.getElementById('fldFirePlacePlus').value;			
					paramData += "~" + document.getElementById('fldWindowsPlus').value;			
					paramData += "~" + document.getElementById('fldBA2Plus').value;			
					paramData += "~" + document.getElementById('fldKitchenPlus').value;			
					paramData += "~" + document.getElementById('fldDeckPlus').value;			
					paramData += "~" + document.getElementById('fldSunroomPlus').value;			
					paramData += "~" + document.getElementById('fldDenPlus').value;			
					paramData += "~" + document.getElementById('fldGlassDoorPlus').value;			
					if (document.getElementById('fldCommunity').value == "") {
						paramData +=  "~" ;
					} 
					else  {
						paramData +=  "~" + arrCommunities[document.getElementById('fldCommunity').value][0];
					}
					paramData += "~" + document.getElementById('fldCrossStreet').value;			
					
					//alert(paramData );
			}
			else if (id == 'frm_myprofile_family') {
				if (document.getElementById('optImHead_Yes').checked == true) {
					//alert(document.getElementById('optImHead_Yes').value);
					paramData = document.getElementById('optImHead_Yes').value;
				} 
				else {
					//alert(document.getElementById('optImHead_No').value);
					paramData = document.getElementById('optImHead_No').value;
				}
				paramData += "~" + document.getElementById('fldHouseHeadName').value;
				paramData += "~" + document.getElementById('fldHouseHeadRel').value;
				paramData += "~" + document.getElementById('fldHouseHeadNo').value;
				paramData += "~" + document.getElementById('fldHouseHeadBDay').value;
				paramData += "~" + document.getElementById('fldChild1_Name').value + "||" + 
						document.getElementById('fldChild1_Sex').value + "||" + 
						document.getElementById('fldChild1_BDay').value + "||" + 
						document.getElementById('fldChild1_Rel').value;
				paramData += "~" + document.getElementById('fldChild2_Name').value + "||" + 
						document.getElementById('fldChild2_Sex').value + "||" + 
						document.getElementById('fldChild2_BDay').value + "||" + 
						document.getElementById('fldChild2_Rel').value;
				paramData += "~" + document.getElementById('fldChild3_Name').value + "||" + 
						document.getElementById('fldChild3_Sex').value + "||" + 
						document.getElementById('fldChild3_BDay').value + "||" + 
						document.getElementById('fldChild3_Rel').value;
				paramData += "~" + document.getElementById('fldChild4_Name').value + "||" + 
						document.getElementById('fldChild4_Sex').value + "||" + 
						document.getElementById('fldChild4_BDay').value + "||" + 
						document.getElementById('fldChild4_Rel').value;
				paramData += "~" + document.getElementById('fldChild5_Name').value + "||" + 
						document.getElementById('fldChild5_Sex').value + "||" + 
						document.getElementById('fldChild5_BDay').value + "||" + 
						document.getElementById('fldChild5_Rel').value;
				paramData += "~" + document.getElementById('fldPets').value;
				paramData += "~" + document.getElementById('fldAllergy').value;
						
				paramData = arrHouseList[houseIDX][2] + "~" + paramData;
			}
			else if (id == 'frm_hsprofile_addnl') {
				for (var i=0; i < arrFrmElement.length; i++){				
					if (arrFrmElement[i].type == "checkbox") {
						if (arrFrmElement[i].id != "optX") {
							if (arrFrmElement[i].checked == true) {
								paramData = paramData + ", " + arrFrmElement[i].value;
								}
						}
						}
					else {
						 paramData = paramData + "~" + arrFrmElement[i].value;
						}
				}
				
				paramData += "~" + document.getElementById('optX').checked + "~" + getSelectedFlowers();
				
				paramData = paramData + "~" + document.getElementById('fldInitEst').value.replace("$","") + "~" +
							document.getElementById('fldTotalEst').value.replace("$","");
				
				paramData = arrHouseList[houseIDX][2] + "~" + paramData;
			}
			else if (id == 'frm_hsprofile_instruction') {
				paramData = arrHouseList[houseIDX][2];
				paramData += "~" + document.getElementById('fldValuable1_Name').value + "==" +
								   document.getElementById('fldValuable1_Inst').value + "==" +
								   document.getElementById('fldValuable1_SpInst').value;
				paramData += "~" + document.getElementById('fldValuable2_Name').value + "==" +
								   document.getElementById('fldValuable2_Inst').value + "==" +
								   document.getElementById('fldValuable2_SpInst').value;
				paramData += "~" + document.getElementById('fldValuable3_Name').value + "==" +
								   document.getElementById('fldValuable3_Inst').value + "==" +
								   document.getElementById('fldValuable3_SpInst').value;
				paramData += "~" + document.getElementById('fldValuable4_Name').value + "==" +
								   document.getElementById('fldValuable4_Inst').value + "==" +
								   document.getElementById('fldValuable4_SpInst').value;
				paramData += "~" + document.getElementById('fldValuable5_Name').value + "==" +
								   document.getElementById('fldValuable5_Inst').value + "==" +
								   document.getElementById('fldValuable5_SpInst').value;
				paramData += "~" + removeDate(document.getElementById('fldValuable_Others').value);
				
				if (document.getElementById("fldProvidedKey1").checked == true) {
					paramData += "~" + removeDate(document.getElementById("fldProvidedKey1").value);
				} 
				else {
					paramData += "~" + removeDate(document.getElementById("fldProvidedKey2").value);
				}
				
				paramData += "~" + removeDate(document.getElementById('fldProvidedKeyText').value);
				
				if (document.getElementById("fldHwKey1").checked == true) {
					paramData += "~" + removeDate(document.getElementById("fldHwKey1").value);
				} 
				else {
					paramData += "~" + removeDate(document.getElementById("fldHwKey2").value);
				}

				if (document.getElementById("fldKeyUse1").checked == true) {
					paramData += "~" + removeDate(document.getElementById("fldKeyUse1").value);
				} 
				else if (document.getElementById("fldKeyUse2").checked == true) {
					paramData += "~" + removeDate(document.getElementById("fldKeyUse2").value);
				} 
				else {
					paramData += "~" + removeDate(document.getElementById("fldKeyUse3").value);
				}
				
				paramData += "~" + removeDate(document.getElementById('fldKeyUseText').value);
				
				paramData += "~" + removeDate(document.getElementById('fldKeyLeft').value);

				if (document.getElementById("fldKeyCompleted1").checked == true) {
					paramData += "~" + removeDate(document.getElementById("fldKeyCompleted1").value);
				} 
				else {
					paramData += "~" + removeDate(document.getElementById("fldKeyCompleted2").value);
				}
				paramData += "~" + removeDate(document.getElementById('fldKeyComlpetedText').value);
				paramData += "~" + removeDate(document.getElementById('fldAlarmDeactivate').value);
				paramData += "~" + removeDate(document.getElementById('fldAlarmRearm').value);
				paramData += "~" + removeDate(document.getElementById('fldEntrance').value);
				paramData += "~" + removeDate(document.getElementById('fldParking').value);

				if (document.getElementById("fldMinorQ1").checked == true) {
					paramData += "~" + removeDate(document.getElementById("fldMinorQ1").value);
				} 
				else {
					paramData += "~" + removeDate(document.getElementById("fldMinorQ2").value);
				}
				paramData += "~" + removeDate(document.getElementById('fldMinorQText').value);
				paramData += "~" + removeDate(document.getElementById('fldNotifyNeighbor').value);
				
			}
			else if (id == 'frm_hsprofile_exception') {
				paramData = arrHouseList[houseIDX][2];
				paramData += "~" + removeDate(document.getElementById('fldRoomsExclude').value);
				paramData += "~" + removeDate(document.getElementById('fldOverlooked').value);
				if (document.getElementById("optBasement1").checked == true) {
					paramData += "~" + removeDate(document.getElementById("optBasement1").value);
				} 
				else {
					paramData += "~" + removeDate(document.getElementById("optBasement2").value);
				}
				paramData += "~" + removeDate(document.getElementById('fldCleanBasementText').value);
				paramData += "~" + removeDate(document.getElementById('fldPetPeeves').value);
				paramData += "~" + removeDate(document.getElementById('fldOthersBackJob').value);
				if (document.getElementById("fldCleaningProducts_0").checked == true) {
					paramData += "~" + removeDate(document.getElementById("fldCleaningProducts_0").value);
				} 
				else {
					paramData += "~" + removeDate(document.getElementById("fldCleaningProducts_1").value);
				}
				paramData += "~" + removeDate(document.getElementById('fldCleaningProductsTxt').value);
				paramData += "~" + removeDate(document.getElementById('fldDamages').value);
				paramData += "~" + removeDate(document.getElementById('fldTrash').value);
				paramData += "~" + removeDate(document.getElementById('fldRecycle').value);
				paramData += "~" + removeDate(document.getElementById('fldTurnOffAC').value);
				if (document.getElementById("fldLightsLeft1").checked == true) {
					paramData += "~" + removeDate(document.getElementById("fldLightsLeft1").value);
				} 
				else {
					paramData += "~" + removeDate(document.getElementById("fldLightsLeft2").value);
				}
				if (document.getElementById("fldGarDoor1").checked == true) {
					paramData += "~" + removeDate(document.getElementById("fldGarDoor1").value);
				} 
				else {
					paramData += "~" + removeDate(document.getElementById("fldGarDoor2").value);
				}
				paramData += "~" + removeDate(document.getElementById('fldGarDoorCode').value);
				paramData += "~" + removeDate(document.getElementById('fldGarDoorAddl').value);
				
			}
			else if (id == 'newhouse') {
				paramData += "~" +document.getElementById('fldTmpHouseName').value;
				paramData += "~" +document.getElementById('fldTmpHouseType').value;
				paramData += "~" +document.getElementById('fldTmpAddress').value;
				paramData += "~" +document.getElementById('fldTmpAddress2').value;
				paramData += "~" +document.getElementById('fldTmpCity').value;
				paramData += "~" +document.getElementById('fldTmpState').value;
				paramData += "~" +document.getElementById('fldTmpZip').value;	
			}
			else {	
				for (var i=0; i < arrFrmElement.length; i++){				
					if (arrFrmElement[i].type != "checkbox") {
						 paramData = paramData + "~" + arrFrmElement[i].value;
						}
					else {
						 paramData = paramData + "~" + arrFrmElement[i].checked;
						}
				}
				
			}
				param = "saveupdate.php?id="  + id + "&param=" + encodeURIComponent(paramData);
				//alert(param);
				//document.getElementById('SS').innerHTML = param;
				xmlhttp.open("GET",param,false);
				xmlhttp.send();
		
			
	}

	function getSelectedFlowers(id) {
		var outStr = "";
		
		if (id=="cart") {
			for(a=1; a<arrFlowers.length;a++) {
				var itemId=arrFlowers[a][0];
				var chkElement = document.getElementById('chk_sum_flower_' + itemId)
					if(chkElement.checked == true) {
						
						outStr += "^^" + arrFlowers[a][4] + "||" + document.getElementById('sum_flower_desc_' + itemId).innerHTML  + "||" + arrFlowers[a][1] + "||" + arrFlowers[a][2] + "||" +  arrFlowers[a][3]  +  "||" + document.getElementById('fld_sel_flower_' + itemId).value;
						
					}
				}
		}
		else if (id=="mod" || id=="add") {
			for(a=1; a<arrFlowers.length;a++) {
				var itemId=arrFlowers[a][0];
				var chkElement = document.getElementById('chk_sum_Modflower_' + itemId)
					if(chkElement.checked == true) {
						
						outStr += "^^" + arrFlowers[a][0] + "||" + arrFlowers[a][2] + "||" + document.getElementById('fld_sum_Modflower_' + itemId).value + "||" +  document.getElementById('fld_sum_ModflowerPRICE_' + itemId).value.replace("$","");
						
					}
				}
		}
		else {
			for(a=1; a<arrFlowers.length;a++) {
				var itemId=arrFlowers[a][0];
				var chkElement = document.getElementById('chk_sum_flower_' + itemId)
					if(chkElement.checked == true) {
						
						outStr += "^^" + arrFlowers[a][0] + "||" + arrFlowers[a][2] + "||" + document.getElementById('fld_sum_flower_' + itemId).value + "||" +  document.getElementById('fld_sum_flowerPRICE_' + itemId).value.replace("$","");
						
					}
				}
			}
		return outStr;
		}

		
	function getSelectedFlowers2(id) {
		var outStr = "";
		
		for(a=1; a<arrFlowers.length;a++) {
			var itemId=arrFlowers[a][0];
			var chkElement = document.getElementById('chk_sum_flower_' + itemId)
				if(chkElement.checked == true) {
					outStr += "\n" + document.getElementById('fld_sum_flower_' + itemId).value  + " " +  arrFlowers[a][2] + " " + arrFlowers[a][1];
					//outStr += "^^" + arrFlowers[a][0] + "||" + arrFlowers[a][2] + "||" + document.getElementById('fld_sum_flower_' + itemId).value + "||" +  document.getElementById('fld_sum_flowerPRICE_' + itemId).value.replace("$","");
					
				}
			}
			
		return outStr;
	}

	function removeDate(strA) {
		//alertX("ronald");
		var strIndex = strA.indexOf('--Last Updated');
		if(strIndex > 0) {
			//arrFrmElement[i].value = arrFrmElement[i].value.substring(0,strIndex)
			return strA.substring(0,strIndex).replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ').replace(/\\n/g, "");
			}
		else {
			return strA.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ').replace(/\\n/g, "");
			}
	}

	function submitNewHouse() {
		if (validateNewHouse() == true) {
			addHouseHouse();
		}
	}
	function validateNewHouse() { //v4.0
		var errors='';
		var strZip ='';
		var strEmail ='';
		var lenZip ='';
		var lenEmail ='';
	  		errors = errors + validateRequired("fldTmpHouseName","House Name");
	  		errors = errors + validateRequired("fldTmpHouseType","House Type");
	  		errors = errors + validateRequired("fldTmpAddress","Address 1");
	  		errors = errors + validateRequired("fldTmpCity","City");
	  		errors = errors + validateRequired("fldTmpState","State");
	  		errors = errors + validateRequired("fldTmpZip","Zip Code");
			strZip = document.getElementById("fldTmpZip").value;
			lenZip = strZip.length;

			if (lenZip !=0 && errors == "") {
			    errZip2 = "";
			    validateZipOnTable2(strZip);
				errors = errZip2;
			}
			
			
		
		
	  if (errors != '')  {
	  	alertX("Error(s) found <br />" +  errors);
		return false;
		} else { return true;}
	}

	function validateZipOnTable2(id) {
		var xmlhttp;
	
		if (window.XMLHttpRequest){
			  // code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		}
		else
		{// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
			{
     			var resp = parseInt(xmlhttp.responseText);
				if (resp == 0) {
					errZip2 = "Our services will soon be available in your area.";
				}
				else if (resp == -1) {
					errZip2 = "Invalid Zip Code.";
				}
				else {
					errZip2 = "";
				}
				
			}
	
		   }
			var param = ""
			param = "valZip.php?zip="  + id ;
			xmlhttp.open("GET",param, false);
			xmlhttp.send();
	}

	function addHouseHouse() {
		saveUpdates('newhouse');
		document.getElementById('new_house_tab').style.display='none';
		
		
	}
	
	function activateHouse(idx) {
		
		//showLoading();
		//document.getElementById("loading" + idx).style.display = "block";
		activateHouse2(idx);
		//hideLoading();
		
	}
	
	function deactivateHouse(idx, pRemove) {
		//document.getElementById("loading" + idx).style.display = "block";
		deactivateHouse2(idx, pRemove);
		//document.getElementById("loading" + idx).style.display = "none";
	
	}
	function activateHouse2(idx) {
		var hid = arrHouseList[idx][2];
		var hstatus = arrHouseList[idx][6].toUpperCase();
		var xmlhttp;
	
		if (window.XMLHttpRequest){
			  // code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		}
		else
		{// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
			{
     			var resp = parseInt(xmlhttp.responseText);
//				document.getElementById("loading" + idx).style.display = "none";
//				document.getElementById("loading" + idx).style.display = "none";

				if (resp == 0) {
					
					alertX("Please complete your house cleaning schedule, then activate this house again. ");
				}
			else {
					alertX("Your house has been activated!","","checkmark");
					getdata('houselist');loadData('houselist');display('tab_houselist',0);
				}
				
			}
	
		   }
			
//		    alert("ronald");
//			document.getElementById("loading" + idx).style.display = "block";
//		    alert("ronald");
			var param = ""
			param = "activateHouse.php?hid="  + hid  + "&status=" + hstatus+ "&process=ACTIVATE";
			//alert(param);
			xmlhttp.open("GET",param, false);
			xmlhttp.send();
	}
	
	function deactivateHouse2(idx, pRem) {
	
		var hid = arrHouseList[idx][2];
		var hstatus = arrHouseList[idx][6].toUpperCase();
		var xmlhttp;
	
		if (window.XMLHttpRequest){
			  // code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		}
		else
		{// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
			{
     			var resp = parseInt(xmlhttp.responseText);
				//document.getElementById("loading" + idx).style.display = "none";
				if (resp == 0) {
					alertX("Error occured during saving.");
				}
				else {
					alertX("Your house has been deactivated!","","checkmark");
					getdata('houselist');loadData('houselist');display('tab_houselist',0);
				
					
				}
			}
	
		   }
//		    alert("ronald");
//			document.getElementById("loading" + idx).style.display = "block";
//		    alert("ronald");
			var param = ""
			if(pRem=="remove"){
				param = "activateHouse.php?hid="  + hid  + "&status=" + hstatus + "&process=REMOVE";
			}else {
				param = "activateHouse.php?hid="  + hid  + "&status=" + hstatus + "&process=DEACTIVATE";
			}
			xmlhttp.open("GET",param, false);
			xmlhttp.send();
		
	}
	
	function viewSummary(idx) {
	
		
	}	
	
	function prepareCompute(ev) {
		var key;
		ev = ev || event;
		key = ev.keyCode;
		if (key == 13) {
			computeEstimate();
		}
	}
	

function getGiftTitles(id) {
	var xmlhttp;
	var JSONstring = new Object;
	var tmpOut = "";
	var tmpOut2 = "";
	if (window.XMLHttpRequest){
          // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			var response =  xmlhttp.responseText;
			var tempRecs = new Array();
			var tempRec = new Array();
			var a=0;
			tempRecs = response.split('|');
			arrGiftTitles.length = tempRecs.length;
			tmpOut='<ul>'; //begin menu
			var lastSub="";
			var lastMain="";
			for (a=1;a<tempRecs.length;a++) {
				arrGiftTitles[a] = new Array(5);
				//alert(tempRecs[a]);
				tempRec = tempRecs[a].split('^');
				arrGiftTitles[a][0] = tempRec[0];
				arrGiftTitles[a][1] = tempRec[1];
				arrGiftTitles[a][2] = tempRec[2];
				arrGiftTitles[a][3] = tempRec[3];
				arrGiftTitles[a][4] = tempRec[4];
				arrGiftTitles[a][5] = tempRec[5];

				if (lastMain != arrGiftTitles[a][1]) {  //begin main menu items
					if ( lastMain != "") {
	//					alert(a);
						// tmpOut += "</li>";
						tmpOut += "</ul>";
						tmpOut += "</li>";
						tmpOut += "</ul>";
						tmpOut += "</li>";
					}
					
					tmpOut += "<li>";
					tmpOut += "<a href=''>" + arrGiftTitles[a][1] + "</a>";
					tmpOut += "<ul>";
					
//					if (arrGiftTitles[a][1] == arrGiftTitles[a][2]) { //main and sub are the same
//						tmpOut += "<li>";
//						tmpOut += "<a href=''>" + arrGiftTitles[a][3] + "</a>";
//						tmpOut += "</li>";
//					} else {
						tmpOut += "<li>";
						tmpOut += "<a href=''>" + arrGiftTitles[a][2] + "</a>";
						tmpOut += "<ul>";
						tmpOut += "<li>";
						tmpOut += "<a onclick='getTitleImages(" + strDQ + arrGiftTitles[a][0] + strDQ + "," + strDQ  + tempRec[3] + strDQ + "," + strDQ  + tempRec[1] + strDQ + "," + strDQ  + tempRec[2] + strDQ + ");loadImages();' href=''>" + arrGiftTitles[a][3] + "</a>";
						tmpOut += "</li>";
//					}
				}
				else {
					if (lastSub != arrGiftTitles[a][2]) {
						tmpOut += "</ul>";
						tmpOut += "</li>";
						
						//tmpOut += "<ul name='1'>";

						tmpOut += "<li>";
						tmpOut += "<a href=''>" + arrGiftTitles[a][2] + "</a>";
						tmpOut += "<ul>";
						tmpOut += "<li>";
						tmpOut += "<a onclick='getTitleImages(" + strDQ + arrGiftTitles[a][0] + strDQ + "," + strDQ  + tempRec[3] + strDQ + "," + strDQ  + tempRec[1] + strDQ + "," + strDQ  + tempRec[2] + strDQ + ");loadImages();' href=''>" + arrGiftTitles[a][3] + "</a>";
						tmpOut += "</li>";
					} else {
						tmpOut += "<li>";
						tmpOut += "<a onclick='getTitleImages(" + strDQ + arrGiftTitles[a][0] + strDQ + "," + strDQ  + tempRec[3] + strDQ + "," + strDQ  + tempRec[1] + strDQ + "," + strDQ  + tempRec[2] + strDQ + ");loadImages();' href=''>" + arrGiftTitles[a][3] + "</a>";
						tmpOut += "</li>";
					}
				}

				
				lastMain = arrGiftTitles[a][1];
				lastSub = arrGiftTitles[a][2];
			}
			//tmpOut += "</li>";
			tmpOut += "</ul>";
			tmpOut += "</li>";
			tmpOut += '</ul>';
			//alert(tmpOut);
			//alert(document.getElementById('theme-menu').innerHTML);
 			document.getElementById('theme-menu').innerHTML = tmpOut;	  
			

 			//document.getElementById('sampleText').value = tmpOut;	  
			//alert(document.getElementById('theme-menu').innerHTML);
		}
	   
	}
			var param = ""
			param = "getGiftTitles.php?zip="  + id; 
			
			//alert(param);
			xmlhttp.open("GET",param,false);
			xmlhttp.send();
	
}
function getTitleImages(id,title,main,sub) {
	var xmlhttp;
	var JSONstring = new Object;
	var tmpOut = "";
	var tmpOut2 = "";
	
	
	if (window.XMLHttpRequest){
          // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			var response =  xmlhttp.responseText;
			//alert(response);
			var tempRecs = new Array();
			var tempRec = new Array();
			var a=0;
			tempRecs = response.split('|');
			arrTitleImages.length = tempRecs.length;
			tmpOut= "";
			for (a=1;a<tempRecs.length;a++) {
				arrTitleImages[a] = new Array(4);
				tempRec = tempRecs[a].split('^');
				arrTitleImages[a][0] = tempRec[0];
				arrTitleImages[a][1] = tempRec[1];
				arrTitleImages[a][2] = tempRec[2];
				arrTitleImages[a][3] = tempRec[3];
				arrTitleImages[a][4] = tempRec[4];
				//arrTitleImages[a][5] = tempRec[5];
				
				tmpOut += "<li>";
				tmpOut += "<a class='thumb' name='" + tempRec[0] +"' href='" + tempRec[3] + "' title='" + title + "'>";
				tmpOut += "<img src='" + tempRec[2] + "' alt='" + title + "' />"
				tmpOut += "</a>";
				tmpOut += "</li>";
			}
			
			//alert(document.getElementById('theme-menu').innerHTML);
			//alert(tmpOut);
 			document.getElementById('titleImages').innerHTML = tmpOut;
			
 			//document.getElementById('sampleText').value = tmpOut;	  
			//alert(document.getElementById('theme-menu').innerHTML);
		}
	   
	}
			//alert(main + sub);
			document.getElementById('page_breadcrumb').innerHTML = main + " &#187; " + sub + " &#187; <b>" + title + "</b>";
			var param = ""
			param = "getTitleImages.php?id="  + id; 
			//alert(param);
			xmlhttp.open("GET",param,false);
			xmlhttp.send();
}

function getFlowers(id) {
	var xmlhttp;
	var JSONstring = new Object;
	var tmpOut = "";
	var tmpOut2 = "";
	if (window.XMLHttpRequest){
          // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			var response =  xmlhttp.responseText;
			var tempRecs = new Array();
			var tempRec = new Array();
			var a=0;

			tempRecs = response.split("|");
			arrFlowers.length = tempRecs.length;
			
			tmpOut ="<h2>Premium Flowers</h2>";
			tmpOut +="<p>Choose premium flowers from the selection below</p>";
			tmpOut +='<div style="overflow:auto; height:300px; border:#CCCCCC 3px solid; border-radius: 5px;">';
			tmpOut +='<table cellpadding="0" cellspacing="0" border="0" width="550" >';
						

			var tmpOut1 ="";
			
			tmpOut1 +='<table cellpadding="0" cellspacing="0" border="0" width="530" >';

			//alert ('a');
			for (a=1;a<tempRecs.length;a++) {
				arrFlowers[a] = new Array(4);;
				tempRec = tempRecs[a].split("^");
				arrFlowersDict[tempRec[0]] = a;
				arrFlowers[a][0] = tempRec[0];
				arrFlowers[a][1] = tempRec[1];
				arrFlowers[a][2] = tempRec[2];
				arrFlowers[a][3] = tempRec[3];
				arrFlowers[a][4] = tempRec[4];
				
				tmpOut +='<tr id="sel_flower_' + tempRec[0] + '">';
				tmpOut +='<td width="70"><img src="' + tempRec[4] + '" height="64" width="64" style="border:1px solid #000" /></td>';
				tmpOut +='<td width="240">' + tempRec[1] + '</td>';
				tmpOut +='<td width="70"><h2>$' + tempRec[3] + '</h2></td>';
				tmpOut +='<td width="120">';
				tmpOut +='<input type="checkbox" id="chk_sel_flower_' + tempRec[0] + '" onclick="checkFlowerItem(' + strSQ + tempRec[0] + strSQ + ')" /> &nbsp;&nbsp;';
				tmpOut +='<input type="text" class="shortfield" style="width:30px;" id="fld_sel_flower_' + tempRec[0] + '" disabled="disabled" onkeypress="getItemAmt(' + strSQ + a + strSQ + ')" onblur="getItemAmt(' + strSQ + a + strSQ + ')" /> &nbsp;&nbsp;'+ tempRec[2] +'</td>';
				tmpOut +='<td with="60"><h2 id="amt_sel_'+ tempRec[0] +'"></h2></td></tr>'

				tmpOut1 +='<tr id="sum_flower_' + tempRec[0] + '" style="display:none;">';
				tmpOut1 +='<td width="70"><img src="' + tempRec[4] + '" height="64" width="64" style="border:1px solid #000" /></td>';
				tmpOut1 +='<td width="240"><span id="sum_flower_desc_'+ tempRec[0]+'">' + tempRec[1] + '</span></td>';
				tmpOut1 +='<td width="0"></td>';
				tmpOut1 +='<td width="0">';
				tmpOut1 +='<span id=sum_flower_tot_'+ tempRec[0] +'></span>';
				tmpOut1 +='<input type="checkbox" id="chk_sum_flower_' + tempRec[0] + '" style="display:none;" /> &nbsp;&nbsp;';
				tmpOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_flowerPRICE_' + tempRec[0] + '" value="' + tempRec[3] + '" disabled="disabled" style="display:none;"/>'
				tmpOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_flowerCTR_' + tempRec[0] + '" value="' + a + '" disabled="disabled" style="display:none;"/>'
				tmpOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_flowerID_' + tempRec[0] + '" value="' + tempRec[0] + '" disabled="disabled" style="display:none;"/>'
				tmpOut1 +='<input type="text" class="shortfield" style="width:30px;" id="fld_sum_flower_' + tempRec[0] + '" disabled="disabled" style="display:none;"/></td></tr>';

			}
			tmpOut +='</table></div>';
			tmpOut +='<a class="frmButtonBlue" onClick="displaySelectedFlowers('+ strSQ + 'GIFTS' + strSQ + '); document.getElementById(' + strSQ + 'divFlowerSelection' + strSQ + ').style.display=' + strSQ + 'none' + strSQ + '; document.getElementById(' + strSQ + 'mask_div' + strSQ + ').style.display = ' + strSQ + 'none' + strSQ + ';" title="Confirm Selection">Confirm</a>';
			tmpOut +='<a class="frmButtonBlue" onClick="document.getElementById(' + strSQ + 'divFlowerSelection' + strSQ + ').style.display=' + strSQ + 'none' + strSQ + '; document.getElementById(' + strSQ + 'mask_div' + strSQ + ').style.display = ' + strSQ + 'none' + strSQ + ';" title="Cancel Selection">Cancel</a>';
			
			
			
			tmpOut1 +='</table>';
			
			//alert(tmpModOut);
			document.getElementById("divFlowerSelection").innerHTML = tmpOut;
			document.getElementById("divFlowerSummary").innerHTML = tmpOut1;
			
			//document.getElementById("divModFlowerSelection").innerHTML = tmpModOut;
			//document.getElementById("divModFlowerSummary").innerHTML = tmpModOut1;
		}

	   }
		
	    var param = ""
			param = "getFlowers.php?zip=" + id;
//			alert(param);
			xmlhttp.open("GET",param,false);
			xmlhttp.send();
}


function getGiftPackages(id) {
	var xmlhttp;
	var JSONstring = new Object;
	var tmpOut = "";
	if (window.XMLHttpRequest){
          // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			var response =  xmlhttp.responseText;
			var tempRecs = new Array();
			var tempRec = new Array();
			var a=0;
			tempRecs = response.split('|');
			arrGiftPackages.length = tempRecs.length;
			tmpOut=''; //begin menu
			for (a=1;a<tempRecs.length;a++) {
				arrGiftPackages[a] = new Array(8);
				tempRec = tempRecs[a].split('^');
				arrGiftPackages[a][0] = tempRec[0]; //id
				arrGiftPackages[a][1] = tempRec[1]; //name
				arrGiftPackages[a][2] = tempRec[2]; //desc
				arrGiftPackages[a][3] = tempRec[3]; //jobdesc
				arrGiftPackages[a][4] = tempRec[4]; //price
				arrGiftPackages[a][5] = tempRec[5]; //imagepath
				arrGiftPackages[a][6] = tempRec[6]; //bestbuy 0 = bestbuy else regular
				arrGiftPackages[a][7] = tempRec[7]; //ribbon Image
				arrGiftPackages[a][8] = tempRec[8]; //season Image
				tmpOut += "<div id=" + strDQ + "pkg"  + a + strDQ + " class=" + strDQ + "item_package" + strDQ + "onclick="+ strDQ +"displayPkg('"+  a  +"');" + strDQ + " >" ;
				tmpOut += "<img src='" + tempRec[5] + "' class='item_image' />";
				if (tempRec[8] != "") {
					tmpOut += "<img id="  + strDQ + "season"  + a + strDQ +  " src='" + strSeasonPath + tempRec[8] + ".png' class='item_season_visible'/>";
				} 
				else {
					tmpOut += "<img id="  + strDQ + "season"  + a + strDQ +  " src='" + strSeasonIn + "' class='item_season_visible'/>";
				}
				if (tempRec[7] != "") {
					tmpOut += "<img id="  + strDQ + "ribbon"  + a + strDQ +  " src='" + strRibbonPath + tempRec[7] + ".png' class='item_ribbon_visible'/>";
				}
				if (tempRec[6] == "0") {
					tmpOut += "<img id="  + strDQ + "tag"  + a + strDQ +  " src='" + strBestBuyImage +"' class='item_tag_visible'/>";
				} 
				else {
					tmpOut += "<img id="  + strDQ + "tag"  + a + strDQ +  " src='" + strBestBuyImageIn +"' class='item_tag_visible'/>";
				}
				
				
				tmpOut += "</div>"
			}
			//alert(tmpOut);
			//alert(document.getElementById('theme-menu').innerHTML);
 			document.getElementById('package_img_container').innerHTML = tmpOut;	  
			displayPkg("1");
 			//document.getElementById('sampleText').value = tmpOut;	  
			//alert(document.getElementById('theme-menu').innerHTML);
		}
	   
	}
			var param = ""
			param = "getGiftPackages.php?zip="  + id; 
			//alert(param);
			xmlhttp.open("GET",param,false);
			xmlhttp.send();
	
}

function displayPkg(id) {

/*				<div id="package_desc_container">
					<div id="fldPkgAmt" style="">$99.99</div>
					<h3 id="fldPkgTitle">Cleaning Package sdfgsdgsd sdfgsdg sdffgsdg</h3>
					<h4>Description:</h4>
					<p id="fldPkgDesc">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam faucibus, neque nec venenatis pharetra, tellus purus vehicula lorem, sit amet pretium orci dolor non nisl. In eu neque metus, ultrices molestie neque. Integer posuere semper tellus, at viverra magna mattis sodales.</p>
				</div>			
*/
	pkgIndex = id;
	houseTypeAmt = arrGiftHouseType[document.getElementById('fldRecpHouseType').value][1];
	//alert(arrGiftHouseType[document.getElementById('fldRecpHouseType').value][0] + " : " + arrGiftHouseType[document.getElementById('fldRecpHouseType').value][1]);
	
	document.getElementById('fldPkgAmt').innerHTML = "$" + (parseFloat(arrGiftPackages[id][4]) + parseFloat(houseTypeAmt) ) ;
	
	document.getElementById('fldGiftTotal').innerHTML = "$" + (parseFloat(arrGiftPackages[id][4]) + parseFloat(houseTypeAmt) + parseFloat(totFlowersAmt) ) ; 
	
	document.getElementById('fldPkgTitle').innerHTML = arrGiftPackages[id][1];
	document.getElementById('fldPkgDesc').innerHTML = arrGiftPackages[id][2];
	for (var a=1; a<arrGiftPackages.length;a++) {
		document.getElementById('pkg' + a).className = "item_package";
	}
	document.getElementById('pkg' + id).className = "item_package_selected";
	
	selectedID = id;
		
}

function getGiftHouseType(id) {
	var xmlhttp;
	var JSONstring = new Object;
	var tmpOut = "";
	if (window.XMLHttpRequest){
          // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			var response =  xmlhttp.responseText;
			var tempRecs = new Array();
			var tempRec = new Array();
			var a=0;
			tempRecs = response.split('|');
			arrGiftHouseType.length = tempRecs.length;
			tmpOut=''; //begin menu
			for (a=1;a<tempRecs.length;a++) {
				arrGiftHouseType[a] = new Array(4);
				tempRec = tempRecs[a].split('^');
				arrGiftHouseType[a][0] = tempRec[0]; //id
				arrGiftHouseType[a][1] = tempRec[1]; //name
				arrGiftHouseType[a][2] = tempRec[2]; //desc
				arrGiftHouseType[a][3] = tempRec[3]; //jobdesc
				arrGiftHouseType[a][4] = tempRec[4]; //price
				tmpOut = tmpOut +  "<option value='" + a + "'>" + tempRec[0] + "</option>";
			}
			//alert(tmpOut);
			//alert(document.getElementById('theme-menu').innerHTML);
 			document.getElementById('fldRecpHouseType').innerHTML = tmpOut;	  
			displayPkg("1");
 			//document.getElementById('sampleText').value = tmpOut;	  
			//alert(document.getElementById('theme-menu').innerHTML);
		}
	   
	}
			var param = ""
			param = "getGiftHouseType.php?zip="  + id; 
			//alert(param);
			xmlhttp.open("GET",param,false);
			xmlhttp.send();
	
}

function displayCoupon(id) {
	document.getElementById(id).innerHTML = strCoupons;
}

function couponDetails(c) {
						
	/*
	0   $row['id']	 . "^" .
	1	$row['cType'] . "^" .
	2	$row['cCode'] . "^" .
	3	$row['cDesc'] . "^" .
	4	$row['cDollarValue'] . "^" .
	5	$row['dateClaimed'] . "^" .
	6	$row['validity'] . "^" .
	7	$row['combinable'] . "^" .
	8	$row['tansferable'] . "^" .
	9	$row['status'] . "^" .
	10	$row['regionID'] . "^" .
	11	$row['maxUsage'] . "^" .
	12	$row['remUsage'];
	13	$row['markTrans'];
	*/

	document.getElementById('fldCouponID').value =  c;
	document.getElementById('fldCouponCode').value = arrCoupon[c][2];
	document.getElementById('fldCouponDesc').value =  arrCoupon[c][1] + " - " + arrCoupon[c][3];
	document.getElementById('fldCouponValue').value =  arrCoupon[c][4];
	document.getElementById('fldCouponDateReceived').value =  arrCoupon[c][5];
	document.getElementById('fldCouponValidity').value =  arrCoupon[c][6];
	document.getElementById('fldCouponStatus').value =  arrCoupon[c][9];
	document.getElementById('fldCouponCombinable').value =  arrCoupon[c][7];
	document.getElementById('fldCouponTransferable').value =  arrCoupon[c][13];
	if (arrCoupon[c][8] == "Yes" && arrCoupon[c][9] != 'Pending' && arrCoupon[c][9] != 'Transferred') {
		document.getElementById('fldCouponTransferable').disabled = false;
		document.getElementById('btn_coupon_save').style.display = "inline";
	} 
	else {
		document.getElementById('fldCouponTransferable').disabled = true;
		document.getElementById('btn_coupon_save').style.display = "none";
	}
}


function paySched() {
	//alert('aaaaa');
	h = arrHouseList[document.getElementById('selHouseName').value][2];
	s = document.getElementById('fldReferenceNo').innerHTML;
	
	
	
	window.location = 'http://www.housewarmersinc.com/hw/cartsched.php?id='+h + '&s=' + s;
	//window.location = 'http://192.168.1.111/hw/cartsched.php?id='+h + '&s=' + s;
	//window.location = 'http://prescreenedmaids.biz/cartsched.php?id='+h + '&s=' + s;
}



