var popupw
var popCal2
var Reservation

function pop2(theURL, width, height) {

	if(Reservation == null || Reservation.closed) {
		Reservation = window.open(theURL, "popup", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,width=" + width + ",height=" + height + ",top=25,left=50");
	} else {
		Reservation.close()
		Reservation = window.open(theURL, "popup", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,width=" + width + ",height=" + height + ",top=25,left=50");
	}
}

function popwin(theURL, width, height) {

	if(popupw == null || popupw.closed) {
		popupw = window.open(theURL, "popup", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,width=" + width + ",height=" + height + ",top=25,left=25");
	} else {
		popupw.close()
		popupw = window.open(theURL, "popup", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,width=" + width + ",height=" + height + ",top=25,left=25");
	}
}

function smit_cus()
{
//pop2('/newsletter/adduser.asp',410,250)
document.mainform2.submit()
}

function search_area()
{
//pop('http://tahiti-tourisme.com/planner/agentselection.asp',800,500)
document.form4.submit()
}

function start_booking()
{
//pop('http://tahiti-tourisme.com/planner/agentselection.asp',800,500)
document.mainform.submit()
}

function openDate(pname, d_field, d_form)
{


curr_date=document[d_form][d_field].value
popwinCal2(pname+'?fname='+d_field+'&foname='+d_form+'&nocache=&curr_date='+curr_date, 300, 300)
}

function popwinCal2(theURL, width, height) {

	if(popCal2 == null || popCal2.closed) {
		popCal2 = window.open(theURL, "popup3", "scrollbars=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,width=" + width + ",height=" + height + ",top=0,left=0");
	} else {
		popCal2.close()
		popCal2 = window.open(theURL, "popup3", "scrollbars=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,width=" + width + ",height=" + height + ",top=0,left=0");
	}
}


