function callmyrequest(searchid)
{
	xajax_searchhoteluserrequest(searchid);
}
function showeticket()
{
	document.getElementById('eticket').className = "show";
}
function hideeticket()
{
	document.getElementById('eticket').className = "hide";
}

function printdiv(divname)
{
	 
		var PrintValue = document.getElementById(divname).innerHTML;
		var WinPrint = window.open('',''); 
 		WinPrint.document.write(PrintValue);
		WinPrint.document.close();
		WinPrint.focus();
		WinPrint.print();
 
}
function bidagain()
{
	
	document.getElementById('ayprresult').className = "hide";
	document.getElementById('ayprdiv').className = "show";
	
}

function createroom(roomcount)
{
	//alert(roomcount);
	valueselect = '';
	if(roomcount>1)
	{
		for(i=1;i<roomcount;i++)
		{
			valueselect = valueselect + "<table width='100%'  border='0' cellspacing='0' cellpadding='0'>"+
      				"<tr> <td width='20%' class='content'>Room "+(i+1)+"</td>"+
					"<td width='40%' height='25'>"+
					   "<select class='content'   name='noofadults"+i+"' id='noofadults"+i+"' onChange='javascript:adjustoccupency(this.value,\"childcountcid"+i+"\","+i+");'>"+
						 "<option name='adult1' id='adult1' value='1'>1</option>"+
						 "<option name='adult2' id='room2' value='2'>2</option>"+
						 "<option name='adult3' id='adult3' value='3'>3</option>"+
						 "<option name='adult4' id='adult4' value='4'>4</option>"+
					 "</select></td>"+
					 "<td width='40%'>"+
					 "<span id='childcountcid"+i+"'>"+
					   "<select class='content'  name='noofchildren"+i+"' id='noofchildren"+i+"'>"+
						 "<option value='0'>0</option>"+
						 "<option value='1'>1</option>"+
						 "<option value='2'>2</option>"+
						 "<option value='3'>3</option>"+
					 "</select></span>"+
					 "</td></tr></table> " ;
				   
		}
		document.getElementById('oneselect').innerHTML = valueselect;
	}
	else
	{
		document.getElementById('oneselect').innerHTML = "";
	}
}

function adjustoccupency(childcount,divname,idval)
{
	standvalue = 5;
	valueset = '';
	checkvalue = parseInt(standvalue)-parseInt(childcount);
	valueset = valueset+ "<select class='content'  name='noofchildren"+idval+"' id='noofchildren"+idval+"'>";
	for(j=0;j<checkvalue;j++)
	{
		valueset = valueset+ "<option value='"+j+"'>"+j+"</option>";
	}
	valueset = valueset+ "</select>";
	document.getElementById(divname).innerHTML = valueset;					 
}

function valuefare(a,b) 
{
	a = parseInt(a[1]);
	b = parseInt(b[1]);
	return a == b ? 0 : (a < b ? -1 : 1);
}
var storevalue = new Array();
var hotelsort = true;
function storehotelarray()
{
	//alert(getvalue('hoteltotalcount'));
	count  = getvalue('hoteltotalcount');
	storevalue = new Array(count);
	for(i=0;i<count;i++)
	{
		storevalue[i] = new Array(2);
		storevalue[i][1] = getvalue('lowfare_'+i);
		storevalue[i][0] = getinner('hoteldiv_'+i)
	}
}
function sorthote()
{
		if(hotelsort == true)
		{
			//document.getElementById("fareimage").src = "../images/"+downimage;
			storevalue.sort(valuefare);
			putinner('sortbyfare','Sort by fare Descending')
			hotelsort = false;
		}
		else
		{
			storevalue.reverse(valuefare);
			//document.getElementById("fareimage").src = "../images/"+upimage;
			putinner('sortbyfare','Sort by fare Ascending')
			hotelsort = true;
		}
		count  = getvalue('hoteltotalcount');
		for(i=0;i<count;i++)
		{
			document.getElementById('hoteldiv_'+i).innerHTML = storevalue[i][0];
		}
}