function phpads_deliverActiveX(content)
{
	document.write(content);	
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



// ** bug fix for netscape ver 4
// ** reloads the window if Nav4 resized

function MM_reloadPage(init) {  
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);



// ** name the opener window
// ** place in link 'onclick'  or <script language="JavaScript">thisWindowName('gomaison');</script>

function thisWindowName(name) {  
	if (document.images)
  	self.name = name;
}


// ** Shared function for opening a pop up window
//Use: <a href="file.htm" onclick="popWin(this.href,'popupwin','530','500','center','no','no','no','no','no','no','no');return false" onfocus="this.blur()">Demande de Garantie rénovation en français</a>


var win=null;
function popWin(url,popname,w,h,pos,scrl,loc,dir,sts,mb,tbr,rsz){
	if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrl+',location='+loc+',directories='+dir+',status='+sts+',menubar='+mb+',toolbar='+tbr+',resizable='+rsz+'';
	win=window.open(url,popname,settings);
}

// ** navigation Buton


function btn_back(num)
{
document.write('<form>');
document.write('<input type=button value="Retour" onClick="history.go(');
document.write(num);
document.write(');">');
document.write('</form>');
}


function btn_close()
{
document.write('<form>');
document.write('<input type=button value="Fermer" onClick="javascript:setTimeout(window.close, 100);">');
document.write('</form>');
}


/* hide Email */
function writeEmail(eName, eServer)
{
emailname = eName
emailserver = eServer

document.write("<a href='mailto:" + emailname + "@" + emailserver + "'>");
document.write(emailname + "@" + emailserver);
document.write("</a>");
}


/* hide Email */
function writeEmail2(eName, eServer, name)
{
emailname = eName
emailserver = eServer

document.write("<a href='mailto:" + emailname + "@" + emailserver + "'>");
document.write(name);
document.write("</a>");
}


function Homepage(){

	DocURL=document.location.href;
	protocolIndex=DocURL.indexOf("://",4);
	
	serverIndex=DocURL.indexOf("/",protocolIndex + 3);

	BeginURL=DocURL.indexOf("#",1) + 1;
	urlresult=DocURL.substring(BeginURL,serverIndex);
	if (protocolIndex - BeginURL > 7)
		urlresult=""
		
	displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);

	forbiddenChars = new RegExp("[<>\'\"]", "g");	// Global search/replace
	urlresult = urlresult.replace(forbiddenChars, "");
	displayresult = displayresult.replace(forbiddenChars, "");

	document.write('<A target=_top HREF="' + urlresult + '">' + displayresult + "</a>");
}

function IE_CorrectAlpha_PNG(){
for(i=0; i<document.images.length; i++){
img    = document.images[i];
imgExt  = img.src.substring(img.src.length-3, img.src.length);
imgExt  = imgExt.toUpperCase();
if (imgExt == "PNG"){
imgID    = (img.id) ? "id='" + img.id + "' " : "";
imgClass= (img.className) ? "class='" + img.className + "' " : "";
imgTitle= (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
imgStyle= "display:inline-block;" + img.style.cssText;
if (img.align == "left") { imgStyle = "float:left;"  + imgStyle; } else if (img.align == "right"){ imgStyle = "float:right;" + imgStyle; }
if (img.parentElement.href)   { imgStyle = "cursor:hand;" + imgStyle; }       
strNewHTML    = '<span '+imgID+imgClass+imgTitle+' style="width:'+img.width+'px; height:'+img.height+'px;'+imgStyle+';'+'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+img.src+'\', sizingMethod=\'scale\');"></span>';
img.outerHTML = strNewHTML;
i = i-1;
}}}

if (window.addEventListener) {  //DOM method for binding an event
	window.addEventListener("load", IE_CorrectAlpha_PNG, false);
}else if (window.attachEvent){   //IE exclusive method for binding an event
	window.attachEvent("onload", IE_CorrectAlpha_PNG);
}else if (document.getElementById){  //support older modern browsers
	window.onload=IE_CorrectAlpha_PNG;
} 


function fEmbedFlash(sPath, sWidth, sHeight, sParams) {

	var str 			= '';
	
	var params_str = "";
	if (sParams != "") {
		defaultParams = defaultParams + ',' + sParams;
	}
	arr_params = defaultParams.split(",");
	for (i = 0; i< arr_params.length; i+=2) {
		params_str += ' ' + arr_params[i] + '=\"' + arr_params[i+1] + '\"';
	}
	
	str += '<object classid=\"' + classid + '"\" codebase=\"' + codebase + '\" width=\"' + sWidth + '\" height=\"' + sHeight + '\">';
	str += '<param name=\"movie\" value=\"' + sPath + '\">';
	
	for (i = 0; i < arr_params.length; i+=2) {	
		str += '<param name=\"' + arr_params[i] + '\" value=\"' + arr_params[i+1]+ '\">';
	}
	str += '<embed src=\"' + sPath + '\" pluginspage=\"' + pluginspage+ '\" type=\"application/x-shockwave-flash\" width=\"' + sWidth + '\" height=\"' + sHeight + '\" ' + params_str + '></embed>';
	str += '</object>';
	document.write(str);
}




