/**
	Siteasy v1.0 <http://flashopen.net/tutorials/swfobject/>
	Copyright (c) 2009 Carlos Guerra Amaral
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/

/*
 Tested in PCWin with 
				FireFox 3.0.11 
				Netscape 8.1 
				Flock 1.2.6 
				Safari 3.2.1 
				IExplorer 8.0.6001 ......oeps!
				Opera 10
*/
	var useragent = navigator.userAgent.toLowerCase();
	var movie_name = "flashopen";
	var myurl = unescape(window.location.href);
	var sendlink;
	var urlindex;
	var screen_diff;
	
	var thetitle = "Flashopen - RIA Centrum voor Flash applicaties, training voor Designers, Tilburg";
	//
	// ----------------------------------------------------------------------- set
	//
	setInterval("get_url()",50);
	//
	// --------------------------------------------------- Received from Flash
	//
	function set_url(n){
		if(myurl.indexOf("#") >= 0){
			myurl = myurl.substring(0,(myurl.lastIndexOf("#")+1))+"/"+n;
		}else{
			myurl = window.location.href+"#/"+n;
		}
		window.location.href = unescape(myurl);
		set_title(n);
	}
	//
	// ------------------------------------------------ Browser buttons (Back-Further)
	//
	function get_url(){
		index = unescape(window.location.href);
		if(index != myurl){
			sendlink = index.substr((index.lastIndexOf("#")+2));
			thisMovie(movie_name).goHome(sendlink);
			myurl = index;
			set_title(sendlink);
		}
	}
	//
	// --------------------------------- Movie name
	//
	function thisMovie(movieName) {
		if (navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName]
		}else {
			return document[movieName]
		}
	}
	//
	// ---------------------------- Title
	//
	function set_title(n){
		thisMovie(movie_name).title = thetitle+" "+n;
	}
	//
	//----------------------- get Height
	//
	function get_height(n){
		screen_diff = n-window.innerHeight;
		
		if(screen_diff > 0){
			screen_diff = window.innerHeight+screen_diff+35
		}else{
			screen_diff = window.innerHeight - 1;
		}
		set_height(screen_diff);
	}
	//
	//------------------------- set Height
	//
	function set_height(n){
		thisMovie(movie_name).style.height = n;
	}
	//
	// -------------------------------------------- Popup
	//
	function abrePopUp(n,w,h){
		var screenwidth = window.screen.width/2-w/2;
		var screenheight = 0;//window.screen.height/2-620/2;
		window.open(n, 'win', 'width='+w+',height='+h+'top='+screenheight+',left='+screenwidth+',scrollbars=no,toolbar=no,menubar=no,status=no,location=no,resizable=no');
	}
	//
