// apply class to body if flash available this will be used to reduce flicker
var version = swfobject.getFlashPlayerVersion();
	if(version.major >= 8)
		$(document.body).addClassName('has-flash');


// domloaded event
Event.observe(document, 'dom:loaded', function(){
	var flashvars = {
		serverUrl: 'http://www.hyatt.com/HICBooking?',
		sitepath: '/hyatt/resorts/hawaii/swf/home/site.swf',
		imagepath: '/hyatt/resorts/hawaii/swf/home/images/green_leaf_bg_01.jpg',
		flvpath: '/hyatt/resorts/hawaii/swf/home/flv/background.flv'
	};
	swfobject.embedSWF('/hyatt/resorts/hawaii/swf/home/shell.swf', 'flash-container', '100%', '100%', '8.0.0', false, flashvars);
	swffit.fit("flash-container", 1010, 933);
});


// track a page view in omniture
function trackPageView(pageName){
	// the flash will pass in a unique page name
	
	// set up you s object (refer to manual for details)
	// s.pageName = pageName;
	
	// track the page view
	// s.t();


	var str = pageName.split(":");
	
	var nstr = str[1]+":"+str[2]+":"+str[3]+":"+str[4];
	
	if (str[5]){
		
		nstr= nstr+":"+str[5];
	}

	s_pageName = nstr;

	s.pageName=s_pageName;
	s.server=s_server;
	s.channel="";
	s.pageType="";
	s.prop1=s_prop1;
	s.prop2=s_prop2;
	s.prop3=s_prop3;
	s.prop4=s_prop4;
	s.prop5=s_prop5;
	s.prop6=s_prop6;
	s.prop7=s_prop7;
	s.prop8=s_prop8;

	s.campaign=s_campaign;
	s.state=s_state;
	s.zip=s_zip;
	s.events=s_events;
	s.products=s_products;
	s.purchaseID=s_purchaseID;
	s.eVar1=s_eVar1;
	s.eVar2=s_eVar2;
	s.eVar3=s_eVar3;
	s.eVar4=s_eVar4;
	s.eVar5=s_eVar5;
	s.eVar6=s_eVar6;
	s.eVar7=s_eVar7;
	s.eVar8=s_eVar8;
	s.eVar9=s_eVar9;
	s.eVar10=s_eVar10;
	s.eVar11=s_eVar11;
	s.eVar12=s_eVar12;
	s.eVar13=s_eVar13;
	s.eVar14=s_eVar14;
	s.eVar15=s_eVar15;

	void(s.t());




	
}

// track the video and brochure links in omniture
function trackDownload(assetURL){
	// the flash will pass in the url of the file being clicked

	// for the brochure track the link as a download like below (refer to omniture manual for details)
	// sc.tl(assetURL, 'd');
	
	// for the video track it as an external link
	// sc.tl(assetURL, 'e');
	
	// redirect the browser window to the url
	// window.location = assetURL
	
	// debug alert

	var splitURL = assetURL.split('.');
	



	if (splitURL[1] == 'pdf') {
		s.tl(this,'d',window.location.protocol+"//"+window.location.host+assetURL);
		window.location = assetURL;
				
	} else if (splitURL[1] == 'akamai') {
		
	//	sc.tl(assetURL, 'e');
		s.tl(this,'e',assetURL);
		window.location = assetURL;
		
	}
	
	

	
}
