function HTTP() {
 var xmlhttp
 /*@cc_on @*/
 /*@if (@_jscript_version >= 5)
   try {
   xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
  } catch (e) {
   try {
     xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
   } catch (E) {
    xmlhttp=false
   }
  }
 @else
  xmlhttp=false
 @end @*/
 if (!xmlhttp) {
  try {
   xmlhttp = new XMLHttpRequest();
  } catch (e) {
   xmlhttp=false
  }
 }
 return xmlhttp
}

function getURL(url,fn) { 
  var xmlhttp=new HTTP();
  if (xmlhttp) {
    xmlhttp.open("GET",url,true);
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4) {
         fn({status:xmlhttp.status,content:xmlhttp.responseText, contentType:xmlhttp.getResponseHeader("Content-Type")})
      }
    }
    xmlhttp.send()
  } else {
   //Some Appropriate Fallback...
   fn( "error", "error pas de httpreq" );
  }
}

function setFlashWidth(divid, newW){
	document.getElementById(divid).style.width = newW+"px";
}
function setFlashHeight(divid, newH){
	document.getElementById(divid).style.height = newH+"px";				
}

function setFlashContentFromUrl(divid, url){
	function whenLoaded() {
		newContent = arguments[1]; 
		document.getElementById(divid).innerHTML = newContent;		
	}
	getURL( url, whenLoaded );	
}
function setFlashContent(divid, newContent){
	document.getElementById(divid).innerHTML = newContent;
	//setFlashContentFromUrl( divid, 'hammam.html' );	
}

function setFlashSize(divid, newW, newH){
	setFlashWidth(divid, newW);
	setFlashHeight(divid, newH);
}
function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}



