    function closeWindow(pause)
	{
		  
		  $('#ajaxContainer').delay(pause).fadeOut('slow', function() {
			  
		  });
		  $('#siteBackground').delay(pause).fadeOut('slow', function() {
			  $("#ajaxContent").delay(pause).html('');
		 	$("#ajaxHeadline").delay(pause).html('');
		  });
		  
	}
	
	function startWindow(headline, script, paras)
	{

	 $('#siteBackground').fadeIn('100', function() {
        // Animation complete
      });
	 $('#ajaxContainer').fadeIn('100', function() {
        // Animation complete
		$("#ajaxHeadline").append(headline);
		$.ajax({
		   type: "POST",
		   url: script,
		   data: paras,
		   success: function(html){
			 $("#ajaxContent").append(html);
		   }
		 });
		
		$("#ajaxContentLoader").bind("ajaxSend", function(){
		   $(this).show();
		 }).bind("ajaxComplete", function(){
		   $(this).hide();
		 });
		
		
		
      });
	}
	
	function fadetest()
	{
		$('#ajaxBigLoad').fadeIn('fast');
	}
	
	function ajaxInnerLoad(script, div, paras)
	{
		$(div).html('');
		$("#ajaxContentLoader").bind("ajaxSend", function(){
		   timeid = setTimeout("fadetest()","500");
		   
		   //document.getElementById("ajaxBigLoad").style.display="block";
		  
		   $(this).show();
		   
		 }).bind("ajaxComplete", function(){
		  
		    clearTimeout(timeid);
			$(this).hide();
			$('#ajaxBigLoad').fadeOut('fast');
			
		   //document.getElementById("ajaxBigLoad").style.display="none";
		 });
		$.ajax({
		   type: "POST",
		   url: script,
		   data: paras,
		   success: function(html){
			 $(div).append(html);
		   }
		 });
	}

	function preValueForm(formId, after, password)
	{
		formobj = document.getElementById(formId);
		
		if(formobj.value == after)
		{
			formobj.value ='';
			formobj.style.color = "#000";
		}
		
		
		if(password == 'true')
		{
			formobj.style.display = "none";
			test = formId + "_on";
			document.getElementById(test).style.display = "inline";
			document.getElementById(test).focus();
		}
		
	}
	
	function afterValueForm(formId, after, password)
	{
		test = formId + "_on";
		formobj = document.getElementById(formId);
		if(formobj.value == '')
		{
			formobj.value = after;
			formobj.style.color = "#ccc";
		}
		if(password == 'true' && document.getElementById(test).display == 'inline')
		{
			
			if(document.getElementById(test).value == '')
			{
				alert("adfasfd");
			}
		}
		
	}
	
	function changeSight(formId, old)
	{
		
		if(document.getElementById(formId).value == '')
		{
			document.getElementById(formId).style.display = 'none';
			
			document.getElementById(old).style.display = 'inline';
		}
	}
	
	
	function ajaxForm(formname, url, div)
	{
		
		aha = document.forms[formname];
		out = "";
		for (var i=0; i<aha.length; i++)
		{
			//generate ajax get url
			if(aha.elements[i].name != 'returnpath')
			{
				if(aha.elements[i].checked == true || aha.elements[i].type != "checkbox")
				{
					out += aha.elements[i].name + "=" + aha.elements[i].value + "&"; 
				}
			//out += aha.elements[i].name + "=" + aha.elements[i].value + "&"; 
			}
					
		
		//out += aha.elements[i].name + "\n";
		// http://selfhtml.teamone.de/javascript/objekte/elements.htm
		}
		ajaxInnerLoad(url,div,'&'+out);	
		
	
		
	}
	
	function get_url_param( name )
	{
		name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	
		var regexS = "[\\?&]"+name+"=([^&#]*)";
		var regex = new RegExp( regexS );
		var results = regex.exec( window.location.href );
	
		if ( results == null )
			return "";
		else
			return results[1];
	}

	
	
