<!-- alterValue(this, 'nome'); -->
browser = {
    'isFF' : (navigator.userAgent.indexOf("Firefox") > -1),
    'isIE' : (navigator.userAgent.indexOf("MSIE") > -1),
    'isIE6': (navigator.userAgent.indexOf("MSIE 6") > -1),
    'isIE7': (navigator.userAgent.indexOf("MSIE 7") > -1),
    'isIE8': (navigator.userAgent.indexOf("MSIE 8") > -1),
    'isOpera' : (navigator.userAgent.indexOf("Opera") > -1),
    'isSafari': (navigator.userAgent.indexOf("Safari") > -1)
}
function alterValue(component, val) {
    if (component.value == '') {
        component.value = val;
    } else if (component.value == val) {
        component.value = '';
    }
}

/**
 * Preenche uma combo box a partir de um array
*/
function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) {
    var i, j;
    var prompt;
    
    if ((itemArray == '0') || (itemArray == -1) || (itemArray == null)) {
        selectCtrl.disabled = true;
    } else {
        selectCtrl.disabled = false;
    }
    
    // empty existing items
    for (i = selectCtrl.options.length; i >= 0; i--) {
        selectCtrl.options[i] = null; 
    }
    prompt = (itemArray != null) ? goodPrompt : badPrompt;
    if (prompt == null) {
        j = 0;
    } else {
        selectCtrl.options[0] = new Option(prompt);
        j = 1;
    }
    if (itemArray != null) {
        // add new items
        for (i = 0; i < itemArray.length; i++) {
            selectCtrl.options[j] = new Option(itemArray[i][0]);
            if (itemArray[i][1] != null) {
                selectCtrl.options[j].value = itemArray[i][1]; 
            }
            j++;
        }
        // select first item (prompt) for sub list
        selectCtrl.options[0].selected = true;
    }
}


function getFooter(){

  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

	var footer_height = $('footer').offsetHeight;
	var content_height = $('container').offsetHeight;
 	var footer_full_height = myHeight - (footer_height + content_height) + footer_height;

if(footer_full_height > 53){
	$('footer').style.height = footer_full_height + 'px';
}
/*
	setTimeout("getFooter()",30);
*/
}

function initApp(){
	initSlideDownMenu();
}

function initApp2(){
	initSlideDownMenu();
	mapLoad();
}
