//------------------------------------
// MAIN VARIABLES
//------------------------------------

var SWFID; // Variabile contenitore per l'oggetto flash.
var homeCode = "cin";
var obj = new Object;

var hash_ = location.hash;

var first = true; 

//------------------------------------
// Funzioni per il get del'oggetto flash
//------------------------------------

function checkObj () {
	// alert("youTubeLoader.js : checkObj");
	if (SWFID) {
		createObj();
		return true;
	} else{
		alert("zerodo: In order to call methods within a swf, you must first set the variable \"SWFID\"!");
		return false;
	}
}

function createObj () {
	// alert("youTubeLoader.js : createObj");
	obj = document.getElementById(SWFID);
}

//------------------------------------
// Funzioni per il next ed il back del brayser
//------------------------------------
function zeroinit () {
	Hash.init(checkURL, document.getElementById('hidden-iframe'));
	//Hash.go(homeCode);
	first = false;
}	
//setInterval(checkURL, 100);




function navigSwf(a, b){
	if (checkObj()) {
		obj.NavigSwf(a, b);
	}
}

function NavigHtm(a) {
		//top.location.hash = a;
		Hash.go(a);
}


function checkURL(newHash, initial){
	if ((location.hash != hash_) && (!(first))){
		 if (hash_ == ""){hash_ = homeCode;};
		 navigSwf(hash_, location.hash);
		 hash_ = location.hash;
	} else {
		first = false;
		}
}

