// JavaScript Document
// This script deals with navigating functions on the page
// Author: Ken Toh
// Date: 

// VXL: UpdFunnelList and related functions moved to database_related_addons.js

function UpdPhoneList(strURL)
{
    document.getElementById("devices").innerHTML = "<img src='http://www.amob.com/images/loading.gif'> Loading ";
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest)
    { self.xmlHttpReq = new XMLHttpRequest(); }
    else if (window.ActiveXObject)
    { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() { if (self.xmlHttpReq.readyState == 4) { hpdupdatepage(self.xmlHttpReq.responseText); } }
    self.xmlHttpReq.send(hpdgetquerystring());
}

function hpdgetquerystring() { var page = document.getElementById("hpmanufacturer").value; qstr = 'w=' + escape(page);  return qstr; }
function hpdupdatepage(str){ document.getElementById("devices").innerHTML = str; }

function UpdLangList(strURL, countryCode)
{
    document.getElementById("languages").innerHTML = "<div id='language'><img src='http://www.amob.com/images/loading.gif' align='absmiddle' /> &nbsp Loading.. </div>";
    var xmlHttpReq = false; 
    var self = this; 
    if (window.XMLHttpRequest) 
    { self.xmlHttpReq = new XMLHttpRequest(); }
    else if (window.ActiveXObject) 
    { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() { if (self.xmlHttpReq.readyState == 4) { lanupdatepage(self.xmlHttpReq.responseText); } }
    self.xmlHttpReq.send(langetquerystring(countryCode));
}


function hidesg(delay){
	string="waitsg("+delay+");";
	setTimeout(string,delay);
}

function waitsg(delay){
	id = document.getElementById("languagesg").style;
	id.display = "none";
}

function hidemy(delay){
	string="waitmy("+delay+");";
	setTimeout(string,delay);
}

function waitmy(delay){
	id = document.getElementById("languagemy").style;
	id.display = "none";
}

function hideth(delay){
	string="waitth("+delay+");";
	setTimeout(string,delay);
}

function waitth(delay){
	id = document.getElementById("languageth").style;
	id.display = "none";
}

function hideid(delay){
	string="waitid("+delay+");";
	setTimeout(string,delay);
}

function waitid(delay){
	id = document.getElementById("languageid").style;
	id.display = "none";
}

function hideph(delay){
	string="waitph("+delay+");";
	setTimeout(string,delay);
}

function waitph(delay){
	id = document.getElementById("languageph").style;
	id.display = "none";
}

function hidevn(delay){
	string="waitvn("+delay+");";
	setTimeout(string,delay);
}

function waitvn(delay){
	id = document.getElementById("languagevn").style;
	id.display = "none";
}



function showmy()
{
   id = document.getElementById("languagemy").style;
   id.display = "block";
}

function showsg()
{
   id = document.getElementById("languagesg").style;
   id.display = "block";
}

function showth()
{
   id = document.getElementById("languageth").style;
   id.display = "block";
}

function showid()
{
   id = document.getElementById("languageid").style;
   id.display = "block";
}

function showph()
{
   id = document.getElementById("languageph").style;
   id.display = "block";
}

function showvn()
{
   id = document.getElementById("languagevn").style;
   id.display = "block";
}

function longdescshow()
{
   id = document.getElementById("longdesc").style;
   id.display = "block";
   longdesclink2();
   longdesclinkhide();
   
}

function longdeschide()
{
   id = document.getElementById("longdesc").style;
   id.display = "none";
   longdesclink2hide();
   longdesclink();
   
}

function longdesclink()
{
   id = document.getElementById("longdesclink").style;
   id.display = "block";
}

function longdesclinkhide()
{
   id = document.getElementById("longdesclink").style;
   id.display = "none";
}

function longdesclink2()
{
   id = document.getElementById("longdesclink2").style;
   id.display = "block";
}

function longdesclink2hide()
{
   id = document.getElementById("longdesclink2").style;
   id.display = "none";
}







function compatshow()
{
   id = document.getElementById("compat").style;
   id.display = "inline";
   compatlink2();
   compatlinkhide();
   
}

function compathide()
{
   id = document.getElementById("compat").style;
   id.display = "none";
   compatlink2hide();
   compatlink();
   
}

function compatlink()
{
   id = document.getElementById("compatlink").style;
   id.display = "inline";
}

function compatlinkhide()
{
   id = document.getElementById("compatlink").style;
   id.display = "none";
}

function compatlink2()
{
   id = document.getElementById("compatlink2").style;
   id.display = "inline";
}

function compatlink2hide()
{
   id = document.getElementById("compatlink2").style;
   id.display = "none";
}









function instructshow()
{
   id = document.getElementById("instruct").style;
   id.display = "inline";
   instructlink2();
   instructlinkhide();
   
}

function instructhide()
{
   id = document.getElementById("instruct").style;
   id.display = "none";
   instructlink2hide();
   instructlink();
   
}

function instructlink()
{
   id = document.getElementById("instructlink").style;
   id.display = "inline";
}

function instructlinkhide()
{
   id = document.getElementById("instructlink").style;
   id.display = "none";
}

function instructlink2()
{
   id = document.getElementById("instructlink2").style;
   id.display = "inline";
}

function instructlink2hide()
{
   id = document.getElementById("instructlink2").style;
   id.display = "none";
}





function instructdcshow()
{
   id = document.getElementById("instructdc").style;
   id.display = "inline";
   instructdclink2();
   instructdclinkhide();
   
}

function instructdchide()
{
   id = document.getElementById("instructdc").style;
   id.display = "none";
   instructdclink2hide();
   instructdclink();
   
}

function instructdclink()
{
   id = document.getElementById("instructdclink").style;
   id.display = "inline";
}

function instructdclinkhide()
{
   id = document.getElementById("instructdclink").style;
   id.display = "none";
}

function instructdclink2()
{
   id = document.getElementById("instructdclink2").style;
   id.display = "inline";
}

function instructdclink2hide()
{
   id = document.getElementById("instructdclink2").style;
   id.display = "none";
}





function instructecshow()
{
   id = document.getElementById("instructec").style;
   id.display = "inline";
   instructeclink2();
   instructeclinkhide();
   
}

function instructechide()
{
   id = document.getElementById("instructec").style;
   id.display = "none";
   instructeclink2hide();
   instructeclink();
   
}

function instructeclink()
{
   id = document.getElementById("instructeclink").style;
   id.display = "inline";
}

function instructeclinkhide()
{
   id = document.getElementById("instructeclink").style;
   id.display = "none";
}

function instructeclink2()
{
   id = document.getElementById("instructeclink2").style;
   id.display = "inline";
}

function instructeclink2hide()
{
   id = document.getElementById("instructeclink2").style;
   id.display = "none";
}














function notcompatshow()
{
   id = document.getElementById("notcompat").style;
   id.display = "inline";
   notcompatlink2();
   notcompatlinkhide();
   
}

function notcompathide()
{
   id = document.getElementById("notcompat").style;
   id.display = "none";
   notcompatlink2hide();
   notcompatlink();
   
}

function notcompatlink()
{
   id = document.getElementById("notcompatlink").style;
   id.display = "inline";
}

function notcompatlinkhide()
{
   id = document.getElementById("notcompatlink").style;
   id.display = "none";
}

function notcompatlink2()
{
   id = document.getElementById("notcompatlink2").style;
   id.display = "inline";
}

function notcompatlink2hide()
{
   id = document.getElementById("notcompatlink2").style;
   id.display = "none";
}










function hideTabFeatured()
{
   id = document.getElementById("showTabFeatured").style;
   id.display = "none";
}

function hideTabLatest()
{
   id = document.getElementById("showTabLatest").style;
   id.display = "none";
}

function hideTabHottest()
{
   id = document.getElementById("showTabHottest").style;
   id.display = "none";
}

function showTabFeatured()
{
   id = document.getElementById("showTabFeatured").style;
   id.display = "block";
   hideTabLatest();
   hideTabHottest();
}

function showTabLatest()
{
   id = document.getElementById("showTabLatest").style;
   id.display = "block";
   hideTabFeatured();
   hideTabHottest();
}

function showTabHottest()
{
   id = document.getElementById("showTabHottest").style;
   id.display = "block";
   hideTabLatest();
   hideTabFeatured();
}


function langetquerystring(countryCode) { qstr = 'w=' + escape(countryCode);  return qstr; }
function lanupdatepage(str){ document.getElementById("languages").innerHTML = str; }

function UpdCarrierList(strURL)
{
    document.getElementById("carriers").innerHTML = "<img src='http://www.amob.com/images/loading.gif'> Loading ";
    var xmlHttpReq = false; 
    var self = this; 
    if (window.XMLHttpRequest) 
    { self.xmlHttpReq = new XMLHttpRequest(); }
    else if (window.ActiveXObject) 
    { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() { if (self.xmlHttpReq.readyState == 4) { carupdatepage(self.xmlHttpReq.responseText); } }
    self.xmlHttpReq.send(cargetquerystring());
}
function cargetquerystring() { var page = document.getElementById("country").value; qstr = 'w=' + escape(page);  return qstr; }
function carupdatepage(str){ document.getElementById("carriers").innerHTML = str; }

function UpdGenreList(strURL)
{
    document.getElementById("genre").innerHTML = "<img src='http://www.amob.com/images/loading.gif'> Loading ";
    var xmlHttpReq = false; 
    var self = this; 
    if (window.XMLHttpRequest) 
    { self.xmlHttpReq = new XMLHttpRequest(); }
    else if (window.ActiveXObject) 
    { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() { if (self.xmlHttpReq.readyState == 4) { genupdatepage(self.xmlHttpReq.responseText);} }	
    self.xmlHttpReq.send(gengetquerystring());
}
function gengetquerystring() { var page = document.getElementById("type").value; qstr = 'w=' + escape(page);  return qstr; }
function genupdatepage(str){ document.getElementById("genre").innerHTML = str; }
