﻿// -----------------------------------------------------------------------------------
//
//  INTEGRALLE
//
//  Versão 1.0.0
//
// -----------------------------------------------------------------------------------

    function ConfirmaExclusao(){
        return confirm('Deseja excluir este registro?');
    }
    function ConfirmaExclusao2(msg){
        return confirm(msg);
    }
    function Abre(theURL,winName,features) { //v2.0
        window.open(theURL,winName,features);
    }
    function mOvr(src,clrOver) {
                        src.style.cursor = 'hand';
                        src.bgColor = clrOver;
    }
    function mOut(src,clrIn) {
                        src.style.cursor = 'default';
                        src.bgColor = clrIn;

    }
    function mClk(src) {
                if(event.srcElement.tagName=='TD'){
                        src.children.tags('A')[0].click();
                }
    }
	function tamanho(){
	if (top.screen) {
		obj=document.DvwNoticiaOutrasFotos_Foto;
		aw=obj.width;
		ah=obj.height;
		top.resizeTo(aw + 10, ah + 30);
	    }
    }
    function checkFileExtension(elem) {
        var filePath = elem.value;

        if(filePath.indexOf('.') == -1)
            return false;
        
        var validExtensions = new Array();
        var ext = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase();
    
        validExtensions[0] = 'jpg';
        validExtensions[1] = 'jpeg';
        validExtensions[2] = 'bmp';
        validExtensions[3] = 'png';
        validExtensions[4] = 'gif';  
//        validExtensions[5] = 'tif';  
//        validExtensions[6] = 'tiff';
//        validExtensions[7] = 'txt';
//        validExtensions[8] = 'doc';
//        validExtensions[9] = 'xls';
//        validExtensions[10] = 'pdf';
    
        for(var i = 0; i < validExtensions.length; i++) {
            if(ext == validExtensions[i])
                return true;
        }
        
        alert('A extenção ' + ext.toUpperCase() + ' não é válida para imagens!');
        elem.setfocus;
        return false;
    }
    function fecha() {   // fechando a janela atual, atualizando a principal ( popup )
         
    window.close();   // fechando a janela atual ( popup )  
    opener.location.href=opener.location.href;   // dando um refresh na página principal   
    /* ou assim:  
    * window.opener.location.reload();  
    */   
    // document.location="Cores.htm"   
    // fim da função   
    } 