// JavaScript Document
<!--
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();
}

MM_reloadPage(true);
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 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_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 LoadPhp ()
{
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function CenterWindow(mypage,myname,wie,hie,resizeable,scrol)
{
  var iewinl = (screen.availWidth - wie) / 2;
  var iewint = (screen.availHeight - hie) / 2;
  if (navigator.appName=='Netscape')
    winprops = 'innerHeight='+hie+',innerWidth='+wie+',top='+iewint+',left='+iewinl+',scrollbars='+scrol+',resizable='+resizeable;
  else
    winprops = 'height='+hie+',width='+wie+',top='+iewint+',left='+iewinl+',scrollbars='+scrol+',resizable='+resizeable;
  win = window.open(mypage, myname, winprops)
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
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();
}
MM_reloadPage(true);

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function showtype(){
	MM_showHideLayers('Layer1','','hide');
	MM_showHideLayers('Layer2','','hide');
	MM_showHideLayers('Layer3','','hide');
	MM_showHideLayers('Layer4','','hide');
	if (document.forms[0].type.value==1) MM_showHideLayers('Layer1','','show');
	if (document.forms[0].type.value==2) MM_showHideLayers('Layer2','','show');
	if (document.forms[0].type.value==3) MM_showHideLayers('Layer3','','show');
	if (document.forms[0].type.value==4) MM_showHideLayers('Layer4','','show');
}
function check1(){
	 if (document.forms[0].email.value.indexOf('@',0)==-1 ||
         document.forms[0].email.value.indexOf('@',0)== 0 ||
         document.forms[0].email.value.indexOf('.',0)==-1) {
       alert('\nInvalid e-mail address.')
       document.forms[0].email.select()
       document.forms[0].email.focus()
       return false 
	} else {
	    if (document.forms[0].firstname.value=='')
	    {
	      alert('Please fill in first name!')
		  return false;  
		} else {
		  if (document.forms[0].surname.value=='')
		  {
		    alert('Please fill in surname');
			return false;
		  } else {
		    if (document.forms[0].address.value==''){
			  alert('Please fill in your address!')
			  return false;
			}  else {
			  if (document.forms[0].city.value==''){
			    alert('Please fill in your city!');
				return false;
			  } else {
			    if (document.forms[0].zip.value==''){
			  alert('Please fill in your zip/postal code!');
				  return false;
				} else {
				  return true;
				}
			  }
			}
		  }
		}
}
}
function dosubmenu(nom){
lastsubmenu='Submenu'+menunumber;
if ((menunumber!=nom) || (lastsubmenu && (!isvisible(lastsubmenu)))){
	if (lastsubsubmenu) changeObjectVisibility(lastsubsubmenu, 'hidden');
	lastsubmenu='Submenu'+menunumber;
	if (lastsubmenu!='Submenu1') changeObjectVisibility(lastsubmenu,'hidden');
	menunumber=nom;
	lastsubmenu='Submenu'+menunumber;
	if (lastsubmenu!='Submenu1') changeObjectVisibility(lastsubmenu,'visible');
			reposition()
			//document.Submenu1.resizeTo(150,211); 			 

}
}
function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

function isvisible(objectId){
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	if ((styleObject.visibility == 'visible') || (styleObject.visibility == 'show')){
	    return true;
	}  else { 
		  return false; 
	}
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
}

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility

function moveObject(objectId, newXCoordinate, newYCoordinate) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	if (document.getElementById) {
		newXCoordinate+='px'
		newYCoordinate+='px'
	}
	styleObject.left = newXCoordinate;
	styleObject.top = newYCoordinate;
	return true;
    } else {
	// we couldn't find the object, so we can't very well move it
	return false;
    }
} // moveObject

var xOffset = 30;
var yOffset = -5;
var lastsubsubmenu=false;
if (document.layers) document.body = new Object


function getwindowsize() {
  var myWidth = 0, myHeight = 0;
  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;
      }
    }
  }
  if (document.body) myHeight =myHeight+((document.body.scrollTop)?document.body.scrollTop:0)
  return myHeight;
}

function showMenu(menuNumber,x,y) {
    var menuId = menuNumber;
	if (document.layers) {
		if (window.pageYOffset)  document.body.scrollTop = window.pageYOffset;
	}
	if (menuNumber){
	if ((lastsubsubmenu!=menuId)  || (!isvisible(menuId)) ) {
	if (lastsubsubmenu) changeObjectVisibility(lastsubsubmenu, 'hidden') 
    changeObjectVisibility(menuId, 'visible');
	lastsubsubmenu=menuNumber;
	theheight=getLayerHeight(menuId);
	showtop=mousey-5;
	if ((showtop+theheight)>getwindowsize()){
		if ((getwindowsize()-theheight-((document.body.scrollTop)?document.body.scrollTop:0))>0) showtop=getwindowsize()-theheight; else showtop=((document.body.scrollTop)?document.body.scrollTop:0);
	}
	
	moveObject(menuId,x,y);
	}
	} else {
		if (lastsubsubmenu) changeObjectVisibility(lastsubsubmenu, 'hidden') ;
		lastsubsubmenu=menuNumber;
	}
}
function hideCurrentPopup() {
    // note: we've stored the currently-visible popup on the global object window.currentlyVisiblePopup
    if(window.currentlyVisiblePopup) {
	changeObjectVisibility(window.currentlyVisiblePopup, 'hidden');
	window.currentlyVisiblePopup = false;
    }
} // hideCurrentPopup

// initialize hacks whenever the page loads
//window.onload = initializeHacks;


function initializeHacks() {
    // this ugly little hack resizes a blank div to make sure you can click
    // anywhere in the window for Mac MSIE 5
    if ((navigator.appVersion.indexOf('MSIE 5') != -1) 
	&& (navigator.platform.indexOf('Mac') != -1)
	&& getStyleObject('blankDiv')) {
	window.onresize = explorerMacResizeFix;
    }
    resizeBlankDiv();
    // this next function creates a placeholder object for older browsers
    createFakeEventObj();
}

function createFakeEventObj() {
    // create a fake event object for older browsers to avoid errors in function call
    // when we need to pass the event object to functions
    if (!window.event) {
	window.event = false;
    }
} // createFakeEventObj

function resizeBlankDiv() {
    // resize blank placeholder div so IE 5 on mac will get all clicks in window
    if ((navigator.appVersion.indexOf('MSIE 5') != -1) 
	&& (navigator.platform.indexOf('Mac') != -1)
	&& getStyleObject('blankDiv')) {
	getStyleObject('blankDiv').width = document.body.clientWidth - 20;
	getStyleObject('blankDiv').height = document.body.clientHeight - 20;
    }
}

function explorerMacResizeFix () {
    location.reload(false);
}
function getLayerWidth(layerID){
      if(document.getElementById){
         if (document.getElementById(layerID)) {  return parseInt(document.getElementById(layerID).offsetWidth); } else { return 0 }
      }else if(document.all){
            if (document.all(layerID)) { return parseInt(document.all(layerID).offsetWidth); } else { return 0; }
      }else if(document.layers){
          if (document.layers[layerID]) {  return parseInt(document.layers[layerID].clip.width); } else { return 0 }
      }
} 
function getLayerHeight(layerID){
      if(document.getElementById){
            return parseInt(document.getElementById(layerID).offsetHeight);
			if (document.getElementById(layerID)) {  return parseInt(document.getElementById(layerID).offsetHeight); } else { return 0 }
      }else if(document.all){
             if (document.all(layerID)) { return parseInt(document.all(layerID).offsetHeight); } else { return 0; }
      }else if(document.layers){
            if (document.layers[layerID]) {  return parseInt(document.layers[layerID].document.height); } else { return 0 }
      }
} 


var mousex =0;
var mousey =0;
function returncoordie(){
	mousex=event.clientX+((document.body.scrollLeft)?document.body.scrollLeft:0);
	mousey=event.clientY+((document.body.scrollTop)?document.body.scrollTop:0);;
}
function returncoord(e){
	mousex=e.pageX;
	mousey=e.pageY;
}
//if (document.all)
//document.onmousemove=returncoordie
//else if ((navigator.appName=='Netscape')){
//window.captureEvents(Event.MOUSEMOVE)

//window.onmousemove=returncoord;
//} else { 
//  document.captureEvents(Event.MOUSEMOVE)
//  document.onmousemove=returncoordie;
//}
function hidemenu() {
	showMenu(false);
}

function findImage(name, doc) {
	var i, img;
	for (i = 0; i < doc.images.length; i++) {
    	if (doc.images[i].name == name) {
			return doc.images[i];
		}
	}
	for (i = 0; i < doc.layers.length; i++) {
    	if ((img = findImage(name, doc.layers[i].document)) != null) {
			img.container = doc.layers[i];
			return img;
    	}
	}
	return null;
}

function getImage(name) {
	if (document.layers) {
    	return findImage(name, document);
	}
	return null;
}
function getImageTop(myImage) {
	var y, obj;
	if (document.layers) {
		var img = getImage(myImage);
		if (img.container != null)
			return img.container.pageY + img.y;
		else
			return img.y;
	} else {
		return getElementTop(myImage);
	}
	return -1;
}


function getImageLeft(myImage) {
	var x, obj;
	if (document.layers) {
		var img = getImage(myImage);
    	if (img.container != null)
			return img.container.pageX + img.x;
		else
			return img.x;
  	} else {
		return getElementLeft(myImage);
	}
	return -1;
}
function getElementLeft(Elem) {
	if (document.layers) {
		var elem = getObjNN4(document, Elem);
		return elem.pageX;
	} else {
		var elem;
		if(document.getElementById) {
			var elem = document.getElementById(Elem);
		} else if (document.all){
			var elem = document.all[Elem];
		}
		xPos = elem.offsetLeft;
		tempEl = elem.offsetParent;
  		while (tempEl != null) {
  			xPos += tempEl.offsetLeft;
	  		tempEl = tempEl.offsetParent;
  		}
		return xPos;
	}
}


function getElementTop(Elem) {
	if (document.layers) {
		var elem = getObjNN4(document, Elem);
		return elem.pageY;
	} else {
		if(document.getElementById) {	
			var elem = document.getElementById(Elem);
		} else if (document.all) {
			var elem = document.all[Elem];
		}
		yPos = elem.offsetTop;
		tempEl = elem.offsetParent;
		while (tempEl != null) {
  			yPos += tempEl.offsetTop;
	  		tempEl = tempEl.offsetParent;
  		}
		return yPos;
	}
}
function getObjNN4(obj,name)
{
	var x = obj.layers;
	var foundLayer;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)
		 	foundLayer = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) foundLayer = tmp;
	}
	return foundLayer;
}
document.onclick = hidemenu;