var xmlhttp;
function updateRecrank(rec_id,order,div_id)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?rec_id="+rec_id;
url=url+"&order="+order;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}


function addTOfav(rec_id,section,div_id,album_id)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?rec_id="+rec_id;
url=url+"&section="+section;
url=url+"&album_id="+album_id;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function updateRectest(rec_id,section,state,div_id)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?rec_id="+rec_id;
url=url+"&section="+section;
url=url+"&state="+state;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function changePagenum(page_no,section,div_id,target_id)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?page_no="+page_no;
url=url+"&section="+section;
url=url+"&div_id="+div_id;
url=url+"&target_id="+target_id;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function showRecipelist(qsubject_id,section,div_id)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?qsubject_id="+qsubject_id;
url=url+"&section="+section;
url=url+"&div_id="+div_id;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function updateVideoview(mov_id,section,div_id,m_url,name)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?mov_id="+mov_id;
url=url+"&section="+section;
url=url+"&div_id="+div_id;
url=url+"&m_url="+m_url;
url=url+"&name="+name;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("Content-Type", "text/HTML");
xmlhttp.setRequestHeader("CharSet", "UTF-8");
xmlhttp.send(null);

return id;
}

function recipeAction(rec_id,friendly_name,section,div_id,load_id)
{
	L_id = load_id;
	document.getElementById(L_id).style.display = 'block';
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?rec_id="+rec_id;
url=url+"&friendly_name="+friendly_name;
url=url+"&section="+section;
url=url+"&div_id="+div_id;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("Content-Type", "text/HTML");
xmlhttp.setRequestHeader("CharSet", "UTF-8");
xmlhttp.send(null);

return id;
}


function subjectAction(apart_id,section,div_id,album_id,symbol,data_kind,page_no,type,sec_url,load_id)
{
	L_id = load_id;
	/*alert('This is what an alert message looks like.');*/
	document.getElementById(L_id).style.display = 'block';
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?apart_id="+apart_id;
url=url+"&section="+section;
url=url+"&div_id="+div_id;
url=url+"&album_id="+album_id;
url=url+"&symbol="+symbol;
url=url+"&data_kind="+data_kind;
url=url+"&page_no="+page_no;
url=url+"&type="+type;
url=url+"&sec_url="+sec_url;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("Content-Type", "text/HTML");
xmlhttp.setRequestHeader("CharSet", "UTF-8");
xmlhttp.send(null);

return id;
}

function closeDiv(mov_id,section,div_id)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?mov_id="+mov_id;
url=url+"&section="+section;
url=url+"&div_id="+div_id;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function close_d(div_id,section )
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?section="+section;


id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function updateCounter(other_id,section,div_id)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?other_id="+other_id;
url=url+"&section="+section;
url=url+"&div_id="+div_id;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function yes_user_action(section,div_id,load_id)
{
	L_id = load_id;
	/*alert('This is what an alert message looks like.');*/
	document.getElementById(L_id).style.display = 'block';
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?section="+section;
url=url+"&div_id="+div_id;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("Content-Type", "text/HTML");
xmlhttp.setRequestHeader("CharSet", "UTF-8");
xmlhttp.send(null);

return id;
}


function competition_action(section,phase,phase_sec,div_id,load_id)
{
	L_id = load_id;
	/*alert('This is what an alert message looks like.');*/
	document.getElementById(L_id).style.display = 'block';
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?section="+section;
url=url+"&phase="+phase;
url=url+"&phase_sec="+phase_sec;
url=url+"&div_id="+div_id;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("Content-Type", "text/HTML");
xmlhttp.setRequestHeader("CharSet", "UTF-8");
xmlhttp.send(null);

return id;
}



function ExamanswerAction(exam_id,section,answer_id,past_answer_id,div_id,load_id)
{
	L_id = load_id;
	document.getElementById(L_id).style.display = 'block';
	//alert (div_id);
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?section="+section;
url=url+"&exam_id="+exam_id;
url=url+"&answer_id="+answer_id;
url=url+"&past_answer_id="+past_answer_id;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function AdsAction(ad_id,section,country,size,div_id)
{

xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="majax.php";
url=url+"?ad_id="+ad_id;
url=url+"&section="+section;
url=url+"&country="+country;
url=url+"&size="+size;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function CategorySample(page_id,recipe_id,cat_id,cat_f_name,section,div_id,load_id)
{
	
	L_id = load_id;
	document.getElementById(L_id).style.display = 'block';
	//alert (div_id);
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?page_id="+page_id;
url=url+"&recipe_id="+recipe_id;
url=url+"&cat_id="+cat_id;
url=url+"&cat_f_name="+cat_f_name;
url=url+"&section="+section;

id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}


function SearchAction(search_w,search_s,section,div_id,load_id)
{
	
	L_id = load_id;
	document.getElementById(L_id).style.display = 'block';
	//alert (div_id);
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?search_w="+search_w;
url=url+"&search_s="+search_s;
url=url+"&section="+section;


id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function Emaillist(section,email,div_id,load_id)
{
	L_id = load_id;
	document.getElementById(L_id).style.display = 'block';
	//alert (div_id);
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?section="+section;
url=url+"&email="+email;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function EmaillistClose(section,div_id,load_id)
{
	L_id = load_id;
	document.getElementById(L_id).style.display = 'block';
	//alert (div_id);
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?section="+section;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}



function VoteAction(vote,vote_id,section,div_id,load_id)
{
	L_id = load_id;
	document.getElementById(L_id).style.display = 'block';
	//alert (div_id);
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?vote="+vote;
url=url+"&vote_id="+vote_id;
url=url+"&section="+section;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}

function VideoTab(section,div_id,load_id)
{
	L_id = load_id;
	document.getElementById(L_id).style.display = 'block';

xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url=url_php+"majax.php";
url=url+"?section="+section;
id = div_id;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
return id;
}


function stateChanged()
{
if (xmlhttp.readyState==4)
{	
document.getElementById(id).style.display = 'block';
document.getElementById(id).innerHTML=xmlhttp.responseText;
if(L_id != ""){
		document.getElementById(L_id).style.display = 'none';
	}
}
}

function GetXmlHttpObject()
{
	
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
