//PopUp function
//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 normal
// Paste this script where you want to hide your email
// <script language="JavaScript">writeEmail('info', 'jrweb.net')</script>

function writeEmail(eName, eServer)
{
emailname = eName
emailserver = eServer

document.write("<a href='mailto:" + emailname + "@" + emailserver + "?subject=Courriel du site www.groupeimmobilierbrochu.com'>");
document.write(emailname + "@" + emailserver);
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>");
}


// Past the script language in head of HTML document
// <script language="JavaScript">thisWindowName('main');</script>
// In link make your target="main"

function thisWindowName(name) {  
	if (document.images)
  	self.name = name;
}