/**
* Submitten van formulier
* var frm		  : formuliernaam/id
* var method	: methode (post/get)
* var page		: te laden pagina
* var target	: doelbestemming (_blank, _self, ..)
**/
function sbmt(frm, method, page, target){
	document.forms[frm].method=method;
	document.forms[frm].action=page;
    if (target!="_SELF" || target!="_self")	document.forms[frm].target=target;
	document.forms[frm].submit();
}//sbmt

/**
*
* Mouseover effect menu's
* var id		:	betreffende item
* var toggle	:	Toggle van mouseover naar mouseout en vice versa
* var map       :   Extra map waar de afbeeldingen in te vinden zijn
* var bg        :   Als True, toggle background, anders een 'img' element
**/
function swapimg(id, toggle, map, bg){

	var  mouseout = 'includes/img/' + map + id + '.gif';
	var mouseover = 'includes/img/' + map + id + '_over.gif';

    if (!bg){
	  if(toggle==1){
  		  document.images[id].src = mouseout;
	  }else if(toggle==0){
		  document.images[id].src = mouseover;
	  }//else if
    }else{
	  if(toggle==1){
          document.getElementById(id).style.backgroundImage = "url("+mouseout+")";
	  }else if(toggle==0){
          document.getElementById(id).style.backgroundImage = "url("+mouseover+")";
	  }//else if
    }//else
}//swapimg

/**
*  Verandert de achtergrondkleur van het opgegeven element
**
*  id     : id van te veranderen element
*  toggle : - 0: onmouseout
*           - 1: onmouseover
**/
function changeBgColor(id,toggle){
  var mouseover = "#0067c5";
  var mouseout  = "#21aae3";
  if (toggle==1)
    document.getElementById(id).style.backgroundColor=mouseover;
  else
    document.getElementById(id).style.backgroundColor=mouseout;
}//changeBgColor

/**
** Gallery script.
* With image cross fade effect for those browsers that support it.
**
* - pictureName    : ID of the img placeholder
* - imageFile      : link to image
* - titleCaption   : ID of the caption placeholder
* - captionText    : text for the caption
**
* Enable comments if you want to have captions with the images
**/
function LoadGallery(pictureName,imageFile/*,titleCaption,captionText*/)
{
/*  if (document.all)
  {
    document.getElementById(pictureName).style.filter="blendTrans(duration=1)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }*/

  document.getElementById(pictureName).src = imageFile;
  
  /*if (document.all)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  } */
  //document.getElementById(titleCaption).innerHTML=captionText;
}//LoadGallery

/*
* BrowserDetection
* - BrowserDetect.browser  : browsername
* - BrowserDetect.version  : browserversion
* - BrowserDetect.OS       : operating system on client pc
*/
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();


