﻿/*
  File         : Utils.js
  Company      : InterDev S.A.
  Creation Date: 2008-05-06
  Developer(s) : Nelson Rodriguez Caliz
  Summay       :
  History      : 1.0.0 Initial Release.
  
*/


//
function FillZeros(Campo){
	var ZSize = "";
	var Val = Campo.value;
	var Lng = Val.length;
	var MLng = Campo.maxLength;
	var Result;
	if(Lng > 0){
	for (i=Lng; i<MLng; i++){ZSize += "0"}}
	//
	Result = ZSize + Val;
	Campo.value = Result;
}

//
function OpenWindow(sURL)
{
   window.open(sURL,'Certificación','toolbar=no, menubar=no,resizable=no, top=50, left=50, scrollbars=yes,status=no,location=no,width=800' + ',height=560'); 
}



//
function OpenAnotherWin(URL)
{ 
  aWindow=window.open(URL,"Large","toolbar=no,width=520,height=500,status=no,scrollbars=yes,resize=no,menubars=no");
}



//
function GotoPage(PageLink) {

    location.href = PageLink;

}

//
function OpenAnotherWin(URL) {
    aWindow = window.open(URL, "ExternalPage", "");
}

//
function OpenAnotherWin(PageName, URL) {
    aWindow = window.open(URL, PageName, "");
}

//
function OpenWindow(sURL, sNewWindowName, sFeatures) {
    aWindow = window.open(sURL, sNewWindowName, sFeatures);
}

//
function OpenPopUpWindow(sURL, sNewWindowName, sFeatures) {
    window.open(sURL, sNewWindowName, sFeatures);
}


function Mouse_Over(target, bcolor) {
    //target.style.cursor = 'pointer';
    target.style.backgroundColor = (bcolor) ? bcolor : '#FFFBD2';
    //target.style.color = 'navy';
    target.style.fontStyle = 'normal';
}

function Mouse_Out(target, bcolor) {
    //target.style.cursor = 'pointer';
    target.style.backgroundColor = (bcolor) ? bcolor : 'White';
    //target.style.color = 'black';
    target.style.fontStyle = 'normal'
}

function Ms_Over(target, bcolor) {
    Mouse_Over(target, bcolor);
}

function Ms_Out(target, bcolor) {
    Mouse_Out(target, bcolor);
}

//
function __doConfirm(btnWaiter, _confirmMessage) {
    if (confirm(_confirmMessage)) {
        document.body.style.cursor = "wait";
        return true;
    } return false;
}

function newRollOver(targetDOMUrlName, URL) {
//    alert(targetDOMUrlName + ' ' + URL);

    targetDOMUrlName.src = URL;
/*    
    var img = document.images;
    var i = 0;
    for (i = 0; i < img.length; i++) {
        if (img[i].name == targetDOMUrlName) {
            img[i].src = URL;
            alert("Changed");
        }
    }
*/    
}

function uniqid()
{
  var newDate = new Date;
  return newDate.getTime(); 
} 

function PopWindow(w, h, URL) {
    //aWindow = window.open(URL, "Large", "toolbar=yes,width=" + w + ",height=" + h + ",status=no,scrollbars=yes,menubars=no,resize=yes");
    aWindow = window.open(URL, uniqid(), "");
    return false;
}


function ReFullSize() {
    $('img').fullsize(); 
}