// ** <a onfocus="this.blur()" onclick="popWin(this.href,'popupwin','600','440','center','no','no','no','no','no','no','no');return false" href="/test/popup/projets/chute_caron1.htm">
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=10;TopPosition=10}
	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);
}



// ** Switches first URL with the second on
// ** 1)http://www.havresaintlouis.ca/ 2)http://www.havresaintlouis.ca/en/
// ** <a href="javascript:goswitchEn()">Go Swicth</a>

function goswitchEn(){
var thisurl = unescape(document.URL);
var targurl = thisurl.replace('http://www.havresaintlouis.ca/','http://www.havresaintlouis.ca/en/');
location.href=targurl;
}

function goswitchFr(){
var thisurl = unescape(document.URL);
var targurl = thisurl.replace('http://www.havresaintlouis.ca/en/','http://www.havresaintlouis.ca/');
location.href=targurl;
}


// ** name the opener window
// ** Place this in HEAD of HTML document for the targetting page
// ** <script language="JavaScript">thisWindowName('maison-ville');</script>
// ** place in link 'onclick'
// ** <a href="#" onclick="javascript:window.close();" target="maison-ville">Link</a>

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


/* hide Email */
/* <script language="JavaScript">writeEmail('info', 'habitationslaurendeau.com')</script> */
function writeEmail(eName, eServer)
{
emailname = eName
emailserver = eServer

document.write("<a href='mailto:" + emailname + "@" + emailserver + "'>");
document.write(emailname + "@" + emailserver);
document.write("</a>");
}

// Script pour Flash W3C
//<script type="text/javascript">
//		codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0';
//		pluginspage = 'http://www.macromedia.com/go/getflashplayer';
//		classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
//		defaultParams = 'menu,false,quality,high,bgcolor,#c2c6cf,scale,noscale,salign,l,wmode,transparent"';
//		fEmbedFlash('flash/menu.swf', '800', '120');
//	</script>

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}
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);
}