if(typeof epoch == "undefined"){
	
var riVars = "";
var myDate = new Date;
var unixTimeStamp = myDate.getTime();
var epoch = "&epoch="+unixTimeStamp;

function riTestFlash(version){
	
	if (navigator.userAgent.indexOf("MSIE") != -1 && navigator.appVersion.indexOf("Win") != -1) { 
		document.write('<script type="text/vbscript">');
		document.write('on error resume next \n');
		document.write('flashCan'+version+' = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+version+'")))\n');
		document.write('If flashCan'+version+' = True Then \n');
		document.write('canPlay = true \n');
		document.write('Else \n');
		document.write('canPlay = false \n');
		document.write('End If');
		document.write('</script>');
		var flashCanPlay = canPlay;
	}else{
		flash = navigator.plugins["Shockwave Flash"];
		if(flash){
			words = flash.description.split(" ");
			if(Number(words[2]) >= version){
				var flashCanPlay = true;
			}else{
				var flashCanPlay = false;
			}
		}else{
			var flashCanPlay = false;
		}
	}
	return flashCanPlay;
}

var overAllTest = riTestFlash(8);

function putSWF(file,width,height,playerVersion,altMode,altContent,flashVars,cssID,wmode,bgColour){
	if(riTestFlash(playerVersion)){
		var domain = "&domain="+document.domain+"&location="+escape(document.location);
		if(wmode != "transparent"){
			wmode = "opaque";
			//allowFullScreen = "false";
		}//else{
			allowFullScreen = "true";
		//}
		var idVars = "&cssID=ri_"+cssID;
		
		
		
		if (location.search != "" && riVars == ""){
			var x = location.search.substr(1).split("&");
			for (var i=0; i < x.length; i++){
				if(x[i].indexOf("ri_") == 0){
					riVars += "&" + x[i];
				}
				
			}
		}
		
		var wmodeVars = "&wmode="+wmode;
		var sizeVars = "&stageWidth="+width+"&stageHeight="+height;
		flashVars = flashVars + "&allowFullScreen="+allowFullScreen + domain + epoch + idVars + riVars + wmodeVars + sizeVars;
		
		
		if((navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Mac") != -1)){
			file += "?"+flashVars; /*this allows Mac IE to see flash vars. Mac IE can't read flash Vars it needs to attach them to the swf in the form of file.swf?flashVars */
		}
		document.write('<div>');
		document.write('<a name="ri_'+cssID+'"></a>');
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="'+cssID+'" width="'+width+'" height="'+height+'">'); 
		document.write('<param name="movie" value="'+file+'" />'); 
		document.write('<param name="FlashVars" value="'+flashVars+'" />'); 
		document.write('<param name="wmode" value="'+wmode+'" />');
		document.write('<param name="bgcolor" value="'+bgColour+'" />');
		document.write('<param name="allowFullScreen" value="'+allowFullScreen+'" />');
		document.write('<param name="allowScriptAccess" value="always" />');
		
		document.write('<embed src="'+file+'" width="'+width+'" height="'+height+'" allowFullScreen="'+allowFullScreen+'" allowScriptAccess="always" wmode="'+wmode+'" type="application/x-shockwave-flash" flashvars="'+flashVars+'" id="'+cssID+'" name="'+cssID+'" bgcolor="'+bgColour+'" swliveconnect=true />');
		document.write('</object>');
		document.write('</div>');
		
	}else{

		if (altMode == "image"){
			//get domain to grab image from
			var altContentDomain_array = altContent.split("/");
			if(altContentDomain_array[0] == ".."){//it was a relative array, so just use /
				var altContentDomain = "";
			}else if(altContentDomain_array[0] != "http" || altContentDomain_array[0] == "https"){//not url found, use default
				var altContentDomain = "http://www.resorts-interactive.com";
			}else{
				var altContentDomain = altContentDomain_array[0]+"//"+altContentDomain_array[2];
			}
			
			altTitle="To view this content you need a more recent version of the Adobe Flash Player. Click here to download from Adobe.com";
			document.write('<a href="http://get.adobe.com/flashplayer/" target="_blank" title="'+altTitle+'"><img src="'+altContentDomain+'/getFlash.php?width='+width+'&height='+height+'" alt="'+altTitle+'" /></a>'); 
		}else if(altMode == "html"){ 
			document.write(altContent);
		}else if(altMode == "redirect"){
			window.location = altContent;
		}
	}
}


var mouseX = 0;
var mouseY = 0;
var playerWidth = 0;
var playerHeight = 0;

function riOpenLink(link){
	var link_array = link.split("#");
	var epochDate = new Date();
	var epoch = epochDate.getTime();
	
	var newLink = link_array[0]+"&epoch="+epoch+"#"+link_array[1];
	
	window.location = newLink;
}



function getMousePos(e) {

	/*if( typeof( window.pageYOffset ) == 'number' ) {
		scrollX = window.pageXOffset;
		scrollY = window.pageYOffset;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrollX = document.documentElement.scrollLeft;
		scrollY = document.documentElement.scrollTop;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrollX = document.body.scrollLeft;
		scrollY = document.body.scrollTop;
	}*/
			
	var ie = (document.all)?true:false;
	if(ie){
	   mouseX = event.clientX + document.documentElement.scrollLeft;
	   mouseY = event.clientY + document.documentElement.scrollTop;
	}else{
	   mouseX = e.pageX;
	   mouseY = e.pageY;
	}
   
	
	
	
	
}

var RIie = (document.all)?true:false;
if(!RIie) {
	document.captureEvents(Event.MOUSEMOVE);
}

document.onmousedown = getMousePos;



function popSWF(file,width,height,playerVersion,altMode,altContent,flashVars,cssID,wmode,bgColour){
	playerWidth = width;
	playerHeight = height;
	if (mouseX < (playerWidth/2)) { mouseX = (playerWidth/2);}
	if (mouseY < (playerHeight/2)) { mouseY = (playerHeight/2);}
	
	
	var playerDiv = document.createElement("div");
	playerDiv.id = cssID;
	
	playerDiv.style.position = "absolute";
	playerDiv.style.left = (mouseX-(width/2))+"px";
	playerDiv.style.top = (mouseY-(height/2))+"px";

	playerDiv.style.zIndex = "10000";
	
	var html = "";
	
	
	if(overAllTest){
		
		var domain = "&domain="+document.domain+"&location="+escape(document.location);
		//if(wmode != "transparent"){
		//	wmode = "opaque";
		//}
		wmode = "transparent";
		allowFullScreen = "true";
	
		var idVars = "&cssID=ri_"+cssID;

		if (location.search != "" && riVars == ""){
			var x = location.search.substr(1).split("&");
			for (var i=0; i < x.length; i++){
				if(x[i].indexOf("ri_") == 0){
					riVars += "&" + x[i];
				}
				
			}
		}
		
		var wmodeVars = "&wmode="+wmode;
		var popSWFVars = "&popSWFItem=1";
		var cssVars = "&cssID="+cssID;
		flashVars = flashVars + "&allowFullScreen="+allowFullScreen + domain + epoch + idVars + riVars + wmodeVars + popSWFVars + cssVars;
		
		
		if((navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Mac") != -1)){
			file += "?"+flashVars; /*this allows Mac IE to see flash vars. Mac IE can't read flash Vars it needs to attach them to the swf in the form of file.swf?flashVars */
		}
		html += '<div>';
		html += '<a name="ri_'+cssID+'"></a>';
		html +='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'">'; 
		html +='<param name="movie" value="'+file+'" />'; 
		html +='<param name="FlashVars" value="'+flashVars+'" />'; 
		html +='<param name="wmode" value="'+wmode+'" />';
		html +='<param name="bgcolor" value="'+bgColour+'" />';
		html +='<param name="allowFullScreen" value="'+allowFullScreen+'" />';
		html +='<param name="allowScriptAccess" value="always" />';
		
		html +='<embed src="'+file+'" width="'+width+'" height="'+height+'" allowFullScreen="'+allowFullScreen+'" allowScriptAccess="always" wmode="'+wmode+'" type="application/x-shockwave-flash" flashvars="'+flashVars+'" bgcolor="'+bgColour+'" />';
		html +='</object>';
		html +='</div>';
		
	}else{
		playerDiv.style.backgroundColor = "#FFFFFF";
		
		
		if (altMode == "image"){
			altTitle="You need a more recent version of the Adobe Flash Player";
			html += '<a href="http://www.adobe.com/go/getflashplayer" target="_blank" title="'+altTitle+'"><img src='+altContent+' alt="'+altTitle+'" /></a>'; 
		}else if(altMode == "html"){ 
			html += altContent;
		}else if(altMode == "redirect"){
			window.location = altContent;
		}
	}
	
	
	
	playerDiv.innerHTML = html;
	document.body.appendChild(playerDiv);
	
	
}


function insertSWFinto(file,width,height,playerVersion,altMode,altContent,flashVars,cssID,wmode,bgColour,insertID){
	playerDiv = document.getElementById(insertID);
	
	var html = "";
	
	
	if(overAllTest){
		
		var domain = "&domain="+document.domain+"&location="+escape(document.location);
		//if(wmode != "transparent"){
		//	wmode = "opaque";
		//}
		wmode = "transparent";
		allowFullScreen = "true";
	
		var idVars = "&cssID=ri_"+cssID;

		if (location.search != "" && riVars == ""){
			var x = location.search.substr(1).split("&");
			for (var i=0; i < x.length; i++){
				if(x[i].indexOf("ri_") == 0){
					riVars += "&" + x[i];
				}
				
			}
		}
		
		var wmodeVars = "&wmode="+wmode;
		var cssVars = "&cssID="+cssID;
		flashVars = flashVars + "&allowFullScreen="+allowFullScreen + domain + epoch + idVars + riVars + wmodeVars + cssVars;
		
		
		if((navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Mac") != -1)){
			file += "?"+flashVars; /*this allows Mac IE to see flash vars. Mac IE can't read flash Vars it needs to attach them to the swf in the form of file.swf?flashVars */
		}
		html += '<div>';
		html += '<a name="ri_'+cssID+'"></a>';
		html +='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'">'; 
		html +='<param name="movie" value="'+file+'" />'; 
		html +='<param name="FlashVars" value="'+flashVars+'" />'; 
		html +='<param name="wmode" value="'+wmode+'" />';
		html +='<param name="bgcolor" value="'+bgColour+'" />';
		html +='<param name="allowFullScreen" value="'+allowFullScreen+'" />';
		html +='<param name="allowScriptAccess" value="always" />';
		
		html +='<embed src="'+file+'" width="'+width+'" height="'+height+'" allowFullScreen="'+allowFullScreen+'" allowScriptAccess="always" wmode="'+wmode+'" type="application/x-shockwave-flash" flashvars="'+flashVars+'" bgcolor="'+bgColour+'" />';
		html +='</object>';
		html +='</div>';
		
	}else{
		
		
		
		if (altMode == "image"){
			altTitle="You need a more recent version of the Adobe Flash Player";
			html += '<a href="http://www.adobe.com/go/getflashplayer" target="_blank" title="'+altTitle+'"><img src='+altContent+' alt="'+altTitle+'" /></a>'; 
		}else if(altMode == "html"){ 
			html += altContent;
		}else if(altMode == "redirect"){
			window.location = altContent;
		}
	}
	
	
	
	playerDiv.innerHTML = html;
}


function closePopSWF(cssID){
	document.body.removeChild(document.getElementById(cssID));
}



}
