function displayTabData(tab_type,a_id){
	
	$("#nav").find("a").each(function(i) {
	  $(this).removeClass("slected");
   });
   
   $("#"+a_id).addClass("slected");

		
	var divname = "tab_div";
	var strurl=  "scripts/home_tabs.php?type="+tab_type;
	ajaxcall(divname,strurl);
}

function ajaxcall(divname,strurl)
{
	//alert(strurl);
    var xmlHttpReq = false;
    var self = this;
    document.getElementById(divname).innerHTML="";
	
    if (window.XMLHttpRequest) {  // Mozilla/Safari
        self.xmlHttpReq = new XMLHttpRequest();
    }else if (window.ActiveXObject) {   // IE
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
	
    self.xmlHttpReq.open('POST', strurl, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        	if (self.xmlHttpReq.readyState == 4) { document.getElementById(divname).innerHTML=self.xmlHttpReq.responseText; }
		}
    self.xmlHttpReq.send('');
}


function searchResult(tab_type,a_id,search_string,page){

   $("#nav").find("a").each(function(i) {
	  $(this).removeClass("slected");
   });
   
   $("#"+a_id).addClass("slected");

    var divname = "news";
	var strurl=  "scripts/searching.php?type="+tab_type+"&search_string="+search_string+"&page="+page;
	//alert(strurl);
	ajaxcall(divname,strurl);

}

function send_email(){
	
	var	frn_name =$("#frd_name").val();
	var	to_email =$("#to_email").val();
	var	from_email =$("#from_email").val();
	var	message =$("#message").val();

			
    var divname = "email_sendMailmsg";
	var strurl=  "scripts/jxEmail_print.php?name="+frn_name+"&to_email="+to_email+"&from_email="+from_email+"&msg="+message;
	ajaxcall(divname,strurl);
}
