// JavaScript Document
// 
//  a debuggolás eljárásai


function debug_01 () {
  try {
//    alert (":-)");
    window.open('x.php', '', 'left=0,top=0');
    }
  catch(err){
    txt  = "Sajnos hiba van az oldalon.\n"
    txt += "A hiba leírása: " + err.description + "\n"
    txt += "A folytatáshoz kattints az OK gombra.\n"
    alert(txt)
    }
  };


function debug_02 () {
  ShowFormElement ("frmService")
  };

function debug_03 () {
  alert ("debug_03...");
  };

// ---------------------------------------------------------------------------------- popups
function debug_popup_01 () {
  debug_01 ()
  };

function debug_popup_02 () {
  kamu();
  };

function debug_popup_03 () {
  alert ("debug_popup_03...");
  };
  
// ------------------------------------------------------------------------- egyéb függvények
/*
 *  ShowFormElement
 *   
 *  A paraméterként kapott form elemeinek megjelenítése popup ablakban 
 */  
function ShowFormElement (FormName) {
  try {
  //  alert("Helló");
    var oPopup = window.createPopup();
    oPopupBody = oPopup.document.body;
    oPopupBody.style.backgroundColor = "#ffff99";
    oPopupBody.style.border = "1 solid black";
    oPopupBody.style.fontSize = "12px";
    oPopupBody.style.fontFamily = "Courier New";

    s = ""
    for (i = 0; i < document.forms[FormName].elements.length; i++ ) {
      if ( document.forms[FormName].elements[i].type == "checkbox") {
        s += i + " -> " + document.forms[FormName].elements[i].name
        s += " (" + document.forms[FormName].elements[i].type + ")"
        s += " = " + document.forms[FormName].elements[i].checked
        s += "<br>"
        }
      else {
        s += i + " -> " + document.forms[FormName].elements[i].name
        s += " (" + document.forms[FormName].elements[i].type + ")"
        s += " = " + document.forms[FormName].elements[i].value
        s += "<br>"
        }
      } 
    oPopupBody.innerHTML = s;
  
  //  show(x-location, y-location, width, height, reference-element);
  //  oPopup.show(10, 20, 100, 20, putHere);
    oPopup.show(600, 50, 450, 300 );
    }
  catch (err){
    ehandler(err);
    }  

  }

function ehandler(err) {
  txt  = "Sajnos hiba van az oldalon.\n"
  txt += "A hiba leírása: " + err.description + "\n"
  txt += "A folytatáshoz kattints az OK gombra.\n"
  alert(txt)
  } 
    
