// Omniture and site code setup
var ctoMap = "Ratatouille";
var cid = "fr";

// find deeplink var
var str = unescape(window.location);
var strArray = str.split("#");
var deeplink = strArray[1];
if(deeplink == undefined){
	var deeplink = ""
}

// flash embed code
var flashvars = {
	'deeplink': deeplink,
	'cid': cid
};
var params = {
	'wmode' : 'opaque',
  	'scale' : 'showall',
	'menu' : 'false',
	'align' : 'middle',
	'quality': 'high',
	'bgcolor': '#ffffff',
	'allowScriptAccess': 'always',
	'allowFullScreen': 'false'
};
var attributes = {};
swfobject.embedSWF("main.swf", "flashcontent", "100%", "630", "9.0.115", "#ffffff", flashvars, params, attributes);      
   

function showDL(param){
	if(param != undefined && param != null && param != " "){
		window.location.hash = param;
	}
	else{
		window.location.hash = "";
	}
}

function simpleTrack(_tag,_folder){
	//alert('track called:'+_tag+':folder:'+_folder)
	if(_folder == null){
	_hbflash(_tag,'n','n','n');
		var googletrack = _tag;
	}else{
		_hbPageView(_tag, "/" +_folder);
		var googletrack = "/" +_folder + "/" + _tag;	
	}
		
	setTimeout("urchinTracker('" + googletrack + "')", 1000);
}

function doPopup (sUrl, nWidth, nHeight, sWindowName) {
	window.open(sUrl,sWindowName,'width=' + nWidth + ',height=' + nHeight + ',scrollbars=1,resizable=1');
}

function mailtoAndTrack (sID, sBody, sSubject) {
	
	// and the opening of the mail window
	document.location = "mailto:?body=" + sBody + "&subject=" + sSubject;
	simpleTrack(sID);
}

function popUpAndTrackNoBars(sID, sUrl, nWidth, nHeight, sWindowName) {
	window.open(sUrl,sWindowName,'width=' + nWidth + ',height=' + nHeight + ',scrollbars=0,resizable=0');
	setTimeout('simpleTrack(\''+sID+'\')',2000);
}

function popUpAndTrack (sID, sUrl, nWidth, nHeight, sWindowName) {

	doPopup(sUrl, nWidth ,nHeight , sWindowName);
	setTimeout('simpleTrack(\''+sID+'\')',2000);
}

function delayedTrack(_tag,_folder){
	setTimeout('simpleTrack("'+_tag+'","'+_folder+'")',2000);
}

function changeIframe(ns){
	//alert('changing iframe : '+ns);
	document.getElementById('convtrackingiframe').src = ns;//"conv_tracking/" + ns + ".html";
}
