var loadstatustext="<img src='loading.gif' />"
var xmlHttp;

function showContent(str)
{	
	xmlHttp=GetXmlHttpObject();
	document.getElementById("content").innerHTML = loadstatustext;
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;

	xmlHttp.onreadystatechange=stateChanged ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function stateChanged() 
{ 
	if (xmlHttp.readyState == 4)
	 { 
		document.getElementById("content").innerHTML = xmlHttp.responseText ;	
		  //document.getElementById("content").innerHTML=""		  
	 }  
}
// For rating to restaurant from restaurant profile

function rateToRestShow(str)
{	
	xmlHttp=GetXmlHttpObject();
	document.getElementById("content_rrr").innerHTML = loadstatustext;
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;

	xmlHttp.onreadystatechange=rateToRestShowstateChanged ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function rateToRestShowstateChanged() 
{ 
	if (xmlHttp.readyState == 4)
	 { 
		document.getElementById("content_rrr").innerHTML = xmlHttp.responseText ;	
		  //document.getElementById("content").innerHTML=""		  
	 }  
}

//For displaying search form

function showSearchEmail(str)
{	
	xmlHttp=GetXmlHttpObject();
	document.getElementById("content_search").innerHTML = loadstatustext;
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;

	xmlHttp.onreadystatechange=showSearchstateChanged ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function showSearchstateChanged() 
{ 
	if (xmlHttp.readyState == 4)
	 { 
		document.getElementById("content_search").innerHTML = xmlHttp.responseText ;	
	 }    
}
// For displaying the report change mail

function showReportMail(str)
{	
	xmlHttp=GetXmlHttpObject();
	document.getElementById("content_report").innerHTML = loadstatustext;
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;

	xmlHttp.onreadystatechange=ReportMailstateChanged ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function ReportMailstateChanged() 
{ 
	if (xmlHttp.readyState == 4)
	 { 
		document.getElementById("content_report").innerHTML = xmlHttp.responseText ;	
	 }    
}


//For displaying searchAction form

function showSearchEmailAct(str,id)
{	
//alert(id);
	xmlHttp=GetXmlHttpObject();
	document.getElementById("content_search").innerHTML = loadstatustext;
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;
	//txt_search = document.getElementById('searchText').value;
	//txt_search = document.getElementById("searchText").value;
	
	url = url+"&txt_search="+id;
	
	//alert(url);
	xmlHttp.onreadystatechange=showSearchEmailActstateChanged ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function showSearchEmailActstateChanged() 
{ 
	if (xmlHttp.readyState == 4)
	 { 
		document.getElementById("content_search").innerHTML = xmlHttp.responseText ;	
	 }    
}

// For displaying members messages

function showMsg_box(str)
{	
	xmlHttp=GetXmlHttpObject();
	document.getElementById("content_inbox").innerHTML = loadstatustext;
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;

	xmlHttp.onreadystatechange=showMsg_boxstateChanged ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function showMsg_boxstateChanged() 
{ 
	if (xmlHttp.readyState == 4)
	 { 
		document.getElementById("content_inbox").innerHTML = xmlHttp.responseText ;	
		  //document.getElementById("content").innerHTML=""		  
	 }  
}

// For displaying the restaurant profile all tab section
function showMsg_tab(str)
{	
	xmlHttp=GetXmlHttpObject();
	document.getElementById("tab_content").innerHTML = loadstatustext;
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str+"&js=1";;

	xmlHttp.onreadystatechange=showMsg_tabstateChanged ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function showMsg_tabstateChanged() 
{ 
	if (xmlHttp.readyState == 4)
	 { 
		document.getElementById("tab_content").innerHTML = xmlHttp.responseText ;	
		  //document.getElementById("content").innerHTML=""		  
	 }  
}

// For displaying inbox messages
var xmlHttpmsg;

function show_inboxMsg(str,key)
{	
	//alert(key);
	
	xmlHttpmsg=GetXmlHttpObject();
	document.getElementById("msg_content").innerHTML = loadstatustext;
	if (xmlHttpmsg == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;

	xmlHttpmsg.onreadystatechange=stateChangedinboxMsg ;	
	xmlHttpmsg.open("GET",url,true);	
	xmlHttpmsg.send(null);
	document.getElementById(key+'_1').style.fontWeight = 'normal'
		document.getElementById(key+'_2').style.fontWeight = 'normal'
			document.getElementById(key+'_3').style.fontWeight = 'normal'
} 
function stateChangedinboxMsg() 
{ 
	if (xmlHttpmsg.readyState == 4)
	 { 
		document.getElementById("msg_content").innerHTML = xmlHttpmsg.responseText ;	
		  //document.getElementById("content").innerHTML=""		  
	 }  
}


// For rating functionality
var xmlHttprate;
function showContentRating(str,id)
{	
	
	content = "content_"+id;
	//alert(content);
	xmlHttprate=GetXmlHttpObject();
	document.getElementById(content).innerHTML = loadstatustext;
	if (xmlHttprate == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;

	xmlHttprate.onreadystatechange=stateChangedrate ;	
	xmlHttprate.open("GET",url,true);	
	xmlHttprate.send(null);
} 
function stateChangedrate() 
{ 
	if (xmlHttprate.readyState == 4)
	 { 
		document.getElementById(content).innerHTML = xmlHttprate.responseText ;	
	 }  
}

//For displaying restaurant rating
var xmlHttprestratedisp;
function displayRestRating(str,id)
{	
	
	content = id;
	xmlHttprestratedisp=GetXmlHttpObject();
	
	document.getElementById(content).innerHTML = loadstatustext;
	if (xmlHttprestratedisp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;

	xmlHttprestratedisp.onreadystatechange=stateChangedshowrestRate ;	
	xmlHttprestratedisp.open("GET",url,true);	
	xmlHttprestratedisp.send(null);
} 
function stateChangedshowrestRate() 
{ 
	if (xmlHttprestratedisp.readyState == 4)
	 { 
		document.getElementById(content).innerHTML = xmlHttprestratedisp.responseText ;	
	 }  
}



// For display menu rating result
var xmlHttpratedisp;
function displayMenuRating(str)
{	
	//alert(str);
	//content = "outer_"+id;
	xmlHttpratedisp=GetXmlHttpObject();
	
	document.getElementById("content").innerHTML = loadstatustext;
	if (xmlHttpratedisp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;

	xmlHttpratedisp.onreadystatechange=stateChangedshowRate ;	
	xmlHttpratedisp.open("GET",url,true);	
	xmlHttpratedisp.send(null);
} 
function stateChangedshowRate() 
{ 
	/////alert(content);
	if (xmlHttpratedisp.readyState == 4)
	 { 
		document.getElementById("content").innerHTML = xmlHttpratedisp.responseText ;	
	 }  
}



function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	 {
		 // Firefox, Opera 8.0+, Safari
		 xmlHttp=new XMLHttpRequest();
	 }
	 catch (e)
	 {
	 // Internet Explorer
		 try
		  {
		 	 xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		  }
		 catch (e)
		  {
			 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
	 }
	return xmlHttp;
}



/* code for forgot password */


var xmlHttpforgetpass;

function showForgotPass(str)
{	
	xmlHttpforgetpass=GetXmlHttpObject();	
	
//	document.getElementById("login_box").innerHTML=loadstatustext;
	 if (xmlHttpforgetpass == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }	
	
	var url = str;	
	xmlHttpforgetpass.onreadystatechange = ForgotPassPage ;	
	xmlHttpforgetpass.open("GET",url,true);	
	xmlHttpforgetpass.send(null);
} 
function ForgotPassPage() 
{ 
	if (xmlHttpforgetpass.readyState==4)
	 { 		
		document.getElementById("login_box").innerHTML=xmlHttpforgetpass.responseText ;	
		  //document.getElementById("content").innerHTML=""
		  
	 }  
}

function forgotPassAction(str)
{	
	xmlHttpforgetpassAct=GetXmlHttpObject();	
	
//	document.getElementById("login_box").innerHTML=loadstatustext;
	 if (xmlHttpforgetpassAct==null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }
	  
	email = document.getElementById('fld_email').value;
	
	var url = str+'&fld_email='+email;	
	xmlHttpforgetpassAct.onreadystatechange=stateChange ;	
	xmlHttpforgetpassAct.open("GET",url,true);	
	xmlHttpforgetpassAct.send(null);
} 
function stateChange() 
{ 
	if (xmlHttpforgetpassAct.readyState==4)
	 { 		
		document.getElementById("login_box").innerHTML=xmlHttpforgetpassAct.responseText ;	
		  //document.getElementById("content").innerHTML=""
		  
	 }  
}

var xmlHttpcancel;

function showCancel(str)
{	
	xmlHttpcancel = GetXmlHttpObject();	
	
//	document.getElementById("login_box").innerHTML=loadstatustext;
	 if (xmlHttpcancel == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  } 
	 
	var url = str;	
	xmlHttpcancel.onreadystatechange = stateChangeCancel ;	
	xmlHttpcancel.open("GET",url,true);	
	xmlHttpcancel.send(null);
} 
function stateChangeCancel() 
{ 
	if (xmlHttpcancel.readyState == 4)
	 { 	
		document.getElementById("login_box").innerHTML = xmlHttpcancel.responseText ;	
		  //document.getElementById("content").innerHTML=""
		  
	 }  
}

/* code for login action */
var xmlHttpcancel;

function loginAction(str)
{	
	xmlHttplogin = GetXmlHttpObject();	
	
//	document.getElementById("login_box").innerHTML=loadstatustext;
	 if (xmlHttplogin == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  } 
	 
	username = document.getElementById('username').value;
	pass = document.getElementById('pass').value;
	
	var url = str+"&username="+username+"&password="+pass;	
	
	xmlHttplogin.onreadystatechange = stateChangeLogin ;	
	xmlHttplogin.open("GET",url,true);	
	xmlHttplogin.send(null);
} 
function stateChangeLogin() 
{ 
	if (xmlHttplogin.readyState == 4)
	 { 	
		document.getElementById("login_box").innerHTML = xmlHttplogin.responseText ; 
	 }  
}


/* code for displaying change password  page*/
var xmlHttpchangepass;

function showChangePass(str)
{	
	xmlHttpchangepass = GetXmlHttpObject();	
	
//	document.getElementById("login_box").innerHTML=loadstatustext;
	 if (xmlHttpchangepass  == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }	
	
	var url = str;	
	xmlHttpchangepass .onreadystatechange = changePage ;	
	xmlHttpchangepass .open("GET",url,true);	
	xmlHttpchangepass .send(null);
} 
function changePage() 
{ 
	if (xmlHttpchangepass .readyState==4)
	 { 		
		document.getElementById("login_box").innerHTML = xmlHttpchangepass .responseText ;	
		  //document.getElementById("content").innerHTML=""
		  
	 }  
}

function changePassAction(str)
{	
	xmlHttpchangepassAct = GetXmlHttpObject();	
	
//	document.getElementById("login_box").innerHTML=loadstatustext;
	 if (xmlHttpchangepassAct ==null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }
	  
	oldpass = document.getElementById('old_pass').value;
	newpass = document.getElementById('new_pass').value;
	
	var url = str+'&oldpass='+oldpass+'&newpass='+newpass;	
	xmlHttpchangepassAct .onreadystatechange = changeAction ;	
	xmlHttpchangepassAct .open("GET",url,true);	
	xmlHttpchangepassAct .send(null);
} 
function changeAction() 
{ 
	if (xmlHttpchangepassAct .readyState == 4)
	 { 		
		document.getElementById("login_box").innerHTML = xmlHttpchangepassAct .responseText ;	
		  //document.getElementById("content").innerHTML=""
		  
	 }  
}

// to perform logout action
function logoutAction(str)
{	
	xmlHttplogout = GetXmlHttpObject();	
	
//	document.getElementById("login_box").innerHTML=loadstatustext;
	 if (xmlHttplogout ==null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }
	  
	
	var url = str;	
	xmlHttplogout .onreadystatechange = performLogoutAct ;	
	xmlHttplogout .open("GET",url,true);	
	xmlHttplogout .send(null);
} 
function performLogoutAct() 
{ 
	if (xmlHttplogout .readyState == 4)
	 { 		
		document.getElementById("login_box").innerHTML = xmlHttplogout.responseText ;	
		  //document.getElementById("content").innerHTML=""
		  
	 }  
}

function DeleteSpecialDate(str)
{	
	xmlHttpDelImg = GetXmlHttpObject();	
	

	 if (xmlHttpDelImg ==null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }
	var answer;
	answer = confirm_delSpecDate();	
	if(eval(answer) == true)
	{		
		var url = str;	
		xmlHttpDelImg .onreadystatechange = performDeleteSpecDate ;	
		xmlHttpDelImg .open("GET",url,true);	
		xmlHttpDelImg .send(null);
	}
	else
	return;	
	
} 

function performDeleteSpecDate() 
{ 
	if (xmlHttpDelImg .readyState == 4)
	 { 		
		document.getElementById("spec_dates").innerHTML = xmlHttpDelImg .responseText ;			
		  
	 }  
}

// to perform delete image
function DeleteImg(str)
{	
	xmlHttpDelImg = GetXmlHttpObject();	
	

	 if (xmlHttpDelImg ==null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }
	var answer;
	answer = confirm_delImg();	
	if(eval(answer) == true)
	{		
		var url = str;	
		xmlHttpDelImg .onreadystatechange = performDeleteImg ;	
		xmlHttpDelImg .open("GET",url,true);	
		xmlHttpDelImg .send(null);
	}
	else
	return;
	
	
} 
function performDeleteImg() 
{ 
	if (xmlHttpDelImg .readyState == 4)
	 { 		
		document.getElementById("delete_img").innerHTML = xmlHttpDelImg .responseText ;			
		  
	 }  
}

// to perform delete restaurant photo
function DeletePhoto(str)
{	
	xmlHttpDelImg = GetXmlHttpObject();	
	

	 if (xmlHttpDelImg ==null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }
	var answer;
	answer = confirm_delImg();	
	if(eval(answer) == true)
	{		
		var url = str;	
		xmlHttpDelImg .onreadystatechange = deletePhoto ;	
		xmlHttpDelImg .open("GET",url,true);	
		xmlHttpDelImg .send(null);
	}
	else
	return;
	
	
} 
function deletePhoto() 
{ 
	if (xmlHttpDelImg.readyState == 4)
	 { 		
		document.getElementById("restaurant_photo").innerHTML = xmlHttpDelImg.responseText ;			
		  
	 }  
}

function showList(str)
{	
	xmlHttpObj = GetXmlHttpObject();	
	
	document.getElementById("list").innerHTML = loadstatustext;
	 if (xmlHttpObj == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }	

	var url = str;	

	xmlHttpObj.onreadystatechange = displayPage ;	
	xmlHttpObj.open("GET",url,true);	
	xmlHttpObj.send(null);
} 
function displayPage() 
{ 
	if (xmlHttpObj.readyState == 4)
	 { 	
		document.getElementById("list").innerHTML = xmlHttpObj.responseText ;	
		  //document.getElementById("content").innerHTML=""
		  
	 }  
}

function SearchRecords(str)
{	
	xmlHttpforgetpass = GetXmlHttpObject();	
	
	document.getElementById("list").innerHTML = loadstatustext;
	 if (xmlHttpforgetpass == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }	
	//alert(document.getElementById('search_text').value);
	fld_search_text = encode64(document.getElementById('search_text').value);
	//alert(fld_search_text);
	fld_search_by = document.getElementById('search_by')[document.getElementById('search_by').selectedIndex].value;
	fld_from_date = document.getElementById('from_date').value;
	fld_to_date = document.getElementById('to_date').value;
	fld_rpp = document.getElementById('rpp').value;
	
	
	/*for (var i=0; i < document.frmsearch.fld_concat.length; i++)
	{
		if (document.frmsearch.fld_concat[i].checked)
		  {
			 var fld_concat = document.frmsearch.fld_concat[i].value;
		  }
	}*/

	//var url = str+"&fld_search_text="+fld_search_text+"&fld_search_by="+fld_search_by+"&fld_from_date="+fld_from_date+"&fld_to_date="+fld_to_date+"&fld_concat="+fld_concat+"&fld_rpp="+fld_rpp;	
	var url = str+"&fld_search_text="+fld_search_text+"&fld_search_by="+fld_search_by+"&fld_from_date="+fld_from_date+"&fld_to_date="+fld_to_date+"&fld_rpp="+fld_rpp;	

	xmlHttpforgetpass.onreadystatechange = displayResult ;	
	xmlHttpforgetpass.open("GET",url,true);	
	xmlHttpforgetpass.send(null);
} 
function displayResult() 
{ 
	if (xmlHttpforgetpass.readyState == 4)
	 { 	
		document.getElementById("list").innerHTML = xmlHttpforgetpass.responseText ;	
		  //document.getElementById("content").innerHTML=""
		  
	 }  
}

// to perform delete records from list
function DeleteRecords(str)
{	
	xmlHttpDelImg = GetXmlHttpObject();	
	

	 if (xmlHttpDelImg ==null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }
	var answer;
	answer = confirm_delRec();
	if(eval(answer) == true)
	{		
		var url = str;	
		xmlHttpDelImg .onreadystatechange = deleteRec ;	
		xmlHttpDelImg .open("GET",url,true);	
		xmlHttpDelImg .send(null);
	}
	else
	return;
	
	
} 
function deleteRec() 
{ 
	if (xmlHttpDelImg.readyState == 4)
	 { 		
		document.getElementById("list").innerHTML = xmlHttpDelImg.responseText ;			
		  
	 }  
}

// to check availability of username
function checkAvailability(str)
{	
	xmlHttp = GetXmlHttpObject();
	
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }   
	  
	username = document.getElementById('fld_username').value;
	
	var url = str+"&username="+username;
	//alert(url);
	xmlHttp.onreadystatechange = displayMsg ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function displayMsg() 
{ 
	if (xmlHttp.readyState == 4)
	 { 
		document.getElementById("username_div").innerHTML = xmlHttp.responseText ;	
		  //document.getElementById("content").innerHTML=""
		  
	 }  
}

// to generate password
function passwordGenerator(str)
{	
	xmlHttp = GetXmlHttpObject();
	
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }   
	
	var url = str;
	
	xmlHttp.onreadystatechange = displayPass ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function displayPass() 
{ 
	if (xmlHttp.readyState == 4)
	 { 	 
	 	gen_password = xmlHttp.responseText;
		
	 	if(confirm("Generated password is := "+gen_password+""))
		{
			document.getElementById("fld_password").value = xmlHttp.responseText ;	
			document.getElementById("fld_confirm_password").value = xmlHttp.responseText ;
		}
		  //document.getElementById("content").innerHTML=""
	 }  
}

function SearchRating(str)
{	
	xmlHttpforgetpass = GetXmlHttpObject();	
	
	document.getElementById("list").innerHTML = loadstatustext;
	 if (xmlHttpforgetpass == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }	
	
	restaurant_id = document.getElementById('restaurant_id').value;
	fld_search_text = document.getElementById('search_text').value;
	fld_search_option = document.getElementById('search_option').value;
	fld_search_by = document.getElementById('search_by')[document.getElementById('search_by').selectedIndex].value;
	fld_from_date = document.getElementById('from_date').value;
	fld_to_date = document.getElementById('to_date').value;
	fld_rpp = document.getElementById('rpp').value;
	
	
	/*for (var i=0; i < document.frmsearch.fld_concat.length; i++)
	{
		if (document.frmsearch.fld_concat[i].checked)
		  {
			 var fld_concat = document.frmsearch.fld_concat[i].value;
		  }
	}*/

	//var url = str+"&fld_search_text="+fld_search_text+"&fld_search_by="+fld_search_by+"&fld_from_date="+fld_from_date+"&fld_to_date="+fld_to_date+"&fld_concat="+fld_concat+"&fld_rpp="+fld_rpp;	
	var url = str+"&fld_search_text="+fld_search_text+"&fld_search_option="+fld_search_option+"&fld_search_by="+fld_search_by+"&fld_from_date="+fld_from_date+"&fld_to_date="+fld_to_date+"&fld_rpp="+fld_rpp+"&restaurant_id="+restaurant_id;	

	xmlHttpforgetpass.onreadystatechange = displayRating ;	
	xmlHttpforgetpass.open("GET",url,true);	
	xmlHttpforgetpass.send(null);
} 
function displayRating() 
{ 
	if (xmlHttpforgetpass.readyState == 4)
	 { 	
		document.getElementById("list").innerHTML = xmlHttpforgetpass.responseText ;	
		  //document.getElementById("content").innerHTML=""
		  
	 }  
}

// to perform send newsletter
function SendNewsletter(str)
{	
	xmlHttpDelImg = GetXmlHttpObject();	
	

	 if (xmlHttpDelImg ==null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }
	var answer;
	answer = confirm_sendNewletter();	
	if(eval(answer) == true)
	{		
		var url = str;	
		xmlHttpDelImg .onreadystatechange = sendRec ;	
		xmlHttpDelImg .open("GET",url,true);	
		xmlHttpDelImg .send(null);
	}
	else
	return;
	
	
} 
function sendRec() 
{ 
	if (xmlHttpDelImg.readyState == 4)
	 { 		
		document.getElementById("list").innerHTML = xmlHttpDelImg.responseText ;			
		  
	 }  
}

function showBookmark(str,key)
{	
	xmlHttp=GetXmlHttpObject();
	bokkmarkId = "bookmark_id_"+key;
	//document.getElementById(bokkmarkId).innerHTML = loadstatustext;
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str+'&key='+key;

	xmlHttp.onreadystatechange=stateBookmarkChanged ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function stateBookmarkChanged() 
{ 
	if (xmlHttp.readyState == 4)
	 { 
		document.getElementById(bokkmarkId).innerHTML = xmlHttp.responseText ;	
		  //document.getElementById("content").innerHTML=""		  
	 }  
}

function displayUserRating(url)
{	
	xmlHttp=GetXmlHttpObject();
	document.getElementById('user_rating').innerHTML = loadstatustext;
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
  }    


	xmlHttp.onreadystatechange=stateUserRatingChanged ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function stateUserRatingChanged() 
{ 
	if (xmlHttp.readyState == 4)
	 { 

		document.getElementById('user_rating').innerHTML = xmlHttp.responseText ;	
		  //document.getElementById("content").innerHTML=""		  
	 }  
}


//For displaying searchAction form

function displayFeatVal(str)
{	
//alert(id);
	xmlHttp=GetXmlHttpObject();
	document.getElementById("featVal").innerHTML = loadstatustext;
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;
	//txt_search = document.getElementById('searchText').value;
	//txt_search = document.getElementById("searchText").value;
	
	s = document.getElementById("fld_feat");
	featId = s.options[s.options.selectedIndex].value;
	
	url = url+"&featId="+featId;
	
	//alert(url);
	xmlHttp.onreadystatechange = displayFeatValChanged ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function displayFeatValChanged() 
{ 
	if (xmlHttp.readyState == 4)
	 { 
		document.getElementById("featVal").innerHTML = xmlHttp.responseText ;	
	 }    
}

//For displaying searchAction form

function display_feat_val(str)
{	
//alert(id);
	xmlHttp=GetXmlHttpObject();
	document.getElementById("featVal").innerHTML = loadstatustext;
	if (xmlHttp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str;
	//txt_search = document.getElementById('searchText').value;
	//txt_search = document.getElementById("searchText").value;
	
	//s = document.getElementById("fld_feat");
	//featId = s.options[s.options.selectedIndex].value;
	
	//url = url+"&featId="+featId;
	
	//alert(url);
	xmlHttp.onreadystatechange = display_feat_valChanged ;	
	xmlHttp.open("GET",url,true);	
	xmlHttp.send(null);
} 
function display_feat_valChanged() 
{ 
	if (xmlHttp.readyState == 4)
	 { 
		document.getElementById("featVal").innerHTML = xmlHttp.responseText ;	
	 }    
}

function showMoreValues(str,key)
{
	content = 'more_'+key;
	xmlHttprestratedisp=GetXmlHttpObject();
	
	document.getElementById(content).innerHTML = loadstatustext;
	if (xmlHttprestratedisp == null)
	  {
		  alert ("Browser does not support HTTP Request");
		  return;
	  }    
	var url=str+'&divId='+key;

	if (key == '1')
	{
		if (document.getElementById('more_2'))
		{
			document.getElementById('more_2').innerHTML = '';
		}
		if (document.getElementById('more_3'))
		{
			document.getElementById('more_3').innerHTML = '';
		}
	}
	else if (key == '2')
	{
		if (document.getElementById('more_1'))
		{
			document.getElementById('more_1').innerHTML = '';
		}
		if (document.getElementById('more_3'))
		{
			document.getElementById('more_3').innerHTML = '';
		}
	}
	else if (key == '3')
	{
		if (document.getElementById('more_1'))
		{
			document.getElementById('more_1').innerHTML = '';
		}
		if (document.getElementById('more_2'))
		{
			document.getElementById('more_2').innerHTML = '';
		}
	}
	
	xmlHttprestratedisp.onreadystatechange=stateChangedMoreVal ;	
	xmlHttprestratedisp.open("GET",url,true);	
	xmlHttprestratedisp.send(null);
} 
function stateChangedMoreVal() 
{ 
	if (xmlHttprestratedisp.readyState == 4)
	 { 
		document.getElementById(content).innerHTML = xmlHttprestratedisp.responseText ;	
	 }  
}

