var xmlHttp

function showUser(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="get.php"
url=url+"?q="+str
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHint").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;
}

//inner content

function showCard(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="generate2.php"
url=url+"?cno="+str
xmlHttp.onreadystatechange=contentChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function contentChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtContent").innerHTML=xmlHttp.responseText 
 } 
}

function Preview()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="cardpreview.php"
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

// tabs !!!

function showTab(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url=str+".php"
xmlHttp.onreadystatechange=tabChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function tabChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtContent").innerHTML=xmlHttp.responseText 
 } 
}

// card categories !!!

function showCategory(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="get2.php"
url=url+"?q="+str
xmlHttp.onreadystatechange=categoryChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function categoryChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("categoryContent").innerHTML=xmlHttp.responseText 
 } 
}

//inner content 2 test

function showCard2(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="generate2.php"
url=url+"?cno="+str
xmlHttp.onreadystatechange=contentChanged2 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
document.getElementById('test').style.display = 'inline' //turns on DIV again
}

function contentChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("test").innerHTML=xmlHttp.responseText 
 } 
}

// card operations

//inner content 2 test

function FormClick (act) {
  var str = $("#f1").serialize();
  $.post(act+".php", str, function(data) {
    $("#test").html(data);
  });
}

