/*
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

if ((version >= 5.5) && (document.body.filters)) 
{
   for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText 
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
         img.outerHTML = strNewHTML
         i = i-1
      }
   }
}
*/

function goto(form)
{
	var index=form.languageSelect.selectedIndex
	if (form.languageSelect.options[index].value != "0")
	{
		location=form.languageSelect.options[index].value;
	}
}
 function confirmIt(where, msg)
{
	if (confirm(msg))
    {
		window.location.href = ''+where+'';
        return true;
	}
	else
	{
		return;
	}
}

function popupcentree(page,largeur,hauteur,options) {
    var top=(screen.height-hauteur)/2;
    var left=(screen.width-largeur)/2;
    window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
}
function highlight(field) {
       field.focus();
       field.select();
}


//functions for language selection BE/FR
function clickform()
{
	document.getElementById('light').style.display='block';
	document.getElementById('fade').style.display='block';
}
function closeform()
{
	document.getElementById('light').style.display='none';
	document.getElementById('fade').style.display='none';
}
function post_to_url(path, params, method)
{
    method = method || "post"; // Set method to post by default, if not specified.

    // The rest of this code assumes you are not using a library.
    // It can be made less wordy if you use one.
    var form = document.createElement("form");
    form.setAttribute("method", method);
    form.setAttribute("action", path);

    for(var key in params) {
        var hiddenField = document.createElement("input");
        hiddenField.setAttribute("type", "hidden");
        hiddenField.setAttribute("name", key);
        hiddenField.setAttribute("value", params[key]);

        form.appendChild(hiddenField);
    }

    document.body.appendChild(form);    // Not entirely sure if this is necessary
    form.submit();
}

var highlightLink = function () {
/*deze functie wordt gebruikt op de productpagina,waar men combokortingen of gratis producten kan kiezen*/
        var active = null, colour = '#84DFC1', border = '1px solid black';
        if (this.attachEvent) this.attachEvent('onunload', function () {
            active = null;
        });
        return function (element) {
            if ((active != element) && element.style)
            {
                if (active)
				{
					active.style.backgroundColor = '';
					//active.style.border = '';
 				active.className = 'freeProductboxOff';
				};
                //element.style.backgroundColor = colour;
 				element.className = 'freeProductboxOn';
				//alert (element.className);
                active = element;
            }
        };
    }();
