// JavaScript Document
var xmlHttp;

function showusrmail(str)
{ //alert(str);
xmlHttp=GetXmlHttpObject()
 if(xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="getusermail.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=stateChangedok_12;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function updateusrmail(str)
{ 
xmlHttp=GetXmlHttpObject()
 if(xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="updateusermail.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=stateChangedok_12;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

var val;

function staffusrmail(str,vo)
{ 

xmlHttp=GetXmlHttpObject()
 if(xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="checkstaffcompany.php";
url=url+"?q="+str+"&no="+vo;
url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=staffstatechange;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function removestaff(str)
{ 
xmlHttp=GetXmlHttpObject()
 if(xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="remove_st.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=removestaffstatechange;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChangedok_12() 
{ 
if (xmlHttp.readyState==4)
{ 
var response=xmlHttp.responseText;

if(response==1)
{ 
    document.getElementById("something").innerHTML="This Id is not available.";	
	//document.getElementById("usremailn").focus();
	document.getElementById("email").value="";
	document.getElementById("email").focus();
	//document.getElementById("usrname").focus();
	
}
if(response==2)
{		
	document.getElementById("something").innerHTML="Available.";
	//document.getElementById("usrname").focus();
    //document.getElementById("password6").focus(); 	
	// document.getElementById("password6").focus();
}
if(response==3)
{		
	document.getElementById("something").innerHTML="Your Current Id.";
	//document.getElementById("usrname").focus();
    //document.getElementById("password6").focus(); 	
	// document.getElementById("password6").focus();
}
}
}

function staffstatechange() 
{ 
var va = document.getElementById("theValue").value;

if (xmlHttp.readyState==4)
	{ 
	if(xmlHttp.responseText!="" && xmlHttp.responseText!=2)
		{ 
			document.getElementById("hed_"+va).innerHTML = '<table border="0" cellpadding="1" cellspacing="3"><tr><td width="260px">Position</td><td width="230px">Company</td></tr></table>';
			document.getElementById("found_"+va).innerHTML = xmlHttp.responseText;	
		}
	else if(xmlHttp.responseText==2)
	{
		alert("ERROR: Information provided is incorrect.");
		
		}
	}
}

function removestaffstatechange() 
{ 
var va = document.getElementById("theValue").value;

if (xmlHttp.readyState==4)
	{ 
	if(xmlHttp.responseText!="")
		{ 
			document.getElementById("req").innerHTML = xmlHttp.responseText;	
		}
	}
}


//Color Widget.....

function bgcolor()
{ 
xmlHttp=GetXmlHttpObject()
 if(xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var va = document.getElementById("bgc1").value;

//alert(va);

var va1 = document.getElementById("bgc_br1").value;
var va2 = document.getElementById("bgc_l1").value;
var va3 = document.getElementById("bgc_h1").value;
var va4 = document.getElementById("htext").value;
var va5 = document.getElementById("bc_width").value;
var image=document.getElementById("nm1").value;
//var va6 = document.getElementById("bc_rows").value; &v6="+va6+"
//var va7 = document.getElementById("username").value;
//var va8 = document.getElementById("avatar").value;
//var va9 = document.getElementById("username").value;
//var va10 = document.getElementById("avatar").value;

if(va=="")
{
va="#2F639C";
}
if(va1=="")
{
va1="#FFFFFF";
}
if(va2=="")
{
va2="#FFFFFF";	
}
if(va3=="")
{
va3="#FFFFFF";	
}
if(va4=="")
{
va4="Recent Viewers";	
}
if(va5=="")
{
va5="240";	
}

/*if(va7=="")
{
va7=1;	
}
if(va9=="")
{
va9=0;	
}
*/
var url="setcolor.php";
var firstcolor=va.split('#');
var secondcolor=va1.split('#');
var thirdcolor=va2.split('#');
var fourthcolor=va3.split('#');
url=url+"?v5="+va5+"&v3="+fourthcolor[1]+"&v4="+va4+"&q="+firstcolor[1]+"&v1="+secondcolor[1]+"&v2="+thirdcolor[1]+"&noofimages="+image;
//url=url+"?v5="+va5+"&v4="+va4+"&v7="+va7+"&v8="+va8+"&v9="+va9+"&v10="+va10+"&q="+firstcolor[1]+"&v1="+va1+"&v2="+va2;&v8="+va8+"&v10="+va10+"
url=url+"&sid="+Math.random();

//url=url+nval;
//alert(url);
xmlHttp.onreadystatechange=setcolorstatechange;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function setcolorstatechange()
{
if (xmlHttp.readyState==4)
	{ 
	if(xmlHttp.responseText!="")
		{ 
		var resp = xmlHttp.responseText;	
	   	document.getElementById("wid").innerHTML = resp;
	//	document.getElementById("bc_code").innerHTML = resp;
		document.getElementById("bc_code").value = resp;
		}
	}
}



//Color Widget Ends here...
//document.getElementById("bc_code1").innerHTML = resp;
//alert(str);

function eventdate(str)
{ 

xmlHttp=GetXmlHttpObject()
 if(xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="cal_event.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=eventstatechange;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function eventstatechange() 
{ 

if (xmlHttp.readyState==4)
	{ 
	if(xmlHttp.responseText!="")
		{ 
			document.getElementById("jenil").innerHTML = xmlHttp.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;
}



