
function openSupport() {
	window.open('/info/support/','ChatSupport','width=600,height=600');
}

function hideAll() {
	var temp = '';
	for (count = 65; count < 100; count++) {
		temp = temp + '|productList' + byteToChar(count);
		var el = document.getElementById('productList' + byteToChar(count));
		if (!(el == null)) {
			el.style.display='none';
		}
	}
}
function show(t) {
	document.getElementById('productList' + t).style.display='inline';
}

/*******************************************************************************************
* Generic AJAX functions 
*/
function loadAreaResponse() { 
	if (xmlHttpLoadAF.readyState == 4 || xmlHttpLoadAF.readyState == "complete")
		if(xmlHttpLoadAF.responseText != "") {
			ajaxArea.innerHTML = xmlHttpLoadAF.responseText;
		}
}

function loadArea(ajax) {

	ajaxArea = document.getElementById(ajax);

	ajaxArea.innerHTML = '<center><img src="/img/loading.gif">&nbsp;<i>...loading</i></center>';

	xmlHttpLoadAF = null
	if (window.XMLHttpRequest)
		xmlHttpLoadAF = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlHttpLoadAF = new ActiveXObject("Microsoft.XMLHTTP");
	
	if (xmlHttpLoadAF == null) {
		alert ("Browser does not support HTTP Request")
		return false
	}
	
	var currentTime = new Date()
	var url="/ajax/site." + ajax + ".php"
	url=url+"?uid=" + currentTime.getTime()
	xmlHttpLoadAF.onreadystatechange = loadAreaResponse
	xmlHttpLoadAF.open("GET",url,true)
	xmlHttpLoadAF.send(null)
}








/******
* Refresh Account Page
*/
function refreshAccountPage() {
	window.location='/account/view/' + document.getElementById('viewAccount').value;
}

function rechargeAccount(account) {
	window.location='/account/recharge/' + account;
}

/******
* Change Default Account
*/
function changeDefaultAccount(account) {
	window.location='/account/view/?id=' + account + '&default';
}



/******
* Load Add ANI
*/
function loadAddANI(account) {

	ajaxArea = document.getElementById('objForm1');
	ajaxArea.innerHTML = '<br /><br /><br /><br /><center><img src="/img/loading.gif">&nbsp;<i>...loading</i></center>';

	xmlHttpLoadAF = null
	if (window.XMLHttpRequest)
		xmlHttpLoadAF = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlHttpLoadAF = new ActiveXObject("Microsoft.XMLHTTP");
	
	if (xmlHttpLoadAF == null) {
		alert ("Browser does not support HTTP Request")
		return false
	}
	
	var currentTime = new Date()
	var url="/ajax/site.loadAddANI.php"
	url=url+"?uid=" + currentTime.getTime()
	url=url+'&id=' + account;
	xmlHttpLoadAF.onreadystatechange = loadAreaResponse
	xmlHttpLoadAF.open("GET",url,true)
	xmlHttpLoadAF.send(null)
}


/******
* Load Add Speed Dial
*/
function loadAddSpeed(account) {

	ajaxArea = document.getElementById('objForm1');
	ajaxArea.innerHTML = '<br /><br /><br /><br /><center><img src="/img/loading.gif">&nbsp;<i>...loading</i></center>';

	xmlHttpLoadAF = null
	if (window.XMLHttpRequest)
		xmlHttpLoadAF = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlHttpLoadAF = new ActiveXObject("Microsoft.XMLHTTP");
	
	if (xmlHttpLoadAF == null) {
		alert ("Browser does not support HTTP Request")
		return false
	}
	
	var currentTime = new Date()
	var url="/ajax/site.loadAddSpeed.php"
	url=url+"?uid=" + currentTime.getTime()
	url=url+'&id=' + account;
	xmlHttpLoadAF.onreadystatechange = loadAreaResponse
	xmlHttpLoadAF.open("GET",url,true)
	xmlHttpLoadAF.send(null)
}


/******
* Load Add DID
*/
function loadAddDID(account, type) {

	ajaxArea = document.getElementById('objForm1');
	ajaxArea.innerHTML = '<br /><br /><br /><br /><center><img src="/img/loading.gif">&nbsp;<i>...loading</i></center>';

	xmlHttpLoadAF = null
	if (window.XMLHttpRequest)
		xmlHttpLoadAF = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlHttpLoadAF = new ActiveXObject("Microsoft.XMLHTTP");
	
	if (xmlHttpLoadAF == null) {
		alert ("Browser does not support HTTP Request")
		return false
	}
	
	var currentTime = new Date()
	var url="/ajax/site.loadAddDID.php"
	url=url+"?uid=" + currentTime.getTime()
	url=url+'&id=' + account;
	url=url+'&type=' + type;
	xmlHttpLoadAF.onreadystatechange = loadAreaResponse
	xmlHttpLoadAF.open("GET",url,true)
	xmlHttpLoadAF.send(null)
}


/******
* Load Quick Dial
*/
function loadQuickDial(account, ani) {

	ajaxArea = document.getElementById('quickFiveArea');
	ajaxArea.innerHTML = '<br /><br /><br /><br /><center><img src="/img/loading.gif">&nbsp;<i>...loading</i></center>';

	xmlHttpLoadAF = null
	if (window.XMLHttpRequest)
		xmlHttpLoadAF = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlHttpLoadAF = new ActiveXObject("Microsoft.XMLHTTP");
	
	if (xmlHttpLoadAF == null) {
		alert ("Browser does not support HTTP Request")
		return false
	}
	
	var currentTime = new Date()
	var url="/ajax/site.loadQuickDial.php"
	url=url+"?uid=" + currentTime.getTime()
	url=url+'&id=' + account;
	url=url+'&ani=' + ani;
	xmlHttpLoadAF.onreadystatechange = loadAreaResponse
	xmlHttpLoadAF.open("GET",url,true)
	xmlHttpLoadAF.send(null)
}


/******
* Load Add Quick Dial
*/
function loadAddQuickDial(account, ani) {

	ajaxArea = document.getElementById('objForm1');
	ajaxArea.innerHTML = '<br /><br /><br /><br /><center><img src="/img/loading.gif">&nbsp;<i>...loading</i></center>';

	xmlHttpLoadAF = null
	if (window.XMLHttpRequest)
		xmlHttpLoadAF = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlHttpLoadAF = new ActiveXObject("Microsoft.XMLHTTP");
	
	if (xmlHttpLoadAF == null) {
		alert ("Browser does not support HTTP Request")
		return false
	}
	
	var currentTime = new Date()
	var url="/ajax/site.loadAddQuickDial.php"
	url=url+"?uid=" + currentTime.getTime()
	url=url+'&id=' + account;
	url=url+'&ani=' + ani;
	xmlHttpLoadAF.onreadystatechange = loadAreaResponse
	xmlHttpLoadAF.open("GET",url,true)
	xmlHttpLoadAF.send(null)
}

/******
* Load Account Label
*/
function loadTransfer(account) {

	ajaxArea = document.getElementById('objForm1');
	ajaxArea.innerHTML = '<br /><br /><br /><br /><center><img src="/img/loading.gif">&nbsp;<i>...loading</i></center>';

	xmlHttpLoadAF = null
	if (window.XMLHttpRequest)
		xmlHttpLoadAF = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlHttpLoadAF = new ActiveXObject("Microsoft.XMLHTTP");
	
	if (xmlHttpLoadAF == null) {
		alert ("Browser does not support HTTP Request")
		return false
	}
	
	var currentTime = new Date()
	var url="/ajax/site.loadTransfer.php"
	url=url+"?uid=" + currentTime.getTime()
	url=url+'&id=' + account;
	xmlHttpLoadAF.onreadystatechange = loadAreaResponse
	xmlHttpLoadAF.open("GET",url,true)
	xmlHttpLoadAF.send(null)
}




/******
* Load Account Label
*/
function loadChangeLabel(account) {

	ajaxArea = document.getElementById('objForm1');
	ajaxArea.innerHTML = '<br /><br /><br /><br /><center><img src="/img/loading.gif">&nbsp;<i>...loading</i></center>';

	xmlHttpLoadAF = null
	if (window.XMLHttpRequest)
		xmlHttpLoadAF = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlHttpLoadAF = new ActiveXObject("Microsoft.XMLHTTP");
	
	if (xmlHttpLoadAF == null) {
		alert ("Browser does not support HTTP Request")
		return false
	}
	
	var currentTime = new Date()
	var url="/ajax/site.loadChangeLabel.php"
	url=url+"?uid=" + currentTime.getTime()
	url=url+'&id=' + account;
	xmlHttpLoadAF.onreadystatechange = loadAreaResponse
	xmlHttpLoadAF.open("GET",url,true)
	xmlHttpLoadAF.send(null)
}


/******
* Load Add Account
*/
function loadAddAccount() {

	ajaxArea = document.getElementById('objForm1');
	ajaxArea.innerHTML = '<br /><br /><br /><br /><center><img src="/img/loading.gif">&nbsp;<i>...loading</i></center>';

	xmlHttpLoadAF = null
	if (window.XMLHttpRequest)
		xmlHttpLoadAF = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlHttpLoadAF = new ActiveXObject("Microsoft.XMLHTTP");
	
	if (xmlHttpLoadAF == null) {
		alert ("Browser does not support HTTP Request")
		return false
	}
	
	var currentTime = new Date()
	var url="/ajax/site.loadAddAccount.php"
	url=url+"?uid=" + currentTime.getTime()
	xmlHttpLoadAF.onreadystatechange = loadAreaResponse
	xmlHttpLoadAF.open("GET",url,true)
	xmlHttpLoadAF.send(null)
}




























var ajaxFunctions = new Array();







/*******************************************************************************************
* Specific AJAX functions 
*/


/******
* Load Add Expense
*/
function saveTrueFiveResponse() { 
	if (xmlHttpLoadAF.readyState == 4 || xmlHttpLoadAF.readyState == "complete")
		if(xmlHttpLoadAF.responseText != "") {
			ajaxArea.innerHTML = xmlHttpLoadAF.responseText;
		}
}
function saveTrueFive(account) {

	ajax = 'saveTrueFiveArea';

	ajaxArea = document.getElementById(ajax);
	ajaxArea.innerHTML = '<center><img src="/img/loading.gif">&nbsp;<i>...loading</i></center>';

	xmlHttpLoadAF = null
	if (window.XMLHttpRequest)
		xmlHttpLoadAF = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlHttpLoadAF = new ActiveXObject("Microsoft.XMLHTTP");
	
	if (xmlHttpLoadAF == null) {
		alert ("Browser does not support HTTP Request")
		return false
	}
	
	var currentTime = new Date()
	var url="/ajax/site.saveTrueFiveArea.php"
	url=url+"?uid=" + currentTime.getTime()
	url=url+'&id=' + account;
	url=url+'&ani=' + document.getElementById('ani').value;
	url=url+'&dest1=' + document.getElementById('dest1').value;
	url=url+'&dest2=' + document.getElementById('dest2').value;
	url=url+'&dest3=' + document.getElementById('dest3').value;
	url=url+'&dest4=' + document.getElementById('dest4').value;
	url=url+'&dest5=' + document.getElementById('dest5').value;
	url=url+'&label1=' + document.getElementById('label1').value;
	url=url+'&label2=' + document.getElementById('label2').value;
	url=url+'&label3=' + document.getElementById('label3').value;
	url=url+'&label4=' + document.getElementById('label4').value;
	url=url+'&label5=' + document.getElementById('label5').value;
	xmlHttpLoadAF.onreadystatechange = saveTrueFiveResponse
	xmlHttpLoadAF.open("GET",url,true)
	xmlHttpLoadAF.send(null)
}






