function ajax_main(pyear,pmonth,pday,path,publish_id,cat_id,menu_id,news_type_id,view){

	if((view=='details')) all_menu_news(pyear,pmonth,pday,path,publish_id,cat_id,menu_id,news_type_id);
	else menu_news(pyear,pmonth,pday,path,publish_id,cat_id,menu_id,news_type_id);
}
function all_menu_news(pyear,pmonth,pday,path,publish_id,cat_id,menu_id,news_type_id){
	var ajaxRequest; 
	//alert();// 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;
			}
		}
	}
	//alert(path+" "+publish_id);
	document.getElementById('all_menu_news').innerHTML = '<div style="padding:50px 0 50px 0; margin-bottom:5px; border-bottom:1px dashed #ccc" align="center"><img src="images/menu_news_loader.gif" border="0" /></div>';
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('all_menu_news');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
			//ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}

	ajaxRequest.open("GET", "all_menu_news.php?path="+path+"&cat_id="+cat_id+"&menu_id="+menu_id+"&news_type_id="+news_type_id, true);
	ajaxRequest.send(null);
	//alert(type);
	var url='jcalendar.php?month='+pmonth+'&year='+pyear+'&cur_date='+pyear+'-'+pmonth+'-'+pday;
	//alert(url);
	ajaxpage(url,'select_date');
}
function menu_news(pyear,pmonth,pday,path,publish_id,cat_id,menu_id,news_type_id){
	alert('adsfsdf');
	var ajaxRequest; 
	//alert();// 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;
			}
		}
	}
	//alert(path+" "+publish_id);
	document.getElementById('column_second').innerHTML = '<div style="padding:50px 0 50px 0; margin-bottom:5px; border-bottom:1px dashed #ccc" align="center"><img src="images/menu_news_loader.gif" border="0" /></div>';
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('column_second');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
			//ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}

	ajaxRequest.open("GET", "column_second.php?path="+path+"&cat_id="+cat_id+"&menu_id="+menu_id+"&news_type_id="+news_type_id, true);
	ajaxRequest.send(null);
	//alert(type);
	var url='jcalendar.php?month='+pmonth+'&year='+pyear+'&cur_date='+pyear+'-'+pmonth+'-'+pday;
	//alert(url);
	ajaxpage(url,'select_date');
}
