// JavaScript Document

function ajaxFunction(var1)
  {
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
	xmlHttp.onreadystatechange=function(var1)
    {
    	if(xmlHttp.readyState==4)
       {
			with(document.getElementById("contentdiv").style)
			{
				position = 'absolute';
				width = '680px';
				height = '400px';		
				left =  '80px';
				top = '165px';
			}
		    document.getElementById("contentdiv").innerHTML = xmlHttp.responseText;

        }
      }
	  url = "content.php";
	  url = url+"?content_id="+var1;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
    }

function flashFunction(subdir, movie)
{
/*
	document.getElementById("content").innerHTML = "";
	if(document.getElementById("flashdiv"))
	{
		document.getElementById("flashdiv").innerHTML = "";
	}
	var flashcontainer = document.createElement("div");
	flashcontainer.setAttribute('id','flashdiv');
	var object = flashcontainer.style;
	*/
	with(document.getElementById("contentdiv").style)
	{
		width = '760px';
		height = '560px';		
		left =  50;
		top = 100;
	}
	
	//document.getElementById("main").appendChild(flashcontainer);
	writeflash(subdir, movie);
}

function writeflash(subdir, movie)
{	
	var so = new SWFObject(movie+".swf", movie, "760px", "540px", "8");
	so.addVariable("maindir", subdir);
	so.addParam("wmode", "transparent");
	so.write('contentdiv');
}
	

