/*--------------------------------------------------------------------------
 *
 *  JavaScript Functions
 *
/*--------------------------------------------------------------------------*/




/*
<div id="flashcontent1">insert content for non flash users</div>
<script type="text/javascript">
   var so = new SWFObject("folder/flashfile.swf", "flash1", "468", "60", "8");
   so.addParam("wmode", "transparent");
   so.write("flashcontent1");
</script>
<script type="text/javascript">
	//swfobject.embedSWF("_img/flash/gallery.swf", "photostack", "400", "260", "8",SWF_EXPRESSINSTALL_URL,false,SWF_PARAMS);    
</script>
*/

// oceanhotels "UA-2855585-1"
// longislandresort.com.au "UA-2855585-17"
// clubcroc.com.au "UA-2855585-7"
// ferntreerainforestlodge.com.au "UA-2855585-3"
var gs_google_analytics 		= "UA-2855585-3";

var SWF_VERSION					= 1.5;
var SWF_EXPRESSINSTALL_URL 		= "/_img/flash/expressInstall.swf";
var SWF_FLASH_VARS_PHOTOSTACK	= {filename: "_img/flash/gallery.xml"+swfNoCache()};
var SWF_PARAMS					= { wmode: "transparent",
				  					menu: "false"};
function swfNoCache(){
	return "?nocache="+new Date().getTime();
}

function insertPhotostack(sGalleryUrl){
	if(SWF_VERSION==2){
		lsFlashVars = {filename: sGalleryUrl+swfNoCache()};
	} else {
		lsFlashVars = sGalleryUrl+swfNoCache();
	}
	insertFlash("/_img/flash/gallery.swf","photostack",400,260,lsFlashVars,SWF_PARAMS,6);
	//insertFlash("/_img/flash/gallery.swf"+swfNoCache(),"photostack",400,260,lsFlashVars,SWF_PARAMS,6);
}


function insertFlash(sFlashUrl, sDiv, nWidth, nHeight, sFlashVars, sFlashParams, nFlashVersion){
	if(SWF_VERSION==2){
		swfobject.embedSWF(sFlashUrl, sDiv, String(nWidth), String(nHeight), String(nFlashVersion), SWF_EXPRESSINSTALL_URL, sFlashVars, sFlashParams);    
	} else {
		var so = new SWFObject(sFlashUrl, "flash", String(nWidth), String(nHeight), String(nFlashVersion));
		so.addParam("wmode", "transparent");
		if(sFlashVars!=false){
			so.addVariable("filename", sFlashVars);
		}
		so.write(sDiv);	
	}
		
}

	//swfobject.embedSWF("_img/flash/gallery.swf", "photostack", "400", "260", "8","expressInstall.swf",false,swfParams);    

// ************* NEW WINDOW *************
// This is used for opening a link in a new window (since we cant use target="_blank" in xhtml)
function jump(sLocation) {
	window.open(sLocation, '_blank');
}


function writeE(sUser,sDomain) {
	if(sDomain==undefined){sDomain='oceanhotels'};
	e =(sUser + '@' + sDomain + '.com.au');
	document.write('<a href="mailto:' + e + '">' + e + '</a>');
}


function openPhoto(sURL,sWindowName,w,h) {
	oWin = window.open(sURL, sWindowName, 'toolbar=0, location=0, directories=0, status=0, menubar=no, scrollbars=yes, resizable=yes, width='+w+', height='+h);
	oWin.focus();
}


Array.prototype.has=function(v){
	for (var i=0; i<this.length; i++){
		if (this[i]==v) return true;
	}
	return false;
} 


