function updateList(){
	List = document.forms[0].carrier_on;
	if (List.length && List.options[0].value == 'temp') return;
	for (i=0;i<List.length;i++) {
		List.options[i].selected = true;
	}
	List = document.forms[0].area_code_on;
	if (List.length && List.options[0].value == 'temp') return;
	for (i=0;i<List.length;i++) {
		List.options[i].selected = true;
	}
}
function copyToList(from,to)
{
	fromList = eval('document.forms[0].' + from);
	toList = eval('document.forms[0].' + to);
	if (toList.options.length > 0 && toList.options[0].value == 'temp')
	{
		toList.options.length = 0;
	}
	var sel = false;
	for (i=0;i<fromList.options.length;i++)
	{
		var current = fromList.options[i];
		if (current.selected)
		{
			sel = true;
			if (current.value == 'temp')
			{
				alert ('You cannot move this text!');
				return;
			}
			txt = current.text;
			val = current.value;
			toList.options[toList.length] = new Option(txt,val);
			fromList.options[i] = null;
			i--;
		}
	}
	if (!sel) alert ('You haven\'t selected any options!');
}
function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
function tog(div, img, image1, image2){
	Effect.toggle(div,'appear',{afterFinish: function(){toggleImage(div,img, image1, image2)}});
}
function toggleImage(divId, imgId, image1, image2){
	divEl = document.getElementById(divId);
	imgEl = document.getElementById(imgId);
	if (divEl.style.display == ''){
		imgEl.src = image1;
	} else {
		imgEl.src = image2;
	}
}
function doHelpPopUp(page){
	window.open(page,"help","width=400,height=300,scrollbars=yes");
}
function countText(srcEl, targElId, maxVal, offset){
	if (typeof offset == 'undefined' || isNaN(offset)){
		offset = 0;
	}
	$(targElId).value =srcEl.value.length  + offset;
	if (srcEl.value.length + offset > maxVal){
		$(targElId).style.color='red';
	}
}
