function ajaxFunction(content_id, output, parent)
{			
	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(output)
    {
    	if(xmlHttp.readyState==4)
       	{
			response = xmlHttp.responseText;			
			document.getElementById("content").innerHTML = xmlHttp.responseText;
			evalScript( response );
        }
    }
	
	url = "content.php";
	url = url+"?content_id="+content_id+"&output="+output+"&parent="+parent;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
}


function flashFunction(movie, div, width, height, subdir, clicked)
{
/*
	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;
	*/
	
	//document.getElementById("main").appendChild(flashcontainer);
	writeflash(movie, div, width, height, subdir, clicked);
}

function writeflash(movie, div, width, height, subdir, clicked)
{
	var so = new SWFObject("swf/"+movie, movie, width, height, "8");
	so.addVariable("subdir", subdir);
	so.addVariable("clicked", clicked);
	//alert(vars);
	//so.addParam("wmode", "transparent");	
	document.getElementById(div).innerHTML = "";	
	so.write(div);
}

/*
*	function effectBG
*	
*	action: apply a tween effect to div[image, background]
*	params: div
*	var Tween is an object of class tween.js
*/
function effectBG(div)
{
	switch(div)
	{
		case 'image':	
		var bg = new Tween(document.getElementById(div).style,'left',Tween.elasticEaseOut,160,0,6,'px');
		bg.start();
		break;
		
		case 'background':
		var bg = new Tween(document.getElementById(div).style,'left',Tween.lineair,-200,-60,10,'px');
		var opac = new OpacityTween(document.getElementById(div).style,'left',Tween.regularEaseOut,60,100,5);
		bg.start();
		opac.start();
		break;
	}
}

/*
*	function evalScripts
*	
*	action: execute javascript after an Ajax call
*	params: scripts
*/
function evalScript(scripts)
{	try
	{	if(scripts != '')	
		{	var script = "";
			scripts = scripts.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function(){
	       	                         if (scripts !== null) script += arguments[1] + '\n';
 	        	                        return '';});
			if(script) (window.execScript) ? window.execScript(script) : window.setTimeout(script, 0);
		}
		return false;
	}
	catch(e)
	{	alert(e)
	}
}

/*
*
*	Function SWFDelegate
*
*	call lightbox from flash
*	params: url, width, height, capiton, clicked
*	
*/
function SWFDelegate(url,width,height,caption, clicked) 
{
   var objLink = document.createElement('a');
   objLink.setAttribute('href',url);
   objLink.setAttribute('rel','lightbox');
   objLink.setAttribute('title',caption);
   if(typeof width != 'undefined') 
   {
      objLink.setAttribute('width',width);
   }
   if(typeof height != 'undefined') 
   {
      objLink.setAttribute('height',height);
   }
   objLink.setAttribute('clicked',clicked);
   Lightbox.prototype.start(objLink);
}

/*
*	function paginate
*	
*	action: move div to posX
*	params: xPos, div
*/
function paginate(xPos, div)
{	
	div = document.getElementById(div);
	div.style.left = -xPos+"px";
}

/*
*	function divEffect
*	
*	action: apply an effect to a div
*	params: targetDiv, effect, value
*/
function divEffect(targetDiv, effect, value)
{
	var obj = document.getElementById(targetDiv);
	obj.style.opacity = Number(value)/100;

	obj.filter = "alpha(opacity=" + Number(value) + ")";
	//obj.filters[0].opacity = Number(value);
	//alert(value +"-"+effect);
}

/*
*	function sfHover
*	
*	action: set dropdown menu
*	required for lightbox in IE	
*/
sfHover = function() 
{
	var sfEls = document.getElementById("nav").getElementsByTagName("li");

	for (var i=0; i<sfEls.length; i++) 
	{
		sfEls[i].onmouseover=function() 
		{
			this.className+=" ie_does_hover";
		}
		sfEls[i].onmouseout=function() 
		{
			this.className=this.className.replace(new RegExp(" ie_does_hover\\b"), "");
		}
	}
}


if (window.attachEvent) window.attachEvent("onload", sfHover);