// JavaScript Document
/*convert an URL to an SWFaddress*/

//get entire URL
var new_url = document.location.href;
//get domain name
var newdomain = document.domain;
//get '#' from URL
var index = new_url.substring(new_url.lastIndexOf('#')+1);
//place '#' in URL
var flash_url = "/#/";

	//check if '#' exists in URL
	if(index == document.location.href){
	//check for right flash version, combined with file 'flash_detect.js'
	if(FlashDetect.majorAtLeast(9)){
		 //split url at '/'
		 var url_var = new_url.split("/");
		 //loop array
		 for(i=3; i<url_var.length; i++){
			//check if url contain vars '?id' etc.
			if(url_var[i].charAt(0) != '?'){
			flash_url += url_var[i] + "/";
			}
		 }
		 //check if URL doesn't end with double slash '//'
		 if(flash_url.charAt(flash_url.length-1) == "/" && flash_url.charAt(flash_url.length-2) == "/"){
			flash_url = flash_url.replace("//", "/");
		 }
		 //make new URL
		 var url = "http://" + newdomain + flash_url;
		 //go to te right URL
		 this.location.href = url;
		 //alert ("new url is: " + url + " \n\n");
	}
 }