//<SCRIPT language="JavaScript">
//<!--
//**** Script by Philippe SERVAIS 20070709
//**** clock
function showFilled(Value) {
  return (Value > 9) ? "" + Value : "0" + Value;
}
function StartClock24() {
  TheTime = new Date;
  document.clock.ShowTime.value = showFilled(TheTime.getHours()) + ":" + showFilled(TheTime.getMinutes()) + ":" + showFilled(TheTime.getSeconds());
  setTimeout("StartClock24()",1000)
}
function Clock24() {
  TheTime = new Date;
  document.clock.ShowTime.value = showFilled(TheTime.getHours()) + ":" + showFilled(TheTime.getMinutes()) + ":" + showFilled(TheTime.getSeconds());
  setTimeout("Clock24()",1000)
}
function Clock24local() {
  var TheTime = new Date();
  var time_zone = TheTime.getTimezoneOffset();
  var hours = TheTime.getHours() + (time_zone/60)+1; //time zone
  //Time summer
  var year = TheTime.getFullYear();
  for (i=31; i >24; i--) {
  var sunday = new Date(year, 2, i);
  if (sunday.getDay()==0) break;
  }
  for (i=31; i >24; i--) {
  var sunday2 = new Date(year, 9, i);
  if (sunday2.getDay()==0) break;
  }
  if (TheTime >= sunday && TheTime < sunday2) hours = hours + 1;
  //Time summer
  document.clock.ShowTime.value = showFilled(hours) + ":" + showFilled(TheTime.getMinutes()) + ":" + showFilled(TheTime.getSeconds());
  setTimeout("Clock24local('','')",1000);
}

/***************************************************
Script : PopUp2e-phs
Author: www.philippeservais.be (c) 2007
For URL: http://www.e-phs.net
Laste date modify : 09 juil 2007
****************************************************/
var PopUp2ephsWindow=null;
function PopUp2ephs(mypage,myname,w,h,pos,infocus,parameter){
	settings_param = '';
	if (mypage == '') {}
	if (myname == '') {}
	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=100; TopPosition=100;
	}
	settings_param = 'width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,dependent=no';
	PopUp2ephsWindow = window.open(mypage,myname,settings_param);
	if (infocus=='back')//infocus=='Back'
		{PopUp2ephsWindow.blur();PopUp2ephsWindow.location=mypage;PopUp2ephsWindow.blur();
	}else{
		PopUp2ephsWindow.focus();PopUp2ephsWindow.location=mypage;
	} //infocus=='front'
}

function popup2(mylink,nom,hp2,wp2,option){
	if (option == null) { var option = "scrollbars=0,resizable=0,"; }
	var hauteur_popup2=hp2;
	var H2 = (screen.height - hauteur_popup2) / 2;
	var largeur_popup2=wp2;
	var L2 = (screen.width - largeur_popup2) / 2;
	if(window != top){
		top.location.href = location.href;
	}
	if (! window.focus)return true;
	var href;

	if (typeof(mylink) == 'string'){
   		href=mylink;
	}else{
   		href=mylink.href;
	}
	var w=window.open(href, nom,"status=no,toolbar=no,location=no,directories=no,menuBar=no,scrollbars=yes,resizable=yes,height="+hauteur_popup2+",width="+largeur_popup2+",top="+H2+",left="+L2);
    //w.document.close();
    //w.document.focus();
	w.focus(); //add 20090113-0053
	return false;
}

//http://www.e-phs.net/
function OuvrirPopup(page,nom,option) {
  window.open(page,nom,option);
}

// Hide from old browsers
var FirstForm;
function StartSearch(){
	document.forms[FirstForm+document.InputForm.SearchSelect.selectedIndex].elements[0].value=document.InputForm.query.value;
	document.forms[FirstForm+document.InputForm.SearchSelect.selectedIndex].submit();
}

function BouttonAudio8(LinkAudioBoutton,WidhtBoutton,HeightBoutton,ShapeBouton,BgColorBoutton,PlayingColorBoutton,ArrowColorBoutton,OptionBoutton){
//-BouttonAudio by Philippe SERVAIS 2009
//-8 Parameters
//-Juste 'LinkAudioBoutton' is inevitable.
	var arguments = "";
	var protocol = window.location.protocol;
	if (protocol != "https:"){protocol = "http:";}
	var hostmedia = window.location.hostname;
	
	var LinkAudioBoutton = LinkAudioBoutton;
	if (!LinkAudioBoutton){LinkAudioBoutton="";}

	var WidhtBoutton = WidhtBoutton;
	if (!WidhtBoutton){WidhtBoutton="24";}

	var HeightBoutton = HeightBoutton;
	if (!HeightBoutton){HeightBoutton="24";}

	var ShapeBoutom = ShapeBoutom;
	if (!ShapeBoutom){ShapeBoutom="";}

	var BgColorBoutton = BgColorBoutton;
	if (!BgColorBoutton){BgColorBoutton="#FFFFFF";}
	var PlayingColorBoutton = PlayingColorBoutton;
	if (!PlayingColorBoutton){PlayingColorBoutton="#0000FF";}
	var ArrowColorBoutton = ArrowColorBoutton;
	if (!ArrowColorBoutton){ArrowColorBoutton="00FF00";}

	var	OptionBoutton = OptionBoutton;
	var OptionBouttonAutoplay="autoplay=yes";	
	if (!OptionBoutton){
		OptionBoutton="";
	}else{
		if (OptionBoutton="autoplay=yes"){
			var OptionBouttonAutoplay="autoplay=yes";	
		}
	}
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,47,0" width="24" height="24" id="BouttonAudio" title="Désactiver - Activer - Pause de  la musique !...">');
	document.write('<param name="movie" value="/smw_scripts/audioplayer/BouttonAudio.swf" />');
	document.write('<param name="loop" value="false" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value='+BgColorBoutton+' />');
	document.write('<param name="flashvars" value="theFile='+LinkAudioBoutton+'&'+OptionBouttonAutoplay+'&loopMe=no&playingColor='+PlayingColorBoutton+'&arrowColor='+ArrowColorBoutton+'" />');
	// name="BouttonAudio"
	document.write('<embed src="/smw_scripts/audioplayer/BouttonAudio.swf" flashvars="theFile='+LinkAudioBoutton+'&'+OptionBouttonAutoplay+'&loopMe=no&playingColor='+PlayingColorBoutton+'&arrowColor='+ArrowColorBoutton+'" width="'+WidhtBoutton+'" height="'+HeightBoutton+'" bgcolor="'+BgColorBoutton+'" loop="false" menu="true" quality="high" name="wimpy" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}
