var popupw
var popCal2
var Reservation

function makeRemoteMap(url,name)
{	remote2 = window.open(url,name,"left=130,top=120,width=600,height=450,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
	remote2.location.href = url;
	if (remote2.opener == null)
		remote2.opener = window;
}

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 popwin_nosc(theURL, width, height) {

	if(popupw == null || popupw.closed) {
		popupw = window.open(theURL, "popup", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,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=no,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");
	}
}

/****
* Banner Ad Rotater v3.02
* Anarchos > anarchos3@hotmail.com
* http://anarchos.xs.mw/bannerad.phtml
**/

function Banner(refreshTime, width, height, altText, start, random){
	this.objName = "bannerAd" + (Banner.count++);
	eval(this.objName + "=this");
	if (!refreshTime) this.refreshTime = 5000; else this.refreshTime = refreshTime*1000;
	if (!width) this.width = 460; else this.width = width;
	if (!height) this.height = 68; else this.height = height;
	if (random == null) this.random = 1; else this.random = random;
	this.altText = altText;
	this.ads = [];
	if (start) this.currentAd = start-1; else start = null;
	this.mySize = 0;

	this.Ad = function(src, href, target, mouseover) {
		var tempImage = new Image();
		tempImage.src = src;
		this.ads[this.mySize] = new Object();
		var ad = this.ads[this.mySize];
		ad.src = src;
		if (typeof(target) == "undefined" || target == null) ad.target = "_self"; else ad.target = target;
		ad.href = href;
		ad.mouseover = mouseover;
		this.mySize++;
	}

	this.link = function(){
		var	ad = this.ads[this.currentAd];
		if (ad.target == "_self"){
			location.href = ad.href;
		}
		else if (ad.target == "_blank" || ad.target == "_new"){
			open(ad.href,this.objName + "Win");
		}
		else top.frames[ad.target].location.href = ad.href;
	}

	this.showStatus = function(){
		var ad = this.ads[this.currentAd];
		if (ad.mouseover) status = ad.mouseover;
		else status = ad.href;
	}

	this.randomAd = function(){
		var n;
		do { n = Math.floor(Math.random() * (this.mySize)); } 
		while(n == this.currentAd);
		this.currentAd = n;
	}

	this.output = function(){
		var tempCode = "";
		if (this.mySize > 1){
			if (this.currentAd == null) this.randomAd();
			if (this.currentAd >= this.mySize) this.currentAd = this.mySize - 1;
			tempCode = '<a href="javascript:'+this.objName+'.link();"';
			tempCode += ' onMouseOver="' + this.objName + '.showStatus(); return true"';
			tempCode += ' onMouseOut="status=\'\';return true">';
			tempCode += '<img src="' + this.ads[this.currentAd].src + '" width="' + this.width;
			tempCode += '" name="' + this.objName + 'Img" height="' + this.height + '" ';
			if (this.altText) tempCode += 'alt="'+this.altText + '" ';
			tempCode += 'border="0" /></a>';
			document.write(tempCode);
			this.nextAd();
		} else document.write("Error: two banners must be defined for the script to work.");
	}

	this.newAd = function(){
		if (!this.random){	
			this.currentAd++;
			if (this.currentAd >= this.mySize)
			   this.currentAd = 0;
		}
		else {
			this.randomAd();
		}
		this.nextAd();
	}

	this.nextAd = function(){
		document.images[this.objName+ 'Img'].src = this.ads[this.currentAd].src;
		setTimeout(this.objName+'.newAd()',this.refreshTime)
	}
}
Banner.count = 0;

function open_info(id) {
	document.getElementById('region_' + id).style.display = 'block';
	document.getElementById('link1_' + id).style.display = 'none';
	
}

function close_info(id) {
	document.getElementById('region_' + id).style.display = 'none';
	document.getElementById('link1_' + id).style.display = 'block';
}





	function showhide(targetID) {
		//change target element mode
		var elementmode = document.getElementById(targetID).style;
		elementmode.display = (!elementmode.display) ? 'none' : '';
	}

	function changetext(changee,oldText,newText) {
		//changes text in source element
		var elementToChange = document.getElementById(changee);
		elementToChange.innerHTML = (elementToChange.innerHTML == oldText) ? newText : oldText;
	}

	function workforchange(targetID,sourceID,oldContent,newContent) {
		showhide(targetID);
		changetext(sourceID,oldContent,newContent);
	}

