var ua        = navigator.userAgent.toLowerCase(); 
var is_pc_ie  = ( (ua.indexOf('msie') != -1 ) && ( ua.indexOf('win') != -1 ) && ( ua.indexOf('opera') == -1 ) && ( ua.indexOf('webtv') == -1 ) );


function setFlashVariables(movieid, flashquery){
	var i,values;
	if(is_pc_ie){
		var chunk = flashquery.split("&");
		for(i in chunk){
			values = chunk[i].split("=");
			document["brand42"].SetVariable(values[0],values[1]);
		}
	}else{
		var divcontainer = "flash_setvariables_"+movieid;
		if(!document.getElementById(divcontainer)){

			var divholder = document.createElement("div");
			divholder.id = divcontainer;
			document.body.appendChild(divholder);
		}
		document.getElementById(divcontainer).innerHTML = "";
		var divinfo = "<embed src='gateway.swf' FlashVars='lc="+movieid+"&fq="+escape(flashquery)+"' width='0' height='0' type='application/x-shockwave-flash'></embed>";
		document.getElementById(divcontainer).innerHTML = divinfo;
	}
}

function newWindow(url,name,parameters){

var newWin = window.open(url,name,parameters);

}

function newSize(datoX,datoY) {
	if(document.all && !document.getElementById) {
 		document.all['brand42'].style.pixelWidth = datoX;
 		document.all['brand42'].style.pixelHeight = datoY;
	}else{
		document.getElementById('brand42').style.width = datoX;
		document.getElementById('brand42').style.height = datoY;
	}
}
function loadmac(backnum){
var browsertype = window.navigator.appName;
var windowxsize =window.innerWidth || document.body.offsetWidth;
var windowysize =window.innerHeight || document.body.offsetHeight;

setFlashVariables('flashcontent.brand42','windowxsize='+windowxsize+'&windowysize='+windowysize+'&browsertype='+browsertype+'&backvar='+backnum);
}