// JavaScript Document

var xmlhttp
var xmlhttp1
var xmlhttp2
var xmlhttpWhyQuotes1

function showArtistName()
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Your browser does not support XMLHTTP!");
  return;
  }
var url="show_weekly_detail.php";
url=url+"?act=gtName&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
if (xmlhttp.readyState==4)
  {
  document.getElementById("Artist_name").innerHTML=xmlhttp.responseText;
  }
 // alert("called");
}








function showArtistTime()
{
xmlhttp1=GetXmlHttpObject();

if (xmlhttp1==null)
  {
  alert ("Your browser does not support XMLHTTP!");
  return;
  }
var url="show_weekly_detail.php";
url=url+"?act=gtDate&sid="+Math.random();
xmlhttp1.onreadystatechange=stateChanged1;
xmlhttp1.open("GET",url,true);
xmlhttp1.send(null);
}

function stateChanged1()
{
if (xmlhttp1.readyState==4)
  {
  document.getElementById("Artist_time").innerHTML=xmlhttp1.responseText;
  }
}


function showWhatsHotDates()
{
xmlhttp2=GetXmlHttpObject();

if (xmlhttp2==null)
  {
  alert ("Your browser does not support XMLHTTP!");
  return;
  }
var url="show_weekly_detail.php";
url=url+"?act=shDate&sid="+Math.random();
xmlhttp2.onreadystatechange=stateChanged2;
xmlhttp2.open("GET",url,true);
xmlhttp2.send(null);
}

function stateChanged2()
{
if (xmlhttp2.readyState==4)
  {
  document.getElementById("whatsHot_time").innerHTML=xmlhttp2.responseText;
  }
}



function addWhyQuotes()
{
xmlhttpWhyQuotes1=GetXmlHttpObject();

if (xmlhttpWhyQuotes1==null)
  {
  alert ("Your browser does not support XMLHTTP!");
  return;
  }
var url="add_user_whyQuotes.php";
var quotes=document.getElementById('txtAQuotes').value;
var qname=document.getElementById('txtName').value;
var qemail=document.getElementById('txtEmail').value;


url=url+"?quotes="+quotes+"&qname="+qname+"&qemail="+qemail+"&act=addQ&sid="+Math.random();
xmlhttpWhyQuotes1.onreadystatechange=stateChangedWhyQuotes;
xmlhttpWhyQuotes1.open("GET",url,true);
xmlhttpWhyQuotes1.send(null);
}

function stateChangedWhyQuotes()
{
if (xmlhttpWhyQuotes1.readyState==4)
  {
 	alert (xmlhttpWhyQuotes1.responseText);
	document.getElementById('txtAQuotes').value="";
	document.getElementById('txtName').value="";
	document.getElementById('txtEmail').value="";
  }
}











// common for all
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;
}
