﻿
function checkMaxLength(field, maxlimit) {
		if (field.value.length > maxlimit)
			field.value = field.value.substring(0, maxlimit);
}

function gototop() {
        window.location.href = window.location + "#";
}

function rollon1(a) {
	a.style.backgroundColor='#4C3400';
	a.style.cursor = 'hand';
	a.style.cursor = 'pointer';
}

function rolloff1(a) {
	a.style.backgroundColor='#775100';
}

function showPic (whichpic) {
	if (document.getElementById) {
		document.getElementById('placeholder').src = whichpic.href;
		return false;
	} 
	else {
		return true;
	}
}

function verifyImgDelete(redir_url) {

	var answer = confirm("Por favor confirme que desea borrar esta imagen.");
	if (answer) {
		window.location = redir_url;
		}
}

function go(what) {
    value = what.options[what.selectedIndex].value;
    if (value == "") return;
    window.location.href = value;
}

function toggleDivPNC() {

    if(document.getElementById("pnc").style.display == 'none'){
        document.getElementById("pnc").style.display = 'block';
        document.getElementById("cda").style.display = 'none';
        document.getElementById("main").style.display = 'none';
    }
  }
  
  function toggleDivCDA() {

    if(document.getElementById("cda").style.display == 'none'){
        document.getElementById("cda").style.display = 'block';
        document.getElementById("pnc").style.display = 'none';
        document.getElementById("main").style.display = 'none';
    }
  }


////original below:
//function toggleDiv(divid){
//    if(document.getElementById(divid).style.display == 'none'){
//      document.getElementById(divid).style.display = 'block';
//    }else{
//      document.getElementById(divid).style.display = 'none';
//    }
//  }
  
