// Credit Card Table

function hide(theTable)
{
      obj = document.getElementsByTagName('TR');
       for (i=0; i<obj.length; i++)
     {
            if (obj[i].id == theTable)
          obj[i].style.display = 'none';
     }
}

function show(theTable)
{
     obj = document.getElementsByTagName('TR');
       for (i=0; i<obj.length; i++)
     {
            if (obj[i].id == theTable)
          obj[i].style.display = 'block';
     }
}

//Price Change script

var xmlHttp;function pricechng(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="get_price.php";
var id=document.getElementById("product_id").value
url=url+"?price="+str+"&product_id="+id;
url=url+"&sid="+Math.random();
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;
}

var xmlHttp2;function regpricechng(str)
{ 
xmlHttp2=GetXmlHttpObject2();
if (xmlHttp2==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="get_reg_price.php";
var id=document.getElementById("product_id").value
url=url+"?price="+str+"&product_id="+id;
url=url+"&sid="+Math.random();
xmlHttp2.onreadystatechange=stateChanged2;
xmlHttp2.open("GET",url,true);
xmlHttp2.send(null);
}function stateChanged2() 
{ 
if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
 { 
 document.getElementById("regpricechng").innerHTML=xmlHttp2.responseText;
 } 
}function GetXmlHttpObject2()
{
var xmlHttp2=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp2=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp2=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp2=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp2;
}

function modifyPerPage(str, value)
{ 

var url="?";
url=url+str+"&pp="+value;
window.location=window.location.pathname + url;

}
