function _remove(id)
{
	var r = document.getElementById(id);
	document.body.removeChild(r);
}

function _loadFile(file)
{
	var url= "http://www.portakabin.fr/" + file + ".php";
	var ihtml = "";
	
	if(document.getElementById('express'))
	{
		_remove('express')	
	}

	var newDiv = document.createElement("div");
	newDiv.id="express";
	
	ihtml  = "<div class=\"framer\"><div class=\"top-bar\"><a href=\"#\"><img src=\"/images/close-button.gif\" alt=\"Click to close\" border=\"0\" onclick=\"_remove('express')\" /></a></div>";
	ihtml += "<iframe height=\"480\" align=\"top\" width=\"420\" src=\"";
	ihtml += url;
	ihtml += "\" frameborder=\"0\" scrolling=\"no\"></iframe>";	
	ihtml += "</div><div class=\"shadow\"></div>";
	
	newDiv.innerHTML = ihtml;
	document.body.appendChild(newDiv);
	
}


function _SendPageToFriend(file,pname)
{
        var url= "http://www.portakabin.fr/" + file + ".php?pname="+pname;
        var ihtml = "";

        if(document.getElementById('express'))
        {
                _remove('express')
        }

        var newDiv = document.createElement("div");
        newDiv.id="express";

        ihtml  = "<div class=\"framer\"><div class=\"top-bar\"><a href=\"#\"><img src=\"/images/close-button.gif\" alt=\"Click to close\" border=\"0\" onclick=\"_remove('express')\" /></a></div>";
        ihtml += "<iframe height=\"480\" align=\"top\" width=\"420\" src=\"";
        ihtml += url;
        ihtml += "\" frameborder=\"0\" scrolling=\"no\"></iframe>";
        ihtml += "</div><div class=\"shadow\"></div>";

        newDiv.innerHTML = ihtml;
        document.body.appendChild(newDiv);

}



function GetXmlHttpObject()
{
	 var objXmlHttp=null
	if ((navigator.userAgent.indexOf("Opera")>=0) || (navigator.userAgent.indexOf("Mozilla")>=0))
	{
		objXmlHttp=new XMLHttpRequest()
		return objXmlHttp
		
	}
	if (navigator.userAgent.indexOf("MSIE")>=0)
	{
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
			strName="Microsoft.XMLHTTP"
		} 
		try
		{ 
			objXmlHttp=new ActiveXObject(strName)
			return objXmlHttp
		} 
		catch(e)
		{ 
			alert("Error. Scripting for ActiveX might be disabled") 
			return 
		} 
	}
}

