


function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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];}
}

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 Mailto(towho,cie) { 
  var who = towho;
  var serveur = "qsl.com";
  var sujet = cie;
  window.location = "mailto:" + who + "@" + serveur +"?subject=" + cie;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  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();
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_changeProp(objName,tagName,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
		if (theValue == true || theValue == false){
      eval("obj."+theProp+"="+theValue);
		}else {
			eval("obj."+theProp+"='"+theValue+"'");
		}
  }else {
		var t = document.getElementsByTagName(tagName);
		if(t.length && t.length > 0){
			for(n=0; n<t.length; n++) {
				if(t[n].name == objName) {
					if (theValue == true || theValue == false)
      			eval("t[n]."+theProp+"="+theValue);
    			else
						eval("t[n]."+theProp+"='"+theValue+"'");
				}
			}
		}
	}
}

/*
//function MM_changeProp(objId,x,theProp,theValue) { //v9.0
  var obj = null;
	with (document){ 
		if (getElementById) obj = getElementById(objId);
	}
  if (obj){
    if (theValue == true || theValue == false)
      eval("obj.style."+theProp+"="+theValue);
    else eval("obj.style."+theProp+"='"+theValue+"'");
  }
}
*/




// go to same page, different language
function getPage(lang){
	var currentLang = (lang == 'fr') ? 'en' : 'fr';
	var mainLocation = String(document.location).replace('/'+currentLang+'/', '/'+lang+'/');
	mainLocation = mainLocation.replace('_result', '');
	document.location.href = mainLocation;
}

function getIndexPage(docloc){
	var page = String(docloc);
	var pageUrlStartIndex = (page.indexOf("fr/") != -1) ? page.indexOf("fr/")+3 :  page.indexOf("en/")+3;
	page = page.substring(pageUrlStartIndex, page.length);
	
	document.location.href = (page.indexOf("ports") == -1 && page.indexOf("legal") == -1) ? "index.html?" + page : "../index.html?" + page;
}

function SetMainFrame(doc){
	parent.frames["mainFrame"].location.href = doc;
}

function popSized(img,imgTitle){
	
	var imgWin = window.open('', '', 'scrollbars=no,resizable=yes,status=yes,width=1000,height=400');
	imgWin.document.open();
	imgWin.document.write('<html><head>');
	imgWin.document.write('<title>'+ imgTitle +'</title>');
	imgWin.document.write('<sc'+'ript>');
	imgWin.document.write('function doIt(){');
	imgWin.document.write('var imgWidth = document.images["pic"].width + 20;');
	imgWin.document.write('var imgHeight = document.images["pic"].height + 90;');
	
	/*imgWin.document.write('imgWidth = 1000 - (document.body.clientWidth - imgWidth);');
	imgWin.document.write('imgHeight = 500 - (document.body.clientHeight - imgHeight);');*/

	imgWin.document.write('window.resizeTo(imgWidth,imgHeight);');
	imgWin.document.write('};');
	imgWin.document.write('</sc'+'ript>');
	imgWin.document.write('</head>');
	imgWin.document.write('<body style="background-color:#FFF;margin:0px">');
	imgWin.document.write('<div align="center"><a href="javascript:;" onclick="javacript:window.close();"><img name="pic" src='+ img +' style="display:block;border:0" onLoad="javascript:doIt();" /></a></div>');
	imgWin.document.write('</body></html>');
	imgWin.document.close();
}

function setTitle(docTitle){
	parent.document.title = docTitle;
}


function showOnMap(xPos,yPos){
	MM_changeProp('carte_indic','DIV','style.left',xPos+"px");
	MM_changeProp('carte_indic','DIV','style.top',yPos+"px");
	MM_changeProp('carte_indic','DIV','style.visibility','visible');
}
function showOnMap_text(xPos,yPos,newText){
	MM_changeProp('carte_indic_names','DIV','style.left',xPos+"px");
	MM_changeProp('carte_indic_names','DIV','style.top',yPos+"px");
	var obj = MM_findObj('carte_indic_names');
	obj.innerHTML = unescape(newText);
	MM_changeProp('carte_indic_names','DIV','style.visibility','visible');
}

function mouseX(evt) {
	if (evt.pageX) return evt.pageX;
	else if (evt.clientX) return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
	else return null;
}

function mouseY(evt) {
	if (evt.pageY) return evt.pageY;
	else if (evt.clientY) return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
	else return null;
}

/*function changeFontSize(inc){  
	var p = document.getElementsByTagName('p');
	for(n=0; n<p.length; n++) {
		if(p[n].style.fontSize) {
			var size = parseInt(p[n].style.fontSize.replace("px", ""));
		}else {
			var size = 12;
		}
		p[n].style.fontSize = size+inc + 'px';
	}
	var td = document.getElementsByTagName('div');
	for(n=0; n<td.length; n++) {
		td[n].style.fontSize = inc;
	}
}*/

function changeFontSize(inc){  
	MM_changeProp('amin','a','style.color','#999999');
	MM_changeProp('areg','a','style.color','#999999');
	MM_changeProp('amax','a','style.color','#999999');
	document.body.style.fontSize=inc;
}




