﻿function executeCommands(commandtoRun, inputparms) {
    var oShell = new ActiveXObject("Shell.Application");
    //var commandtoRun = "C:\\Windows\\Notepad.exe";
    if (inputparms != "") {
        var commandParms = "" //document.Form1.filename.value;
    }

    oShell.ShellExecute(commandtoRun, commandParms, "", "open", "1");
}


function CallPrint(strid) {
    var prtContent = document.getElementById(strid);
    var WinPrint = window.open('', '', 'letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
    WinPrint.document.write("<link href=/plmStyle.css rel=stylesheet type=text/css />" + prtContent.innerHTML);
    WinPrint.document.close();
    WinPrint.focus();
    WinPrint.print();
    WinPrint.close();
    //prtContent.innerHTML=strOldOne;
    //PARA CHAMAR
    //onclientclick="CallPrint('divPrint')
}

function enter() {
    //document.getElementById('ctl00$ContentPlaceHolder1$btGravar').value = "dd";
    if (event.keyCode == 13) {
        //event.keyCode = 9
    }

}

//#########################################################################################
//FAVORITOS 


function book_mark(title, url) {
    if (window.sidebar) {
        window.sidebar.addPanel(title, url, "");
    } else if (document.all) {
        window.external.AddFavorite(url, title);
    } else if (window.opera && window.print) {
        alert('Pressione Ctrl+D para adicionar aos favoritos (Command+D para macs) Logo após clicar em Ok');
    } else if (window.chrome) {
        alert('Pressione Ctrl+D para adicionar aos favoritos (Command+D para macs) Logo após clicar em Ok');
    }
}


function toggle() {
    var div1 = document.getElementById('div1')
    if (div1.style.display == 'none') {
        div1.style.display = 'block'
    } else {
        div1.style.display = 'none'
    }
}


//#########################################################################################
//GOOLE 

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-25890672-1']);
_gaq.push(['_trackPageview']);

(function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


//#########################################################################################

$(document).ready(function () {
    $("div[id*='Alert']").addClass("alerta").delay(5000).fadeOut(1000, function () {
        $(this).remove();
    });
});
