// Lightwindow
function activateLightWindow(url){
	if (navigator.appVersion.indexOf("Mac")!=-1){	
		myLightWindow.activateWindow({
			href: url, 
			width: 371, 
			height: 155,
			form: 'sendRequest',
			type: 'external'
		});
	}else{
		myLightWindow.activateWindow({
			href: url, 
			width: 371, 
			height: 155,
			form: 'sendRequest',
			type: 'external'
		});			
	}
}

// Dynamic Font Sizing
function setTextRegular() 
{ 
  newSize = document.getElementById("bodyContent");
  newSize.className = "textRegular"; 

} 
function setTextLarge() 
{ 
  newSize = document.getElementById("bodyContent");
  newSize.className = "textLarge"; 
} 
function setTextLarger() 
{ 
  newSize = document.getElementById("bodyContent");
  newSize.className = "textLarger"; 
} 

// News Functionality
function get_article(content_id)
	{

		if(document.getElementById(content_id).style.display=='none')
		{
			xmlHttp=GetXmlHttpObject();
			if (xmlHttp==null)
			  {
			  alert ("Votre navigateur pourrait avoir de la difficult&eacute; &agrave; soutenir AJAX. Veuillez activer JavaScript et rafra&icirc;chir la page.");
			  return;
			  }
			//var cat=document.getElementById('cat_select').options[document.getElementById('cat_select').selectedIndex].text;
			//alert(cat);
			document.getElementById(content_id).style.display = 'block'
			document.getElementById(content_id).innerHTML = '<img src="images/loader.gif" style="padding:5px 0 10px 60px;" />';
			var url="news_get_detail.php";
			url=url+"?content_id="+content_id;
			url=url+"&sid="+Math.random();
			//xmlHttp.onreadystatechange=stateChanged;

			xmlHttp.onreadystatechange=function(){
	     		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
				{
	            	//show_content(content_id);
					document.getElementById(content_id).innerHTML=xmlHttp.responseText;

	        	}
	        }

			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
		}
		else
			show_content(content_id);


	}
function stateChanged(x)
	{
		if (xmlHttp.readyState==4)
		{
		//alert('cc');
		document.getElementById('section_container').innerHTML=xmlHttp.responseText;
		//show_content(section_id);
		}
	}

function GetXmlHttpObject()
{
	  var xmlHttp; 
	  try 
	  { 
		xmlHttp = new XMLHttpRequest(); 
	  } 
	  catch(e) 
	  { 
		var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0", 
										"MSXML2.XMLHTTP.5.0", 
										"MSXML2.XMLHTTP.4.0", 
										"MSXML2.XMLHTTP.3.0", 
										"MSXML2.XMLHTTP", 
										"Microsoft.XMLHTTP"); 
		for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++)  
		{ 
		  try  
		  {  
			xmlHttp = new ActiveXObject(XmlHttpVersions[i]); 
		  }  
		  catch (e) {}
		} 
	  } 
	  if (!xmlHttp) 
		displayError("Error creating the XMLHttpRequest object."); 
	  else  
		return xmlHttp; 
} 
function show_content(id)
	{

		if(document.getElementById(id).style.display=='none')
			document.getElementById(id).style.display='block';
		else
			document.getElementById(id).style.display='none';

}
