
// preload images
pic1 = new Image;
pic1.src = basepath + "/asset/site/img/searchbox_h.gif";
pic2 = new Image;
pic2.src = basepath + "/asset/site/img/go_h.gif";
pic3 = new Image;
pic3.src = basepath + "/asset/site/img/zoom-out.gif";
pic4 = new Image;
pic4.src = basepath + "/asset/site/img/button_home_h.gif";
pic5 = new Image;
pic5.src = basepath + "/asset/site/img/button_producten_h.gif";
pic6 = new Image;
pic6.src = basepath + "/asset/site/img/button_portfolio_h.gif";
pic7 = new Image;
pic7.src = basepath + "/asset/site/img/button_vragen_h.gif";
pic8 = new Image;
pic8.src = basepath + "/asset/site/img/button_contact_h.gif";
pic9 = new Image;
pic9.src = basepath + "/asset/site/img/button_login_h.gif";

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function toggleFocus (obj, action, originalValue) {
	if (action == 'focus') {
	  obj.style.color = '#000000';
		if (originalValue != '' && obj.value == originalValue)
		{
		  obj.value = '';
		}
	} else if (action == 'unfocus') {
		if (obj.value == '' && originalValue != '')
		{
		  obj.style.color = '#8E8E8E';
		  obj.value = originalValue;
		}
		else
		{
		  if (obj.selectedIndex == 0)
      {
        obj.style.color = '#8E8E8E';
      }
      else
      {
        obj.style.color = '#000000';
      }
		}
	}
}

function toggleHighlight(action)
{
  objStyle = document.getElementById("main").style;
  objStyle.backgroundImage = (action == "focus") ? "url(" + basepath + "/asset/site/img/searchbox_h.gif)" : "url(" + basepath + "/asset/site/img/searchbox.gif)";
  objStyle.backgroundPosition = "788px 17px";
  objStyle.backgroundRepeat = "no-repeat";
  obj = document.getElementById("goButton");
  obj.src = (action == "focus") ? basepath + "/asset/site/img/go_h.gif" : basepath + "/asset/site/img/go.gif";
}

var doZoom = true;
function toggleTextZoom()
{
  zoomImage = document.getElementById("zoom_image");
  fontSize = (doZoom) ? "15px" : "12px";
  document.getElementById("main_text").style.fontSize = fontSize;
  zoomImage.src = (doZoom) ? basepath + "/asset/site/img/zoom-out.gif" : basepath + "/asset/site/img/zoom-in.gif";
  doZoom = !doZoom;
	createCookie("fontSize", fontSize, 365);
}

function initTextZoom()
{
  fontSize = readCookie("fontSize");
	if (fontSize != null && fontSize == "15px")
	{
    toggleTextZoom();
	}
}

function submitForm()
{
  document.getElementById('domain').value = document.getElementById('enterdomain').value;
  document.domaincheck.submit();
}

function toggleDiv(id) {
  obj = document.getElementById(id);
  obj.style.display = (obj.style.display == "block") ? "none" : "block";
}

