var xmlhttp;
var url;
var timeInterval;

function loadComponent(name)
{
   var comp = name.substring(0,name.indexOf("."));
   url = "html/components/"+comp+"/"+name;
   document.getElementById('content').innerHTML="Loading ...";
  
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  xmlhttp.onreadystatechange= stateChange;
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
    if (xmlhttp)
    {
    xmlhttp.onreadystatechange=stateChange
    xmlhttp.open("GET",url,true)
    xmlhttp.send()
    }
  }
  
  	
}

function stateChange()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
  {
		  
		  // if "OK"
		  if (xmlhttp.status==200)
		  {
		  	document.getElementById('content').innerHTML=xmlhttp.responseText;
		  	IE = navigator.appName=="Microsoft Internet Explorer";
		  	if(window.XMLHttpRequest){
		  		//changeScroll();
		  	}
		  }
		  else
		  {
		  alert("Problem retrieving data:" + xmlhttp.statusText)
		  }
  }

}

function callPage(url) {
  loadComponent(url);
}

function callMenu() {
  flashProxy.call("openItem","framework");
}

function showImage(imgsrc,w,h){

		
		
		if(w < 640){
			document.getElementById('imageContent').style.width = '484px';
			document.getElementById('imageContent').style.height = '666px';
		}
		else{
			document.getElementById('imageContent').style.width = '644px';
			document.getElementById('imageContent').style.height = '506px';
		}
		
		
		document.getElementById('imageContent').style.display = "block";
		document.getElementById('imageSrc').innerHTML = '<img src="files/images/original/' + imgsrc + '"  />';
	
}

function closeImage(){

		document.getElementById('imageContent').style.display = "none";
	
}

function changeScroll(){
			
			CSBfleXcroll('gallery');
			CSBfleXcroll('description');
			
}
		

