var deviceAndroid = "android";
//**************************
// Detects if the current device is an Android OS-based device.
function DetectAndroid()
{
   if (uagent.search(deviceAndroid) > -1)
	  return true;
   else
	  return false;
}

var deviceIphone = "iphone";
var deviceIpod = "ipod";
//Initialize our user agent string to lower case.
var uagent = navigator.userAgent.toLowerCase();
//**************************
// Detects if the current device is an iPhone or iPod Touch.
function DetectIphoneOrIpod()
{
	if (DetectIphone())
	   return true;
	else if (DetectIpod())
	   return true;
	else
	   return false;
}
//redirects
if (DetectIphoneOrIpod() || DetectAndroid()) {
	window.location = "mobile";
}
var params = {
	quality: "high",
	scale: "noscale",
	wmode: "window",
	allowscriptaccess: "always",
	allowfullscreen: "true",
	bgcolor: "#000000"
};
var flashvars = {
};
var attributes = {
	id: "flashcontent",
	name: "flashcontent"
};
var embedHandler = function (e){
	//If embed fails
	if(e.success){
		function createcssfile(filename){
		  var fileref=document.createElement("link");
		  fileref.setAttribute("rel", "stylesheet");
		  fileref.setAttribute("type", "text/css");
		  fileref.setAttribute("href", filename);
		 return fileref;
		}
		function replacecssfile(oldfilename, newfilename, filetype){
		 var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist using
		 var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for
		 var allsuspects=document.getElementsByTagName(targetelement);
		 for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove
		  if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(oldfilename)!=-1){
		   var newelement=createcssfile(newfilename);
		   allsuspects[i].parentNode.replaceChild(newelement, allsuspects[i]);
		  }
		 }
		}
		replacecssfile("svart.css", "flashsvart.css", "css"); //Replace all occurences "oldstyle.css" with "newstyle.css"		
		swffit.fit("flashcontent",900,730)
	}
};		
swfobject.embedSWF("npn.swf", "flashcontent", "100%", "100%", "9", "", flashvars, params, attributes, embedHandler);
