	function $(id)
	{
		return document.getElementById(id);
	}
	function hide(id)
	{
		$(id).style.display = 'none';
	}
	function show(id)
	{
		$(id).style.display = 'block';
	}
	function isHidden(id)
	{
		if($(id).style.display == 'none')
			return true;
		else
			return false;
	}
	function V_switch(id)
	{
		if(isHidden(id))
			show(id);
		else
			hide(id);
	}
	function goLW()
	{	
		myRequest.update( $('lwform'), 'POST');
	}
													
function processData(responseText, responseStatus)
 { 
	
	//document.getElementById('loadingbar').style.display ='none';
	if (responseStatus==200) // succes
	{
		if(responseText == 'error')
						alert('Error updating data!'+responseText);
		else
		{
			eval(responseText);
			if(formsubmitstatus )fsm_enable();
		}
	 }
	else if(responseStatus == 0)
	{
	
	}
	else 
	{ 
	   alert(responseStatus + ' -- Error Processing Request');
	}
  }
function ajaxObject(url) {
	  var that=this;      
	   this.updating = false;
		  this.abort = function() {
				that.AJAX.onreadystatechange = function () {}
			  that.updating=false;
			  that.AJAX.abort();
			  that.AJAX=null;
			
		  }
	  this.update = function(form,postMethod) { 
		if(that.updating) that.abort();
		 that.AJAX = null;                      
		 var passData = getFormValues(form,"validate");
		 
		 
				
		if (window.XMLHttpRequest) {              
		  that.AJAX=new XMLHttpRequest();              
		} else {                                  
		  that.AJAX=new ActiveXObject("Microsoft.XMLHTTP");
		}                                             
		if (that.AJAX==null) {                             
		  return false;                               
		} else {
		
			
			  that.AJAX.onreadystatechange = function() {  
				if (that.AJAX.readyState==4) {             
				  that.updating=false;                
				  that.callback(that.AJAX.responseText,that.AJAX.status);        
				  that.AJAX=null;                                         
				} 
				}
			                                                
		  that.updating = new Date();                              
		  if (/post/i.test(postMethod)) {
			var uri=urlCall+'?'+that.updating.getTime();
			that.AJAX.open("POST", uri, true);
			that.AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
			that.AJAX.setRequestHeader("Content-Length", passData.length);
			that.AJAX.send(passData);
		  } else {
			var uri=urlCall+'?'+passData+'&timestamp='+(that.updating.getTime()); 
			that.AJAX.open("GET", uri, true);                             
			that.AJAX.send(null);                                         
		  }              
		  return true;                                             
		}                                                                           
	  }
	  var urlCall = url;        
	  this.callback = processData;
	  }
	  
	  var myRequest = new ajaxObject('get_album_details.php');		
function getFormValues(fobj,valFunc, url) 
			
			{ 
			
			   var str = ""; 
			
			   var valueArr = null; 
			
			   var val = ""; 
			
			   var cmd = ""; 
			
			   for(var i = 0;i < fobj.elements.length;i++) 
			
			   { 
			
				   switch(fobj.elements[i].type) 
			
				   { 
					case "checkbox":
							var myval = fobj.elements[i].checked;
							if(myval) 
								myval = 1;
							else
								myval = 0;								   
						   str += fobj.elements[i].name + 
			
							"=" + myval + "&"; 
			
							   break; 
					  case "textarea":
						 str += fobj.elements[i].name + 
			
								 "=" + escape(fobj.elements[i].value) + "&"; 
								 break; 
				   
						case "password":
							str += fobj.elements[i].name + 
			
								 "=" + escape(fobj.elements[i].value) + "&"; 

								  break; 
						case "hidden":
							str += fobj.elements[i].name + 
		
							 "=" + (fobj.elements[i].value) + "&"; 
							  break; 
					   case "text": 
			
									
							str += fobj.elements[i].name + 
			
							 "=" + escape(fobj.elements[i].value) + "&"; 
			
							 break; 
			
					   case "select-one": 
			
							str += fobj.elements[i].name + 
			
							"=" + fobj.elements[i].options[fobj.elements[i].selectedIndex].value + "&"; 
			
							break; 
			
				   } 
			
			   } 
									
						
							 
							 
			   str = str.substr(0,(str.length - 1)); 
			
			   return str; 
			
			}
			
			

function gotoUrl(url)
{
	
	window.location=  "http://www.inticura.be/"+url;	
}
function addListener(element, type, expression)
{
if(window.addEventListener)	
{
 // Standard
 element.addEventListener(type, expression, false);
 return true;
 }
  else if(window.attachEvent)
   { // IE	
	element.attachEvent('on' + type, expression);	
	return true;	
}
 else return false;
}

addListener(document, "keyup", function (e) { if (!e) { e = event; } if (e.keyCode == 27) { document.location.href = "http://www.myrgb.be"; } } );
//

