function goTo(newLoc){
	var URL = newLoc.options[newLoc.selectedIndex].value;
	if(URL!=0){
		window.location.href = URL;
	}
}

function popUP(theURL,windowName,theWidth,theHeight){
	goMiddle = (screen.availHeight / 2) - (theHeight / 2);
	goCenter = (screen.availWidth / 2) - (theWidth / 2);
	window.open(theURL,windowName,"toolbar=0,menubar=no,location=0,scrollbars=no,resizable=no,width="+theWidth+",height="+theHeight+",left="+goCenter+",top="+goMiddle);
}

function popUPscroll(theURL,windowName,theWidth,theHeight){
	window.open(theURL,windowName,"toolbar=0,menubar=no,location=0,scrollbars=yes,resizable=yes,width="+theWidth+",height="+theHeight+",left=100,top=100");
}

function BillToShip() {
	document.info.shipping_address.value = document.info.address.value;
	document.info.shipping_address2.value = document.info.address2.value;
	document.info.shipping_city.value = document.info.city.value;
	document.info.shipping_zip.value = document.info.zip.value;
	document.info.shipping_state.value = document.info.state.value;
	document.info.shipping_country.value = document.info.country.value;
}

//confirm action popup message
function confirmAction(theMessage) {
	if(confirm(theMessage)){ return true ; }
	else{ return false ; }
}

//functions for form character counting
function getObject(obj) {
  var theObj;
  if(document.all) {
    if(typeof obj=="string") {
      return document.all(obj);
    } else {
      return obj.style;
    }
  }
  if(document.getElementById) {
    if(typeof obj=="string") {
      return document.getElementById(obj);
    } else {
      return obj.style;
    }
  }
  return null;
}

function Contar(entrada,salida,texto,caracteres) {
  var entradaObj=getObject(entrada);
  var salidaObj=getObject(salida);
  var longitud=caracteres - entradaObj.value.length;
  if(longitud <= 0) {
    longitud=0;
    texto='<span class="disable"> '+texto+' </span>';
    entradaObj.value=entradaObj.value.substr(0,caracteres);
  }
  salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
}

function toggle(id)
{
	if(document.getElementById(id).className=="hide")
	{
		document.getElementById(id).className="show";
		document.getElementById("triggerControl"+id).className="minus";
	}
	else
	{
		document.getElementById(id).className="hide";
		document.getElementById("triggerControl"+id).className="plus";
	}
}

function toggleIt(id)
{
	if(document.getElementById(id).className=="hideIt")
	{
		document.getElementById(id).className="showIt";
		document.getElementById("triggerControl"+id).className="minusIt";
	}
	else
	{
		document.getElementById(id).className="hideIt";
		document.getElementById("triggerControl"+id).className="plusIt";
	}
}

function confirmSubmit(theMessage)
{
var agree=confirm(theMessage);
if (agree)
	return true ;
else
	return false ;
}

