/** logo link **/
$('#header div.header_logo').click(function() {
	if (!$(this).attr('x-cms-id')) {
		window.location.href='index.php';
	}
});

/* language selectors */
// hover
$('div.language_selector li').hover(function() {$(this).addClass("over");},function() {if (!$(this).hasClass("x-stay")) $(this).removeClass("over");});
// click
$('div.language_selector li').click(function () { if ($('a',$(this)).attr("href")) { window.location.href = $('a',$(this)).attr("href");}});

/* welcome page boxes */
// hover
$('div.welcome_banner').hover(function() {$(this).addClass("over");},function() {$(this).removeClass("over");});
// click
$('div.welcome_banner').click(function () {
	if ($('a',$(this)).attr("href")) {
		window.location.href = $('a',$(this)).attr("href");
	}
});

/** news **/
$(function(){ 
    $("div#news ul").liScroll({travelocity: 0.025});
});

/** category menu **/
// hover
$('div#category_navigation li').hover(function() {$(this).addClass("over");},function() {if (!$(this).hasClass("x-stay")) $(this).removeClass("over");});
// click
$('div#category_navigation li').click(function () { if ($('a',$(this)).attr("href")) { window.location.href = $('a',$(this)).attr("href");}});

/** page menu **/
// hover
$('div#page_navigation li').mouseover(function(e) {e.stopPropagation();$(this).addClass("over");});
$('div#page_navigation li').mouseout(function(e) {e.stopPropagation();if (!$(this).hasClass("x-stay")) $(this).removeClass("over");});
// click
$('div#page_navigation li').click(function (e) { e.stopPropagation(); if ($('a',$(this)).attr("href")) { window.location.href = $('a',$(this)).attr("href");}});

/** plugin history **/
$('ul.x-cms-history li.entry').hover(function() {$(this).addClass("over");},function() {if (!$(this).hasClass("x-stay")) $(this).removeClass("over");});
// click
$('ul.x-cms-history li.entry').click(function () { if ($('a',$(this)).attr("href")) { window.location.href = $('a',$(this)).attr("href");}});

/** frontpage selector **/
$('#market_select').change(function() {
	window.location.href=$(this).val();
});

/** print icon **/
$('a.printlink').click(function() {
	window.print();
});

/** plugin filter searching **/
$('select.x-cms-selfilter , input.x-cms-txtfilter').each(function() {
	$(this).change(function() {
		selectionFilter($(this).attr('name'),$(this).val());
	});
});
$('input.x-cms-txtfilter').keyup(function() {
	selectionFilter($(this).attr('name'),$(this).val());
});