$(document).ready (function () {
	
	setInterval(size , 10);
	
	/*$("#pic_detail .photo_placeholder .image img").load(function() {
        
    });*/
	
    if (window.location.toString().indexOf("diak")!=-1) {
        var color_type = 'sarga';
    }if (window.location.toString().indexOf("kornyezetineveles")!=-1) {
        var color_type = 'kek';
    }if (window.location.toString().indexOf("kornyezetbarat")!=-1) {
        var color_type = 'zold';
    }if (window.location.toString().indexOf("vallalkozas")!=-1) {
        var color_type = 'szurke';
    }

	menu = getEncoded(menu);
	$("div#flashVideo").flashHack ({

	/* attribútumok */

	source: "/swf/simpleplayer-0.9.1.swf",
	width: "430",
	height: "360"

  }, {
	/* paraméterek */
	config: "config.xml"
  });
 $("div#flashcontent").flashHack
 ({
  source: "/swf/menu.swf",
  width: "100%",
  height: "100%",
  scale: "noscale",
  wmode: "transparent",
  salign: "lt",
  allowscriptaccess: "always",
  swliveconnect: "true",
  ident: "hulladekboltermek",
  allownetworking: "all",
  query: false
 },
  {
   paramXml : menu,
   menuColor : color_type
	 });
	 
	$("div#foto2010_banner").flashHack
		({
			source: "/swf/fotopalyazat2010.swf",
			width: "283px",
				height: "60px"
		});

	 
	 
    $("a span").css ({
    display: "none"
    });
    $("div#leftbar div.menu ul li a").flashText ({
    source: "/swf/verdana-1.0.0.swf"
    });
    $("div#content div.fancybox p.title").flashText ({
    source: "/swf/verdana-1.0.0.swf"
    });
    $("div#content div.welcome p.title").flashText ({
    source: "/swf/verdana-1.0.0.swf"
    });
    $("div#content div.imagelist h3").flashText ({
    source: "/swf/verdana-1.0.0.swf"
    });
    $("div#content div.linklist h3").flashText ({
    source: "/swf/verdana-1.0.0.swf"
    });
    $("div#content div.AutoNewsFeed h3").flashText ({
    source: "/swf/verdana-1.0.0.swf"
    });
    $("div#article h1 ").flashText ({
    source: "/swf/verdana-1.0.0.swf"
    });
    $("div#article div.intro p ").flashText ({
    source: "/swf/verdana-1.0.0.swf"
    });
	
});

function size() {
	height = $("#pic_detail .image").height();
	$(".photo_placeholder_m").height(height);
	console.log("lefut");
}

function getEncoded (ftValue)
{
 var ftString = new String ();
 $.each (ftValue.split (""), function (ftKey, ftValue)
 {
  var ftChar = ftValue.charCodeAt (0);
  if (ftChar < 128) { ftString += String.fromCharCode (ftChar); }
  else if (ftChar < 2048) { ftString += String.fromCharCode (((ftChar >> 6) | 192), ((ftChar & 63) | 128)); }
  else { ftString += String.fromCharCode (((ftChar >> 12) | 224), (((ftChar >> 6) & 63) | 128), ((ftChar & 63) | 128)); }
 });
 return ftString;
}


function hulladekboltermek_DoFSCommand(FSCmd, FSArg)
{
 //alert(FSCmd+' '+FSArg);
 if(FSCmd=="mainMenuHeight") {
    mainh = parseInt(FSArg)+10;
    $('#leftbar .loginbox').css({marginTop:mainh+'px'});
    $('#flashcontent').css({height:mainh+'px'});
}
 if(FSCmd=="originalSize")
 {
  $('#flashcontent').css({height:mainh+'px'});
  $('#flashcontent').css({width:'244px'});
 }
 if(FSCmd=="changeSize")
 {
  var par = FSArg.split(":");
  var w = Number(par[0]) + 40;
  var h = Number(par[1]) + 40;
   $('#flashcontent').css({height:h+'px'});
  $('#flashcontent').css({width:w+'px'});
 }
}



function PrintPage () {

    PrintWindow = window.open ("", "mywindow1","directories=1,fullscreen=1,location=1,menubar=1,resizable=1,scrollbars=1,status=1,titlebar=1,width=800,height=600");
    PrintWindow.document.write ($('#content').html ());
    PrintWindow.document.write ('<p style="clear:both">Az oldal az alábbi linken érhető el: '+window.location.href+'</p>');

}