﻿function RtnPopup(param) {
    var uri = param;
     // 'http://' + location.hostname + ':1111/' + param; 
    window.open(uri, "NoSec", "menubar=0,scrollbars=1,resizable=1,width=400,height=600,left=150,top=100");
}
function openwindow(thelocation) {

    var temploc = thelocation
    //height=' + Number(screen.availHeight-260) + ',width=' + screen.availWidth + 'toolbar=no,location=no,directories=no,status=no,menubar=no,
    var att = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=yes,left=0,top=0,width=' + Number(screen.availWidth - 100) + ',height=' + Number(screen.availHeight - 100);
    if (!(window.resizeTo && document.all) && !(window.resizeTo && document.getElementById)) {
        window.open(thelocation, '', att)
        return
    }
    win2 = window.open(temploc, "", att)
    //win2.moveTo(0,250) height=' + Number(screen.availHeight-10) + ',
    // win2.resizeTo(screen.availWidth,Number(screen.availHeight-170) ),height=' + Number(screen.availHeight-10) + ',width=' + screen.availWidth + '

}

function openPopup(thelocation) {

    var temploc = thelocation
    //height=' + Number(screen.availHeight-260) + ',width=' + screen.availWidth + 'toolbar=no,location=no,directories=no,status=no,menubar=no,
    var att = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0,resizable=yes,left=100,top=100,width=' + Number(screen.availWidth - 200) + ',height=' + Number(screen.availHeight - 200);
    if (!(window.resizeTo && document.all) && !(window.resizeTo && document.getElementById)) {
        window.open(thelocation, '', att)
        return
    }
    win2 = window.open(temploc, "", att)
    //win2.moveTo(0,250) height=' + Number(screen.availHeight-10) + ',
    // win2.resizeTo(screen.availWidth,Number(screen.availHeight-170) ),height=' + Number(screen.availHeight-10) + ',width=' + screen.availWidth + '

}


function Mesaj(Mesaj) {
    alert(Mesaj);
}

/////////////////////////////////Mesaj-Hata Yönetimi///////////////////////
function PageRequestManagerHazirla() {
    // Get a reference to the PageRequestManager.
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_initializeRequest(InitializeRequest);
    prm.add_endRequest(EndRequest);

    //hatalar için............
    Sys.Application.add_load(AppLoad);
}
// Executed anytime an async postback occurs.
function InitializeRequestHazirla(sender, args) {
    $find('btnPopup_ModalPopupExtender_IslemBilgi').show();
}
// Executed when the async postback completes.
function EndRequestHazirla(sender, args) {
    $find('btnPopup_ModalPopupExtender_IslemBilgi').hide();
    if (args.get_error() != undefined) {
        var Mesaj = args.get_error().message;
        Mesaj = Mesaj.replace(args.get_error().name + ':', '<br>');
        $get('lblBilgiMesaj').innerHTML = Mesaj;
        $find('btnPopup_ModalPopupExtender').show();
        args.set_errorHandled(true);
    }
}
function BeginRequestHazirla(sender, args) {
    $find('btnPopup_ModalPopupExtender').hide();
}
function MesajGoster(Mesaj) {

    var intIndexOfMatch = Mesaj.indexOf("<br>");
    while (intIndexOfMatch != -1) {
        Mesaj = Mesaj.replace("<br>", "\n")
        intIndexOfMatch = Mesaj.indexOf("<br>");
    }
    //$get('ctl00_lblBilgiMesaj').innerHTML=Mesaj;
    //$find('ctl00_AnaGovde_btnPopup_ModalPopupExtender').show();
    alert(Mesaj);
}

function ShowModalDialog(Kontrol, ValidationGrup) {
    var validated = Page_ClientValidate(ValidationGrup);
    //if(!Page_IsValid){
    if (!validated) {
        var x = $find(Kontrol);
        x.show();
    }
}
function AramaYap() {
    document.forms["form1"].method = "GET";
    document.forms["form1"].action = "http://www.google.com.tr/search";
    document.forms["form1"].target = "_blank"
    document.forms["form1"].submit();
}

