// JavaScript Document

/****************************************************/
/** Free script for any use, but please include    **/
/** a link to i-code.co.uk in any redistribution.  **/
/**                                                **/
/** Author : Stephen Griffin, www.i-code.co.uk     **/
/****************************************************/

function changeImage()
{
	var list = document.getElementById('optionlist');
	document.mainimage.src = list.options[list.selectedIndex].value;
}

function prevImage()
{
	var list = document.getElementById('optionlist');
	if(list.selectedIndex == 0)
	{
		list.selectedIndex = list.options.length-1;
	}
	else
	{
		list.selectedIndex--;
	}
	changeImage();
}

function nextImage()
{
	var list = document.getElementById('optionlist');
	if(list.selectedIndex == list.options.length-1)
	{
		list.selectedIndex = 0;
	}
	else
	{
		list.selectedIndex++;
	}
	changeImage();
}

function checkEmailOnGo()
{
	if(email.value == 'e-mailadres')
	{
		email.value = '';
	}
}

function checkEmailOnLeave()
{
	if(email.value == 'e-mailadres' || email.value == '')
	{
		email.value='e-mailadres';
	}
	else	
	{
		
	}
}


/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu_nl_1=new Array()
menu_nl_1[0]='<a href="news.php?scope=1">Brussel</a>'
menu_nl_1[1]='<a href="news.php?scope=2">Brakel</a>'
menu_nl_1[2]='<a href="news.php?scope=3">Persberichten</a>'

//Contents for menu 2, and so on
var menu_nl_2=new Array()
menu_nl_2[0]='<a href="bio.php">Bio</a>'
menu_nl_2[1]='<a href="realisaties_in_de_kamer.php">Realisaties in de Kamer</a>'

var menu_nl_3=new Array()
menu_nl_3[0]='<a href="fotos.php">Foto\'s</a>'
menu_nl_3[1]='<a href="videos.php">Video\'s</a>'

var menu_nl_4=new Array()
menu_nl_4[0]='<a href="LinksNationaal.php">Nationaal</a>'
menu_nl_4[1]='<a href="LinksRegionaal.php">Regionaal</a>'
menu_nl_4[2]='<a href="LinksOpenVLD.php">Open VLD</a>'
menu_nl_4[3]='<a href="LinksDiverse.php">Diverse</a>'

var menu_nl_5=new Array()
menu_nl_5[0]='<a href="contact.php?location=1">Kantoor in Michelbeke - Brakel</a>'
menu_nl_5[1]='<a href="contact.php?location=2">Gemeente Brakel</a>'
menu_nl_5[2]='<a href="contact.php?location=3">Kamer van Volksvertegenwoordigers</a>'

var menu_nl_6=new Array()
menu_nl_6[0]='<a href="brakel.php">Brakel</a>'
		
//Contents for menu 1
var menu_fr_1=new Array()
menu_fr_1[0]='<a href="news.php?scope=1">Bruxelles</a>'
menu_fr_1[1]='<a href="news.php?scope=2">Brakel</a>'
menu_fr_1[2]='<a href="news.php?scope=3">Dossiers de presse</a>'

//Contents for menu 2, and so on
var menu_fr_2=new Array()
menu_fr_2[0]='<a href="bio.php">Biographie</a>'
menu_fr_2[1]='<a href="realisaties_in_de_kamer.php">Innovations à la Chambre</a>'

var menu_fr_3=new Array()
menu_fr_3[0]='<a href="fotos.php">Photos</a>'
menu_fr_3[1]='<a href="videos.php">Vidéos</a>'

var menu_fr_4=new Array()
menu_fr_4[0]='<a href="LinksNationaal.php">National</a>'
menu_fr_4[1]='<a href="LinksRegionaal.php">Régional</a>'
menu_fr_4[2]='<a href="LinksOpenVLD.php">Open VLD</a>'
menu_fr_4[3]='<a href="LinksDiverse.php">Divers</a>'

var menu_fr_5=new Array()
menu_fr_5[0]='<a href="contact.php?location=1">Bureau à Michelbeke - Brakel</a>'
menu_fr_5[1]='<a href="contact.php?location=2">Commune Brakel</a>'
menu_fr_5[2]='<a href="contact.php?location=3">La Chambre des Représentants</a>'

//Contents for menu 1
var menu_en_1=new Array()
menu_en_1[0]='<a href="news.php?scope=1">Brussels</a>'
menu_en_1[1]='<a href="news.php?scope=2">Brakel</a>'
menu_en_1[2]='<a href="news.php?scope=3">Press releases</a>'

//Contents for menu 2, and so on
var menu_en_2=new Array()
menu_en_2[0]='<a href="bio.php">Biography</a>'

var menu_en_3=new Array()
menu_en_3[0]='<a href="fotos.php">Pictures</a>'
menu_en_3[1]='<a href="videos.php">Videos</a>'

var menu_en_4=new Array()
menu_en_4[0]='<a href="LinksNationaal.php">National</a>'
menu_en_4[1]='<a href="LinksRegionaal.php">Regional</a>'
menu_en_4[2]='<a href="LinksOpenVLD.php">Open VLD</a>'
menu_en_4[3]='<a href="LinksDiverse.php">Miscellaneous</a>'

var menu_en_5=new Array()
menu_en_5[0]='<a href="contact.php?location=1">Office in Michelbeke - Brakel</a>'
menu_en_5[1]='<a href="contact.php?location=2">Brakel</a>'
menu_en_5[2]='<a href="contact.php?location=3">House of Representatives</a>'


var menuwidth='150px' //default menu width
var menubgcolor='#E5E5E5'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu
