var text2fill;
var vid2load;
function ajaxSwitch(ajaxa,ajaxb,mov2play)
{
	textSwitch(ajaxa);
	videoSwitch(ajaxb);
	playThis(mov2play);
}
    function playThis(data){
    SetMovie(data);
    var player = new StartPlayer_0();
	}
function textSwitch(texturl)
{
text2fill=null;
if (window.XMLHttpRequest)
  {// code for Firefox, Opera, IE7, etc.
  text2fill=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE6, IE5
  text2fill=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (text2fill!=null)
  {
  text2fill.onreadystatechange=state_Change_text;
  text2fill.open("GET",texturl,true);
  text2fill.send(null);
  }
else
  {
  alert("Your browser does not support XMLHTTP.");
  }
}

function state_Change_text()
{
if (text2fill.readyState==4)
  {// 4 = "loaded"
  if (text2fill.status==200)
    {// 200 = "OK"
    document.getElementById('detailsboxcontainer').innerHTML=text2fill.responseText;
    }
  else
    {
    alert("Error: " + text2fill.statusText + "?");
    }
  }
}
function videoSwitch(vidurl)
{
vid2load=null;
if (window.XMLHttpRequest)
  {// code for Firefox, Opera, IE7, etc.
  vid2load=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE6, IE5
  vid2load=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (vid2load!=null)
  {
  vid2load.onreadystatechange=state_Change_video;
  vid2load.open("GET",vidurl,false);
  vid2load.send(null);
  }
else
  {
  alert("Your browser does not support XMLHTTP.");
  }
}

function state_Change_video()
{
if (vid2load.readyState==4)
  {// 4 = "loaded"
  if (vid2load.status==200)
    {// 200 = "OK"
    document.getElementById('videocontainer').innerHTML=vid2load.responseText;
	playThis();
    }
  else
    {
    alert("Error:" + vid2load.statusText + "!");
    }
  }
}
