<!-- 
var ajax_memory;

function ajax_none()
{
	// Clear Memory
}

function ajax_processRequestPost(ajaxUrl,ajaxParam,ajaxDiv,ajaxCallBack)
{
	var ajax_memory_temp = ajaxUrl + ajaxParam + ajaxDiv + ajaxCallBack;
	
	if (ajax_memory_temp == ajax_memory)
		return;
		
	ajax_memory = ajax_memory_temp;

	var ajaxRequest;  // The variable that makes Ajax possible!

	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	var url = ajaxUrl;
	var params = ajaxParam;

	ajaxRequest.open("POST", url, true);

	//Send the proper header information along with the request
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", params.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	
	ajaxRequest.onreadystatechange = function() {//Call a function when the state changes.
		if(ajaxRequest.readyState == 4 && ajaxRequest.status == 200) 
		{
			// Clr previous call...
			ajax_memory = '';
			
			var ajaxDisplay = document.getElementById(ajaxDiv).innerHTML = ajaxRequest.responseText;

			// Post Request Scripts
			if (ajaxCallBack != '')
			{
				eval(ajaxCallBack);
			}
			//alert(http.responseText);
		}
	}
	ajaxRequest.send(params);
}

function ajax_showdiv(elem) 
{
	document.getElementById(elem).style.visibility = 'visible';
}

function ajax_hidediv(elem) 
{
	document.getElementById(elem).style.visibility = 'hidden';
}

function ajax_action(mode,id)
{
	if (mode == 'blog')
	{
		var blog_name 				= document.getElementById('blog_name').value;
		var blog_text 				= document.getElementById('blog_text').value;
		var blog_answer 			= document.getElementById('blog_answer').value;
		var blog_code 				= document.getElementById('blog_code').value;
		var blog_perspectives_id 	= document.getElementById('blog_perspectives_id').value;
		var blog_category_id 		= document.getElementById('blog_category_id').value;
	
		if (blog_name == '')
		{
			alert('Please enter your Name');
			document.getElementById('blog_name').focus();
			return;
		}
		if (blog_text == '')
		{
			alert('Please enter your Comment');
			document.getElementById('blog_text').focus();
			return;
		}
		if (blog_answer == '')
		{
			alert('Please enter the Validation total');
			document.getElementById('blog_answer').focus();
			return;
		}
	
		if (blog_code != blog_answer)
		{
			alert('You have entered an incorrect Validation total.\n\nPlease try again.');
			document.getElementById('blog_answer').value = '';
			document.getElementById('blog_answer').focus();
			return;
		}
	
		var url 	= "site/modules/perspectives/perspectives_blog.php";
//		var url 	= "perspectives_blog.php";
		var div		= "div_blog";
		
		var param 	= "page=perspectives";
		param		+= "&mode=blog";
		param		+= "&perspectives_id=" 	+ document.getElementById('blog_perspectives_id').value;
		param		+= "&category_id=" 		+ document.getElementById('blog_category_id').value;
		param		+= "&blog_name=" 		+ encodeURIComponent(document.getElementById('blog_name').value);
		param		+= "&blog_text="		+ encodeURIComponent(document.getElementById('blog_text').value);

		var callback = "ajax_none();";
		ajax_processRequestPost(url,param,div,callback);
		return;
	}
}
//-->
