function swfInterface(f, p) {
	
	eval(f + '(' + p + ')');
	
}

function reload() {
	
	window.location.reload();
	
}
	
function refreshLoc(langs, lang){
	
	var langHash = window.location.hash;
	langHash = langHash.split("/");
	langHash = langHash[1];
	
	if (window.location.hash == "") {
		window.location = '#/' + lang + "/";
	} else if (!isLanguageValid(langs, langHash)) {
		window.location = '#/' + lang + "/";
	} // if
	
}

function onUrlChange(url) {
	
	closeShadowBox();
	closeIFrame(false);
	
}

function goHome() {
	
	Shadowbox.close();
	sendToFlash("iframe_closed");
	
}

function thisMovie(movieName) {
	
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document[movieName];
	} // if
	
}

function sendToFlash(value) {
	
	thisMovie("website").sendToActionScript(value);
	
}

function openIFrame(url){
	
	ifrm = document.createElement("IFRAME");
	ifrm.setAttribute("src", url);
	ifrm.setAttribute("id", "iframe");
	ifrm.setAttribute("frameborder", "0");
	ifrm.style.background = "transparent";
	ifrm.style.backgroundColor = "transparent";
	document.body.appendChild(ifrm);
	ifrm.style.display = "none";
	
	var t = setTimeout("delayIFrame('iframe')", 500);
	
	hideWebsite();
	
}

function delayIFrame(ifrm){
	
	var ifrm = document.getElementById(ifrm);
	ifrm.style.display = "block";
	
	
	var ifrm_close = document.getElementById('ifrm_close');
	ifrm_close.style.display = "block";
	
}

function closeIFrame(fromBtn){
	
	var elem = document.getElementById('iframe');
	if (elem) {
		document.body.removeChild(elem);
	}

	var elem = document.getElementById('ifrm_close');
	elem.style.display = "none";
	
	showWebsite();
	
	if (fromBtn) {
		sendToFlash("iframe_closed");
	}
	
}

function showWebsite(){
	
	var elem = document.getElementById('website');
	//elem.style.display = "block";
	//elem.style.visibility = "visible";
	
}

function hideWebsite(){
	
	var elem = document.getElementById('website');
	//elem.style.display = "none";
	//elem.style.visibility = "hidden";

}

function openShadowBox(url, w, h) {
	
	// open the Shadowbox
	Shadowbox.open({
		content:    url,
		player:     "iframe",
		title:      "",
		width:      w,
		height:     h
	});
}

function closeShadowBox() {
	// close the Shadowbox
	Shadowbox.close();
}

function refreshUserArea() {
	
	sendToFlash("refresh_user_area");
	
}

// Bridge
var randomNum = Math.round(Math.random()*1000000);
var idConn = "id_" + randomNum;
function getIdConn() {
	return idConn;
}


