
$(function() {
	$("#pomaz_fast_links_menu").selectbox( {
		effect : "fade"
	});
    
    $("#pomaz_fast_links_menu").change(function() { 
        /* do something here */
        window.location = site_domain_link + 'index.php?node=static&id='+$(this).val();
       // alert($(this).val());
    });
    $("#pomaz_search").focus(function() 
    {
        
        $(this).val("");
    }).blur(function(){
        if($(this).val()=="") {
            $(this).val("Keresés...");
        }
    });
    
       
    $('ul.left_menu ul.left_submenu').each(function(){
        if(!$(this).parent().hasClass('active')){
            $(this).hide();
        }
    })
    $('a.remove_href').removeAttr("href");
    $('ul.left_menu li.slideable > a').click(function(event) {
        $('ul.left_menu ul.left_submenu').hide('slow');
        $(this).parent().find('ul').toggle('slow');
    });
   // $('li.active').find('ul').toggle('slow');
   
   $('ul.tabNav a').click(function() {
        var curChildIndex = $(this).parent().prevAll().length + 1;
        $(this).parent().parent().children('.current').removeClass('current');
        $(this).parent().addClass('current');
        $(this).parent().parent().next('.tabContainer').children('.current').slideUp('fast',function() {
            $(this).removeClass('current');
            $(this).parent().children('div:nth-child('+curChildIndex+')').slideDown('normal',function() {
                $(this).addClass('current');
            });
        });
        return false;                                
    });
});                                                      
            

/*
// Set Banner Animate
var changeSec = 5; // Change in sec
var fadeOutInTime = 2000; //
var allBG = 5;

// BackgroundChange
var activeBG = 1;
function changeBG() {
	temp = activeBG;
	$('#head_banner_' + temp).fadeTo(fadeOutInTime, 0.05, function() {
		$('#head_banner_' + temp).css('display', 'none');
	});

	// Check
	if (activeBG == allBG) {
		activeBG = 1;
	} else {
		activeBG = activeBG + 1;
	}

	$('#head_banner_' + activeBG).fadeTo(fadeOutInTime, 1, function() {
		$('#head_banner_' + activeBG).css('display', 'block');
	});

	// Set new
	var timeOut = changeSec * 1000;
	setTimeout("changeBG()", timeOut);
}

// Chnage bg
$(document).ready(function() {
	var timeOut = changeSec * 1000;
	setTimeout("changeBG()", timeOut);
});  
// HeadBar Page Selector
$('#pageSelectorActivate').live('click', function() {
	$('#pageSelectorMenu').animate( {
		height : 'toggle'
	}, 500, function() { 
	});
});
*/

// Search Form Input Clear
var searchFormClear = false;
$('#searchFormInput').live('click', function() {
	if (searchFormClear === false) {
		$('#searchFormInput').val('');
		searchFormClear = true;
	}
});

// Search Form Submit
$('#sendSearchForm').live('click', function() {
	var tempSearch = $('#searchFormInput').val();
	if (tempSearch.length < 3) {
		alert('A kereséshez adjon meg egy hosszabb szöveget!');
	} else {
		document.searchForm.submit();
	}
});

// Activate sub menu
function activateSubMenu(subID) {
	if (submenuID != 9999) {
		$('#subMenuContainer_ID_' + submenuID).animate( {
			height : 'toggle'
		}, 500, function() { /* Animation complete */
		});
		submenuID = subID;
		$('#subMenuContainer_ID_' + subID).animate( {
			height : 'toggle'
		}, 500, function() { /* Animation complete */
		});
	} else {
		submenuID = subID;
		$('#subMenuContainer_ID_' + subID).animate( {
			height : 'toggle'
		}, 500, function() { /* Animation complete */
		});
	}
}

// Select gal
var activeSelect = 'Videok';
$('#selectKepek').live('click', function() {
	if (activeSelect != 'Kepek') {
		$('#gal' + activeSelect).fadeOut(400, function() {
			activeSelect = 'Kepek';
			$('#gal' + activeSelect).fadeIn(400, function() {
			});
		});
	}
});
$('#selectVideok').live('click', function() {
	if (activeSelect != 'Videok') {
		$('#gal' + activeSelect).fadeOut(400, function() {
			activeSelect = 'Videok';
			$('#gal' + activeSelect).fadeIn(400, function() {
			});
		});
	}
});

// Menu set
var swMenu = screen.width;
var shMenu = screen.height;
var leftMenu = (screen.width - 920) / 2;
leftMenu = leftMenu + 5;
$(document).ready(function() {
	$('#page_menu .page_wtf').css('left', leftMenu + 'px').css('top', '265px');
});

// Head Logo Set
var leftLogo = (screen.width - 920) / 2;
leftLogo = leftLogo + 20;
$(document).ready(function() {
	$('#head_logo').css('left', leftLogo + 'px');
});

// TopMenu
function pageSelectorItemItem(domain, menuID) {
	parent.window.location = "http://" + domain + "/?p=90&s=" + menuID;
}
