// Flash JavaScript Document
//
//  external interface
//  popUps
//  cookies
//
//  note:
//  any change on this please 
//  inform to the Flash team
//*****************************//
//***************************************************************************************************
function flashPopUp(URL,winName,params){
	//**
	window.open(URL,winName,params);
	//**
};
function flashPopUpCentered(URL,winName,params,windowWidth,windowHeight){
	var centerWidth = (window.screen.width - windowWidth) / 2;
    var centerHeight = (window.screen.height - windowHeight) / 2;

	//**
	window.open(URL,winName,params + ',left=' + centerWidth + ',top=' + centerHeight);
	//**
};
//***************************************************************************************************
var swfId;
function getID(swfID) {
	//****
	if (navigator.appName.indexOf("Microsoft") > -1) {
		//**
		path = window.getElementsByName(swfID);
	} else {
		//**
		path = document.getElementsByName(swfID);
	}
	//**
	swfId = path[0]
};
// this will call the sendData event back in Flash
function sendData(sParams){
	//**
	swfId.javaFunction (sParams);
	//**
};
// this is the function being called from Flash
function callFromFlash(params){
	//**
	oData = document.getElementById(params.div).innerHTML;
	aca = new String(oData); 
	//
	return aca
	//
	/*var divId = params.div;
	var divAttributes = (params.attributes != undefined)? params.attributes:0;
	var oData = new Array();
	oData[0] = params.fn
	oData[1] = document.getElementById(divId).innerHTML
	if (divAttributes.length >= 1){
		for(var i=0;i<divAttributes.length;i++){
			oData.push(document.getElementById(divId).getAttribute(divAttributes[i]));
		}
	};
	sendData(oData);*/
};
//*************************************************************************************************** .toGMTString()
function setCookie(name,values){
	//
	d = new Date();
	d.setUTCFullYear(d.getUTCFullYear() + 1);
	//
	document.cookie = name+ "=" + escape(values) + ";expires="+ d
	//
	
} 

function getCookie(name)
{
  
  cookie = " " + document.cookie;
  offset = cookie.indexOf(" "+name+"=");

  if (offset == -1) return undefined;

  offset += name.length+2;
  end = cookie.indexOf(";", offset)

  if (end == -1) end = cookie.length;
  
  return unescape(cookie.substring(offset, end));
	
}
//*************************************************************************************************** DEBUG AREA
function checkOn(){
	//
	debug = "You are conected";
	return debug
	//
} 
//***************************************************************************************************
