// JavaScript Document
		function ajaxload(pagehandler, loaddiv)
		{
      		// Set up Ajax request variable
    		try {xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");}  catch (e) { alert("Error: Could not load page.");}


    		//Send Ajax Request
    		xmlhttp.onreadystatechange = function(){
               //Check page is completed and there were no problems.
               if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
                      //What to do once the form is submitted - to inform the user.
                      document.getElementById(loaddiv).innerHTML = xmlhttp.responseText;
					  if(pagehandler.match('projectcontent.php') != ''){
						  	var searchElement = document.getElementById("projectcontent");
							var scripts = searchElement.getElementsByTagName('script');
							for (var i=0;i<scripts.length;i++) {
								eval(scripts[i].innerHTML);
							}
							//alert(videoName);
							loadvid(videoName);
			   		  }
               }
    		}
    		//Make connection
    		xmlhttp.open("POST", pagehandler);
    		//Set Headers
    		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    		//Send data
    		xmlhttp.send(null);
    		//stops form from submitting normally
    		return false;
		}
		
	   function loadvid(vidname){
  var so = new SWFObject('player.swf','mpl','400','320','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','videos/' + vidname +'&autostart=false');
  so.write('mediaspace');
	   }
