jQuery(document).ready(function(){

  SetInputDefaultContent('email', 'Az Ön e-mail címe');

  SetInputDefaultContent('CustomFields_2_1', 'Az Ön postai címe');

  SetInputDefaultContent('CustomFields_1_4', 'Az Ön keresztneve');

});







// set default content for a text input

function SetInputDefaultContent( inputID , valueText ){



  if ( jQuery('#' + inputID).length == 0 ) return false;

  

  var obj = jQuery('#' + inputID );

  

  obj.val(valueText);

  

  obj.focus(function(){

    if ( obj.val() == valueText ) obj.val('');

  });

  

  obj.blur(function(){

    if ( obj.val() == '' ) obj.val(valueText);

  });



  return true;



}



function AppType() 

{

      appname = navigator.appName;

      if (appname.indexOf('Microsoft') != -1) return "IE";

      if (appname.indexOf('Netscape') != -1) return "FF";

}



function showBox(map){

    

	



	var Center = "1"; // ha 1 akkor kozepre kerul

    var Width = "640";

    var Height = "480";

    var BackgroundColor = "#fff";

    var Border = "1px solid #ddd";

    var PositionX = "100";

    var PositionY = jQuery(window).scrollTop() + 100;

	

  

    // dark div

    

   createDarkBackground('main_container');

    

    // popup div building ------------------------------------------------------

    var NewDiv = document.createElement('div');

    //var NewDiv = document.getElementById(divname);

    NewDiv.id = 'CleanwebPopUpDiv';

    NewDiv.style.width = Width + "px";

    NewDiv.style.height = Height+"px";

    NewDiv.style.position = "absolute";

    NewDiv.style.top = PositionX + "px";

    NewDiv.style.left = PositionY + "px";

    NewDiv.style.backgroundColor = BackgroundColor;

    NewDiv.style.border = Border;

    NewDiv.style.overflow = "hidden";

    NewDiv.style.zIndex = "10000";

    

    if (Center > 0) {

        var WinWidth = 0;

        var WinHeight = 0;

        // az explorer megint feketet mond a feherre :S

        if (AppType() == "FF") {

            WinWidth = window.innerWidth;

            WinHeight = window.innerHeight;

        }

        else {

            WinWidth = document.body.offsetWidth;

            WinHeight = document.body.offsetHeight;

        }

        // a pozicio kiszamitasa

        var top = (WinHeight - Height) / 2;

        var left = (WinWidth - Width) / 2;

        NewDiv.style.top = PositionY + "px";

        NewDiv.style.left = left + "px";

    }

  

    

    NewDiv.style.visibility = "visible";

	document.body.appendChild(NewDiv);

	

	var MapDiv = document.createElement('mapDiv');

	



	NewDiv.innerHTML = '<div style="width:100%;background-color:#000;text-align:center;height:20px;line-height:20px;"><a style="font-weight:bold;font-size:12px;color:#ffd400;" href="javascript:removeDarkBackground()">Térkép bezárása</a></div>';

	

	if ( map == 2 )

		NewDiv.innerHTML += '<iframe width="640" height="460" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=hu&amp;geocode=&amp;q=Budapest,+M%C3%A1ty%C3%A1s+kir%C3%A1ly+%C3%BAt+24&amp;sll=47.560954,19.024228&amp;sspn=0.011425,0.033023&amp;g=budapest+b%C3%A9csi+%C3%BAt+343&amp;ie=UTF8&amp;hq=&amp;hnear=1039+Budapest,+III.+ker%C3%BClet,+M%C3%A1ty%C3%A1s+kir%C3%A1ly+%C3%BAt+24,+Magyarorsz%C3%A1g&amp;ll=47.585796,19.049003&amp;spn=0.00571,0.016512&amp;z=14&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=hu&amp;geocode=&amp;q=Budapest,+M%C3%A1ty%C3%A1s+kir%C3%A1ly+%C3%BAt+24&amp;sll=47.560954,19.024228&amp;sspn=0.011425,0.033023&amp;g=budapest+b%C3%A9csi+%C3%BAt+343&amp;ie=UTF8&amp;hq=&amp;hnear=1039+Budapest,+III.+ker%C3%BClet,+M%C3%A1ty%C3%A1s+kir%C3%A1ly+%C3%BAt+24,+Magyarorsz%C3%A1g&amp;ll=47.585796,19.049003&amp;spn=0.00571,0.016512&amp;z=14" style="color:#0000FF;text-align:left">Nagyobb térképre váltás</a></small>';

	else

		NewDiv.innerHTML += '<iframe width="640" height="460" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=hu&amp;geocode=&amp;q=budapest+pesti+%C3%BAt+41&amp;sll=37.0625,-95.677068&amp;sspn=50.777825,114.257812&amp;ie=UTF8&amp;z=14&amp;iwloc=addr&amp;ll=47.489079,19.244871&amp;output=embed&amp;s=AARTsJqsRh3QWpQ6yIDTphM6iIvPP1EJMg"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=hu&amp;geocode=&amp;q=budapest+pesti+%C3%BAt+67-73&amp;sll=37.0625,-95.677068&amp;sspn=50.777825,114.257812&amp;ie=UTF8&amp;z=14&amp;iwloc=addr&amp;ll=47.489079,19.244871" style="color:#0000FF;text-align:left">Nagyobb térképre váltás</a></small>';



  

}





function createDarkBackground(mainContainer){

	

	var DarkDiv = document.createElement('div');

    DarkDiv.id ='DarkDiv';

    DarkDiv.style.zIndex = '10000';

    DarkDiv.style.backgroundColor = '#000';



    try {

        DarkDiv.style.filter = 'alpha(opacity=75);';

    } 

    catch (x) {

    }

    finally {

        DarkDiv.style.opacity = '0.75';

    }

    

	DarkDiv.style.position = 'absolute';

	DarkDiv.style.top = '0px';

	DarkDiv.style.left = '0px';

	DarkDiv.style.width = '100%';

	DarkDiv.style.height = document.getElementById(mainContainer).clientHeight + 'px';

	DarkDiv.style.visibility = 'visible';

	DarkDiv.onclick = removeDarkBackground;

	document.body.appendChild(DarkDiv);

	

	

}



function removeDarkBackground(){

	document.body.removeChild(document.getElementById('DarkDiv'));

	document.body.removeChild(document.getElementById('CleanwebPopUpDiv'));

	

}


