$(document).ready(setupInputValueSwapper);

function submitProjForm() {
   var url = '/templates/procedures/projects_ajax.asp';  //link naar asp file
   var pars = ''//'action=delete&id='+id+'&table='+table;	   //parameters (extra parameters gewoon met &)
   var target = 'proj_filters'; //naam van de div waar het resultaat heen moet
 //  var myAjax = new Ajax.Updater(target, url, {method: 'post', parameters: pars});
   $('#select_Land').load("../../../templates/procedures/projects_ajax.asp", {Action: 'Land', Land: document.getElementById('Land').value, Plaats: document.getElementById('Plaats').value, Jaar: document.getElementById('Jaar').value});
   $('#select_Plaats').load("../../../templates/procedures/projects_ajax.asp", {Action: 'Plaats', Land: document.getElementById('Land').value, Plaats: document.getElementById('Plaats').value, Jaar: document.getElementById('Jaar').value});
   $('#select_Jaar').load("../../../templates/procedures/projects_ajax.asp", {Action: 'Jaar', Land: document.getElementById('Land').value, Plaats: document.getElementById('Plaats').value, Jaar: document.getElementById('Jaar').value});
/*
   document.getElementById("label_Land").innerHTML=document.getElementById('Land').value || "[Land]";
   document.getElementById("label_Plaats").innerHTML=document.getElementById('Plaats').value || "[Plaats]";
   document.getElementById("label_Jaar").innerHTML=document.getElementById('Jaar').value || "[Jaar]";
   */
}

function setupInputValueSwapper() {

   $('#hs_query').focus(function () {
      if (this.value == this.getAttribute('altvalue')) {
         this.value = '';
		 this.style.color="white";
      }
   })
   .blur(function () {
      if (this.value == '') {
         this.value = this.getAttribute('altvalue');
		 this.style.color="#bfd1ee";
      }
   });

   $('#hn_query').focus(function () {
      if (this.value == this.getAttribute('altvalue')) {
         this.value = '';
		 this.style.color="white";
      }
   })
   .blur(function () {
      if (this.value == '') {
         this.value = this.getAttribute('altvalue');
		 this.style.color="#bfd1ee";
      }
   });

   /*	
	///Replaced with the above, cuz "type" attribute is read-only in IE

      $('.valueswap_password').focus(function () {
      if (this.type != 'password' && this.value != '') {
         this.value = '';
         this.type = 'password';
      }
   })
   .blur(function () {
      if (this.type == 'password' && this.value == '') {
         this.type = 'text';
         this.value = this.getAttribute('altvalue');
      }
   });
   */
}

// Apply and store fontsize change
function setTextSize(intSize)
{
   document.getElementById("main_container").style.fontSize= intSize+"px";
   var arrHeadThree=document.getElementsByTagName("h3");
   for(var i = 0; i < arrHeadThree.length; i++)
   {
	   arrHeadThree[i].style.fontSize= intSize+"px";
   }

   var arrList=document.getElementsByTagName("li");
   for(var i = 0; i < arrList.length; i++)
   {
	   arrList[i].style.fontSize= intSize+"px";
   }
   document.cookie="mysize=" + intSize + "; path=/";
}

//Get font-size cookie (called by mydefaultsize)
function getmycookie(myname)
{
if (document.cookie.length>0)
  {
  mystart=document.cookie.indexOf(myname + "=");
  if (mystart!=-1)
    {
    mystart=mystart + myname.length+1;
    myend=document.cookie.length;
    myend=mystart+2;
    return document.cookie.substring(mystart,myend);
    }
  }
return "";
}

//get stored font-size onload
function mydefaultsize(){
   if (parseInt(getmycookie("mysize"))>0)
	{
		setTextSize(parseInt(getmycookie("mysize")));
	}
	else
	{
		setTextSize(11);
	}

}