
var aktuellaktuell = 1;

function doresize() {
	
	
}

function showsub(element) {
	
}

jQuery(document).ready(function () {
	setupsub();
});

function gopage(url) {
	if ('undefined' != typeof window.location.href) {
		window.location.href = url;
	} else {
		location.href = url;
	}
}

function add_nav_icon(jqo,detection) {
	var img_tag = '<img class="sidenavicon" src="'+ pathtoicons + 'smallicons/' + detection +'" alt="Seiten-Icon" width="30" height="30" />';
	jqo.children("a").first().prepend(img_tag);
}

function setupsub() {
	jQuery(".subul .current_page_item").removeClass("current_page_item");
	jQuery(".parent-pageid-1126 #versich_item").addClass("current_page_item");
	restore_highlight();
	
	jQuery("#main_nav_list").children("li").each(function () {
		
		jQuery(this).mouseenter(function () {
			do_highlight_top(jQuery(this).children().first());
			jQuery(".subul").hide();
			if (jQuery(this).children("ul").length > 0) {
				jQuery(this).children("ul").first().show();
			}
		});
	});
	
	jQuery(".subul li").mouseenter(function () {
		jQuery(".tsubhigh").removeClass("tsubhigh");
		jQuery(".tsubhigha").removeClass("tsubhigha");
		jQuery(this).addClass("tsubhigh");
		jQuery(this).children("a").first().addClass("tsubhigha");
	});
	
	jQuery("#main_nav_list").mouseleave(function () {
		restore_highlight();
		jQuery(".tsubhigh").removeClass("tsubhigh");
		jQuery(".tsubhigha").removeClass("tsubhigha");
		jQuery(".subul").hide();
	});
	
	if (jQuery("#sidemenuepoints").length > 0) {
		
		jQuery("#sidemenuepoints").mouseleave(function () {
			restore_highlight();
		});
		
		jQuery("#sidemenuepoints li").first().css('borderTop','0px');
		jQuery("#sidemenuepoints li").last().css('borderBottom','0px');
		jQuery("#sidemenuepoints li").last().children("a").first().css('borderBottom','0px');
		
		
		jQuery("#sidemenuepoints li").each(function () {
			if (jQuery(this).hasClass("page-item-1128")) {
				add_nav_icon(jQuery(this),'versicherungen/rechtsschutz.jpg');
			}
			if (jQuery(this).hasClass("page-item-1129")) {
				add_nav_icon(jQuery(this),'versicherungen/privathaftpflicht.jpg');
			}
			if (jQuery(this).hasClass("page-item-1141")) {
				add_nav_icon(jQuery(this),'versicherungen/hundehalterhaftpflicht.jpg');
			}
			if (jQuery(this).hasClass("page-item-1143")) {
				add_nav_icon(jQuery(this),'versicherungen/pferdehaftpflicht.jpg');
			}
			if (jQuery(this).hasClass("page-item-1131")) {
				add_nav_icon(jQuery(this),'versicherungen/hausrat.jpg');
			}
			if (jQuery(this).hasClass("page-item-1133")) {
				add_nav_icon(jQuery(this),'versicherungen/unfall.jpg');
			}
			if (jQuery(this).hasClass("page-item-1139")) {
				add_nav_icon(jQuery(this),'versicherungen/wohngebaeude.jpg');
			}
			if (jQuery(this).hasClass("page-item-1135")) {
				add_nav_icon(jQuery(this),'versicherungen/kfz.jpg');
			}
			if (jQuery(this).hasClass("page-item-1137")) {
				add_nav_icon(jQuery(this),'versicherungen/motorrad.jpg');
			}
			if (jQuery(this).hasClass("page-item-1822") || jQuery(this).hasClass("page-item-1825") ) {
				add_nav_icon(jQuery(this),'versicherungen/krankenversicherung.jpg');
			}
			
			
			jQuery(this).mouseenter(function () {
				do_highlight(jQuery(this));
			});
		});
	}
}

function do_highlight(jqo) {
	jQuery(".thighlit").removeClass("thighlit");
	jQuery(".parenthighlit").removeClass("parenthighlit");
	jqo.addClass("thighlit");
	jqo.addClass("parenthighlit");
}

function do_highlight_top(jqo) {
	jQuery(".thighlit_top").removeClass("thighlit_top");
	jQuery(".parenthighlit_top").removeClass("parenthighlit_top");
	jqo.addClass("thighlit_top");
	jqo.parent().addClass("parenthighlit_top");
}

function restore_highlight() {
	jQuery(".thighlit").removeClass("thighlit");
	jQuery(".parenthighlit").removeClass("parenthighlit");
	jQuery("#fullcontent_container .current_page_item").addClass("thighlit");
	jQuery("#fullcontent_container .current_page_item").addClass("parenthighlit");
	
	jQuery(".thighlit_top").removeClass("thighlit_top");
	jQuery(".parenthighlit_top").removeClass("parenthighlit_top");
	jQuery("#main_nav_list .current_page_item").children().first().addClass("thighlit_top");
	jQuery("#main_nav_list .current_page_item").addClass("parenthighlit_top");
}

