function openWindow(myLink,windowName)
{
	if(! window.focus)return;
	var myWin=window.open("",windowName,"height=350,width=316,dependent=yes,scrollbars=yes");
	myWin.focus();
	myLink.target=windowName;
}

function openMapWindow(myLink,windowName,w,h)
{
	if(! window.focus)return;
	var myWin=window.open(myLink,windowName,"height="+h+",width="+w+",dependent=yes,scrollbars=no");
	myWin.focus();
}
function setroomtype(roomtype)
{
	form   = document.checkavail.preferred;
	lenght = form.options.length
	for(i=0;i<lenght;i++)
	{
	if(form.options[i].value == roomtype){break;}
	}
	form.selectedIndex = i;
}
function OpenNewWindow(http)
{
	window.open(http, 'emailform', 'width=640,height=400,resisable=yes,scrollbars=yes');
}

function viewhbwrk(portal)
{
	window.open('https://www.awd.ws/howbookingswork.php?portal='+portal,'HowBookingsWork','toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=400');
}

function viewpolicy(portal)
{
	window.open('https://www.awd.ws/termsandconditions.php?portal='+portal,'TermsAndConditions','toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=400');
}

function BrowseMap(ListingID,Map,X,Y)
{
	var mymap = window.open('http://www.bangkok.com/view_map.php?ListingID='+ListingID+'&Map='+Map+'&X='+X+'&Y='+Y,'','status=yes,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600');
	mymap.focus();
}
