$(document).ready(function()  {

    if($('.button a').text() == "Kapcsolatfelvétel")
    {
    
       alert('asd');
    
    }
  
  
    
	/*var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-17028541-1']);
	_gaq.push(['_setDomainName', 'none']);
	_gaq.push(['_setAllowLinker', true]);
	_gaq.push(['_trackPageview']);

	(function() { 
	var ga = document.createElement('script'); ga.type =
	'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
	'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0];
	s.parentNode.insertBefore(ga, s);
	})();*/
});                                   
function load_youtube() {
	// zsiraf: var so = new SWFObject("http://www.youtube.com/v/UMkQCWgU8EA&enablejsapi=1&playerapiid=ytplayer", "ytplayer", "480", "385", "7", null);
    var so = new SWFObject("http://www.youtube.com/v/V7O6YQLC0jk&enablejsapi=1&playerapiid=ytplayer", "ytplayer", "480", "385", "7", null);
	so.addParam("allowScriptAccess", "always");
	so.write("jwplayer2");
}
function stop_youtube() {
	$('#ytplayer').get(0).stopVideo();
}

function load_youtube2() {
	var so = new SWFObject("http://www.youtube.com/v/kb5fWj1viWI&enablejsapi=1&playerapi&id=ytplayer", "ytplayer2", "480", "385", "7", null);
	so.addParam("allowScriptAccess", "always");
	so.write("jwplayer3");
}
function stop_youtube2() {
	$('#ytplayer2').get(0).stopVideo();
}


var timer = 0;

var scrolledX, scrolledY;
var centerX, centerY;
function popupWindow(msg)
{
	var Xwidth = 500;
	var Yheight = 100;
	if( self.pageYOffset ) {
		scrolledX = self.pageXOffset;
		scrolledY = self.pageYOffset;
	} else if( document.documentElement && document.documentElement.scrollTop ) {
		scrolledX = document.documentElement.scrollLeft;
		scrolledY = document.documentElement.scrollTop;
	} else if( document.body ) {
		scrolledX = document.body.scrollLeft;
		scrolledY = document.body.scrollTop;
	}
	
	if( self.innerHeight ) {
		centerX = self.innerWidth;
		centerY = self.innerHeight;
	} else if( document.documentElement && document.documentElement.clientHeight ) {
		centerX = document.documentElement.clientWidth;
		centerY = document.documentElement.clientHeight;
	} else if( document.body ) {
		centerX = document.body.clientWidth;
		centerY = document.body.clientHeight;
	}
	
	
	
	var leftOffset = scrolledX + (centerX - Xwidth) / 2;
	var topOffset = scrolledY + (centerY - Yheight) / 2;
	// The initial width and height of the div can be set in the
	// style sheet with display:none; divid is passed as an argument to // the function
	
	var divToOpen = $("<div/>").addClass("cartaction").css("width", Xwidth).css("height", Yheight).css("position", "absolute").css("top", topOffset).css("left", leftOffset).css("backgroundColor", "#000").css("lineHeight", "100px").css("textAlign", "center").css("opacity", 0.8).css("color", "#fff").css("fontWeight", "bold").html(msg);
	$("#body").append(divToOpen);
	/*
	var o=document.getElementById(divid);
	var r=o.style;
	r.position='absolute';
	r.top = topOffset + 'px';
	r.left = leftOffset + 'px';
	r.display = "block";*/
	setTimeout("removeBox()", 3000);
	 
}

function removeBox()
{
	$(".cartaction").remove();
}


$(document).ready(function(){
  
  $("a[rel^='rate_']").click(function(e){
     
     var value=$(this).attr('rel').slice(5);

     $(this).attr('class',"star_"+value);
     
     $("#rate").val(value);
  
  	e.preventDefault();
  	return false;
  });

						   
 $('#hide_win').click(function(){
                    
                          $('#popup').hide();
                          
                          // It's Magic!
                          //var video_data=$('#jwplayer2').clone();
                          //$('#jwplayer2').remove();
                          //$('#video_wrapper').append(video_data);
                          
                        // It's Extra Magic :P!  
						//document.getElementsByName('mpl')[0].sendEvent('STOP');
						stop_youtube();
                          
                    });
                    
                    $('#show_win').click(function(){
                      
                           $('#popup').show();
                           $('#popup').goCenter(); 
                          return false;
                    });



 $('#all_packs').click(function() {

		if($(this).attr('checked') == true) {
     
     $("#csomag_valaszto").hide();
     
		}

		else {

			
     $("#csomag_valaszto").show();
     
		}

	});


						   
							/*
	ÁRFOLYAMOK
	*/
	$("a[rel='arfolyamok']").each(function(e){
	$(this).click(function(e){
	e.preventDefault();	
	$("a[rel='arfolyamok']").parent().removeClass("arfolyam_aktiv").addClass("arfolyam_alap");
	$(this).parent().addClass("arfolyam_aktiv").removeClass("arfolyam_alap");
	$("#arfolyamok").hide();
	
});});

	$('#arfolyam-jobb a').click(function() {
		$('#valuta').hide();
		$('#deviza').show();
	});
	$('#arfolyam-bal a').click(function() {
		$('#valuta').show();
		$('#deviza').hide();
	});
   
						   

$("div.dropdown_div,#logo").mouseover(function(e){

	e.preventDefault();
	$("#box_1,#box_2,#box_3,#box_4,#box_5,#box_6,#box_7,#box_8,#box_9,#box_10").hide();
	var menu_id = e.target.parentNode.id;
	var num = menu_id.substring(menu_id.length - 1);
	
	$('#box_' + num).show();
		

});

$("div.drop").mouseleave(function(e){

	var id=$(this).attr('id');	
	subNavTimer = setTimeout('$("#'+id+'").hide();', 100);
});





$("a[rel='right_box']").click(function(e){

		e.preventDefault();

		

		

		if($("a[rel='right_box']").attr("class") == "hidden")

		{

			$("a[rel='right_box']").attr("class", "opened");
			$("#melleklet").attr("src", "/images/0/right-box-arrow-up.jpg");

			$(".right_box_2").slideDown();

		}

		else

		{

			$("a[rel='right_box']").attr("class", "hidden");
			$("#melleklet").attr("src", "/images/0/right-box-arrow-down.jpg");

			$(".right_box_2").slideUp();

		}

});

/*try_from*/
/*try*/
$("a[rel='mid_box']").click(function(e){

		e.preventDefault();

		

		

		if($("a[rel='mid_box']").attr("class") == "hidden")

		{

			$("a[rel='mid_box']").attr("class", "opened");
			$("#tartalom").attr("src", "/images/0/right-box-arrow-up.jpg");

			$(".mid_box_2").slideDown();

		}

		else

		{

			$("a[rel='mid_box']").attr("class", "hidden");
			$("#tartalom").attr("src", "/images/0/right-box-arrow-down.jpg");

			$(".mid_box_2").slideUp();

		}

});


$("a[rel='help_box']").click(function(e){

		e.preventDefault();

		if($("a[rel='help_box']").attr("class") == "hidden")

		{

			$("a[rel='help_box']").attr("class", "opened");
			
			$(".help_box").slideDown();

		}

		else

		{

			$("a[rel='help_box']").attr("class", "hidden");
			
			$(".help_box").slideUp();

		}

});


$("a[rel='inner_box']").click(function(e){

		e.preventDefault();
    if($(this).attr("class") == "hidden")
    		{
			$(this).attr("class", "opened");
			$(this).parent().next().next().slideDown();
		}
		else
		{
		  $(this).parent().next().next().slideUp();
		  
			$(this).attr("class", "hidden");
			
		}

});

$("a[rel='inner_box_deep']").click(function(e){

		e.preventDefault();
    if($(this).attr("class") == "hidden")
    		{
			$(this).attr("class", "opened");
			$(this).parent().next().next().show();
		}
		else
		{
			$(this).attr("class", "hidden");
			$(this).parent().next().next().hide();
		}

});





$("a[rel='next-tab']").click(function(e){

		e.preventDefault();

		$("a[rel='next-tab']").parent().parent().removeClass("tab_active").addClass("tab_default");

		$(this).parent().parent().addClass("tab_active").removeClass("tab_default");

		$("div[class='tab_bg']").hide();

		$("div[id='" + $(this).attr("href").slice(1) + "']").show();

		 });
/*


$("a[rel='drop-down-1']").mouseover(function(e){

		e.preventDefault();

		$("#box_1").show();

		$("#box_1").mouseleave(function(){

			$(this).hide();									   

		});
		
		$("#menu_2").mouseover(function(){

			$("#box_1").hide();									   

		});



});
*/
$("a[rel='open_form']").click(function(e){
	e.preventDefault();
	$("#new-popup-gb").show();
	$("#new-popup-gb").goCenter(); 
});

$("a[rel='close_form']").click(function(e){
	e.preventDefault();
	$("#new-popup-gb").fadeOut();
});


$("a[rel^='email_']").click(function(e){
	var count = $(this).attr('rel').slice(6,7);
	var mail =  $(this).attr('rel').slice(8);
  var margin = 315+count*315;
	$("#new-popup-gb").attr("style","margin-top:"+margin+"px;");
  e.preventDefault();
	$("#new-popup-gb").show();
	$("#new-popup-gb").goCenter();
	$("#mail").html("<input type=\"hidden\" name=\"message[mailto]\" value='"+mail+"' />");
	
});

$.fn.getCenter = function() {
	var winH = $(window).height();
	var winW = $(window).width();
	var winSL = $(window).scrollLeft();
	var winST = $(window).scrollTop();
	var width = $(this).outerWidth();
	var height = $(this).outerHeight();
	var x = (winW/2 - width/2)+winSL;
	var y = (winH/2 - height/2)+winST; 
	var center = Object(); 
	center.left = x;
	center.top = y;
	return center; 
}

$.fn.goCenter = function() {
	var _center = $(this).getCenter();
	$(this).css({
		left: _center.left,
		top: _center.top,
		marginTop: 0
	});
} 




}); 






(function(){var b={};this.tmpl=function d(a,c){a=!/\W/.test(a)?(b[a]=b[a]||d(document.getElementById(a).innerHTML)):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return c?a(c):a}})();




function faszozo(element){
	var menu_id = element;
	var num = menu_id.substring(menu_id.length - 1);
	
	$('#box_' + num).hide();
	}
	

