$(function(){
        // don't forget this init!      
        $.initWindowMsg();
        var childWin;
        $('#openWin').click(function(){
        	alert("To ses ale lekl!");
          childWin = window.open('../../test.phtml','test', "width=500, height=500, location=no, menubar=no, scrollbars=no, status=no, toolbar=no");
        	//childWin = window.open();
          if (window.focus) {childWin.focus()}
        });

        // upon click of a button, send corresponding text input value to parent window
        $('#button1').click(function(){
          value = $('#in1').val();
          $.triggerWindowEvent(childWin, "parentMsg1", value); 
        });
        $('#button2').click(function(){
          value = $('#in2').val();
          $.triggerWindowEvent(childWin, "parentMsg2", value); 
        });

        // set up the message handlers, listen for events 'childMsg1' and 'childMsg2'     
        $.windowMsg("childMsg1", function(message) {
          $('#in1').val(message);
        });
        $.windowMsg("childMsg2", function(message) {
          $('#in2').val(message);
        });

      }); 
