// JavaScript Document
//---------------------- Gereral

goto = function(url){
		window.location = url;
	}
//---------------------- User login
// Password
show_request_form = function(){
		load_lightbox('load.requestpassword.php');
	}

chpassword = function(){
		load_lightbox('load.chpass.php');
	}
//------
show_documentation = function(){
		load_lightbox('load.doc.php');
	}
	
show_support = function(){
		load_lightbox('load.support.php');
	}

//---------------------- LightBox
load_lightbox = function(php_file){
		var file	=	'library/ajax/' + php_file;
		lightbox_wait();
		//$('#popupContact').html($.ajax({url: file,async: false}).responseText);
		$.ajax({
		  type: "POST",
		  url: file,
		  //data: "name=John&location=Boston",
		  success: lightbox_show
		});
	}
	
lightbox_show = function (msg){
		$('#popupContact').removeClass('ajax_lightbox');
		$('#popupContact').html(msg);
		loadPopup();
	}
	
lightbox_hide = function (){
		setTimeout("disablePopup();",1000);
	}
	
lightbox_wait = function (){
		$('#popupContact').addClass('ajax_lightbox');
		$('#popupContact').html('<p class="ajax_waiting">Loading...</p>');
		loadPopup();
	}


load_content = function(php_file){
		var file	=	'library/ajax/' + php_file;
		lightbox_wait();
		//$('#popupContact').html($.ajax({url: file,async: false}).responseText);
		$.ajax({
		  type: "POST",
		  url: file,
		  //data: "name=John&location=Boston",
		  success: function(responseText){
			  			$('#body').html(responseText).fadeIn();
						lightbox_hide();
					}
		});
	}

// SHOW RESULT
function result_content(responseText)
{
	$('#result_content').hide();
	$('#result_content').removeClass();
	$('#result_content').html(responseText).fadeIn('slow');
}			
			
// WAIT MESSAGE
function wait_content()
{
	$('#result_content').hide();
	$('#result_content').addClass('ajax_waiting');
	$('#result_content').html("Please wait...").fadeIn();
}

