// JavaScript Document
var cp=new cpaint();
cp.set_transfer_mode('get');
cp.set_response_type('xml');
//Load global event handler arrays
window.onloadListeners = new Array();
var roller_state=0;
var details_state=0;
var _debug=0;
var address_book_submit_shown =false;
var state_select_menu;

//create event handler queues
window.addOnLoadListener= function(listener)
{	
	window.onloadListeners[window.onloadListeners.length]=listener;
}
window.addLocationHandle = function(handle, obj)
{
	window.ajaxLocationHandle[handle]=obj;
}

function debug(msg)
{
	if(_debug==1)
	{
		current = document.getElementById('debug');
		current.innerHTML += '<p>'+msg+'</p>';	
	}
}

window.onload=function(){
	for(var i=0; i<window.onloadListeners.length;i++)
	{
		var func=window.onloadListeners[i];
		eval(func+"()");
	}
	//	monitorURL();
//	setInterval(monitorURL,500);
}
function number_format(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

function checkMe(el)
{
	//uncheck all other products and then re-check the one I clicked
	boxes = document.getElementById('product_roll').getElementsByTagName('input');
	for(i=0; i<boxes.length; i++)
	{
		boxes[i].checked=false;
	}
	document.getElementById(el).checked=true;
        document.getElementById("paneid").value = window.productGroupRoller.sections.current; //Save current pane index
}

function checkMe_details(el)
{
	//uncheck all other products and then re-check the one I clicked
	boxes = document.getElementById('product_details').getElementsByTagName('input');
	for(i=0; i<boxes.length; i++)
	{
		boxes[i].checked=false;
	}
	document.getElementById(el).checked=true;
        document.getElementById("paneid").value = window.productGroupRoller.sections.current; //Save current pane index
}


