﻿function WybiezBranza() { window.open("#"); }
function DodajFirme() { window.open("DodajFirme.htm", "name", " width=225,height=225"); }
function resetall() { reset(); }
function CallBackFunction(radWindow, returnValue) {
    var oArea = document.getElementById("InfoArea");
    if (returnValue) oArea.value = returnValue;
    else alert("No text was returned");
}
function OnClientshow(radWindow) {
    //Get current content of textarea
    //var oText = document.getElementById("SSlowa").value;

    //Create a new Object to be used as an argument to the radWindow
    //var arg = new Object();                    
    //Using an Object as a argument is convenient as it allows setting many properties.
    //arg.TextValue = oText;
    //arg.Color = "red";
    //arg.BackColor = "yellow";

    //Set the argument object to the radWindow        
    //radWindow.Argument = arg;
}
function showDialog(radWindow) {
    //alert("Funkcja dostępna wkrótce");
    var oWnd = window.radopen(null, radWindow);
    oWnd.setUrl(oWnd.get_navigateUrl());

}
function OnClientClose(radWindow) {
    //Another option for passing a callback value
    //Set the radWindow.argument property in the dialog
    //And read it here --> var oValue = radWindow.argument;                                        
    //Do cleanup if necessary
}


 function openRadWindow(CustomerID,height,width)
 {
     var oWnd = radopen("image1.aspx?sciezka=" + CustomerID, "RadWindow1");
     h = parseInt(height)+80;
     w = parseInt(width)+37;
     oWnd.setSize(w, h);
     oWnd.Center();
 }



function JSFX_FloatTopLeft() {
    var OD_ILU_PIXELI_WINDA_MA_DZIALAC = 1188;

    var startX = 0, startY = 0;
    var ns = (navigator.appName.indexOf("Netscape") != -1);
    var d = document;
    var px = document.layers ? "" : "px";
    function get_top() { var theTop = 0; if (document.documentElement && document.documentElement.scrollTop) theTop = document.documentElement.scrollTop; else if (document.body) theTop = document.body.scrollTop; else theTop = document.documentElement.scrollTop; return theTop; }

    function ml(id) {
        var el = d.getElementById ? d.getElementById(id) : d.all ? d.all[id] : d.layers[id];
        if (d.layers) el.style = el; el.sP = function(x, y)
        {
          this.style.left = x + px;
          if (get_top() > OD_ILU_PIXELI_WINDA_MA_DZIALAC)
          {
            if(y + el.offsetHeight > document.getElementById("partnerzy").offsetTop)
            {
              this.style.top = (document.getElementById("partnerzy").offsetTop - OD_ILU_PIXELI_WINDA_MA_DZIALAC - el.offsetHeight) + px; 
              
            }
            else
            {
              this.style.top = (y - OD_ILU_PIXELI_WINDA_MA_DZIALAC) + px; 
            }
          }
          else
          {
            this.style.top = 0; 
          }
        };
        el.x = startX; el.y = startY; return el;
    }
    window.stayTopLeft = function() {
        var pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
        
        ftlObj.y += (pY + startY - ftlObj.y) / 4;
        
        //console.log("pY: " + pY + ", ftlObj.y: " + ftlObj.y);
        
        ftlObj.sP(ftlObj.x, ftlObj.y);
        setTimeout("stayTopLeft()", 50);
    }

    ftlObj = ml("SkyIE");
    stayTopLeft();
}
