/*
   Provide the XMLHttpRequest constructor for IE 5.x-6.x:
   Other browsers (including IE 7.x-8.x) do not redefine
   XMLHttpRequest if it already exists.
 
   This example is based on findings at:
   http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx
*/
if (typeof XMLHttpRequest == "undefined")
  XMLHttpRequest = function () {
    try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); }
      catch (e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); }
      catch (e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP"); }
      catch (e) {}
    //Microsoft.XMLHTTP points to Msxml2.XMLHTTP.3.0 and is redundant
    throw new Error("This browser does not support XMLHttpRequest.");
  };

/*
 För "MP DÄR DU BOR"
*/
function toLocation(href) {
  if (href) {
    document.location=href;
  }
}

/*
 För Facebook-import, asyncron och fin.
*/
var xmlHttp;
function handleRequestStateChange() {
  // continue if the process is completed
  if (xmlHttp.readyState == 4) {
    // continue only if HTTP status is "OK"
    if (xmlHttp.status == 200) {
      // retrieve the response
      html = xmlHttp.responseText;

      var fbfeed=document.getElementById("fb_feed");
      fbfeed.innerHTML=html;
    }
  }
}
function insertFbFeed() {
  xmlHttp=new XMLHttpRequest();
  xmlHttp.open("GET","/fbfeed.html",true);
  xmlHttp.onreadystatechange = handleRequestStateChange;
  xmlHttp.send(null);
}

/* Spelare för webbfilm, Locomotiv */
	var flashvars = {
		xmlpath:"spelare/",
		imagepath:"spelare/",
		linkpath:"http://www.mp.se/politik",
	   ga_id:"UA-11623175-1"
  	};
		
	var params = {  
		bgcolor: "#000",
		allowScriptAccess:"always",
		allowFullScreen:"true",
		wmode:"transparent"
	};
	
	var attributes = {  
		id:"film"
	};
	
	swfobject.embedSWF("spelare/FlashMoviePlayer.swf", "film", "728px", "400px", "9.0.28", null, flashvars, params, attributes);


