// <!--
// Main javascript
//	
	// Copyright (c) 2001 by Christopher S L Heng. All rights reserved.
	// $Id: main.js 15 2008-11-26 06:36:32Z bruno $
	// The JavaScript code below can be obtained from http://www.thesitewizard.com/archive/framebreak.shtml
	function framebreaker()
	{	// shoot any frame if another website try to catch us
		if (top.location != location) {
			top.location.href = document.location.href ;
		}
	}
   
   
   function New_Window(name,url){
	 new_win = open(url, name ,"left=25,top=25,status=yes,resizable=yes,scrollbars=yes,menubar=yes");
	 new_win.focus();
   }
	
	
	function WriteMe(me){
		var sep = '@';
		var dot = '.';
		var url = 'mailto:';
		var dom = 'ioda-net';
		var tld = 'ch';
		var sub = '?subject=Informations à propos de Boomerang le livre';
		switch (me){
			case 'fw' : var murl = url+'fwybrecht'+sep+dom+dot+tld+sub; break;
			case 'webmaster' : var murl = url+'webmaster'+sep+dom+dot+tld+sub; break;
		}
		//alert(murl);
		document.location= murl;
	
	}

	function MarginsAdjust( force ){
		  var myWidth = 0, myHeight = 0, change = false;
		  if( typeof( window.innerWidth ) == 'number' ) {
		    //Non-IE
		    myWidth = window.innerWidth;
		    myHeight = window.innerHeight;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    myWidth = document.documentElement.clientWidth;
		    myHeight = document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		    //IE 4 compatible
		    myWidth = document.body.clientWidth;
		    myHeight = document.body.clientHeight;
		  }
		  // window.alert( 'Width = ' + myWidth );
		  // window.alert( 'Height = ' + myHeight );
		  if ( myWidth <= 960 ){
			  change = true;
			  document.getElementById('contenu').style.left = '0px';
			  document.getElementById('contenu').style.marginLeft = '0px';
		  }else if ( force ) {
		  	document.getElementById('contenu').style.left = '50%';
		  	document.getElementById('contenu').style.marginLeft = '-490px';
		  }
		  /*
		  if ( myHeight <= 580 ){
			  change = true;
			  document.getElementById('contenu').style.top = '0px';
			  document.getElementById('contenu').style.marginTop = '0px';
		  }else if ( force ) {
			  document.getElementById('contenu').style.top = '50%';
			  document.getElementById('contenu').style.marginTop = '-320px';
		  }
		   */
		  if (change){
			//  alert ('Margins adapted !');
		  }
	}