/*---------------------START jQuery Ready---------------------------*/
$(document).ready(function() {
/*---------------------START Linkstyles---------------------------*/

$(".newsbeitrag a[href^=http://]").not(".newsbeitrag a[href^=http://www.kollermedia]").addClass("extern").attr("target", "blank");
$('#wp_movie_ratings a').removeClass('extern');
$('.element a').removeClass('extern');
/*---------------------END Linkstyles---------------------------*/		

		
$("#nav-one li").hover(
function () {$(this).addClass("hover");}, 
function () {$(this).removeClass("hover");
});

$("#categories").treeview({
	collapsed: true,
	animated: "medium",
	persist: "location"
});

$("#slidebutton").click(function(){
$("#topnews").slideToggle("slow");
$(this).toggleClass("active"); return false;
});



/*Start Toolbar Tabs*/
$(".toolbox li a").click(function(){
return false;
});

$(".toolbox li a").mouseover(function(){
boxid = parseFloat($(this).parents("div.toolbox").attr("id").match(/\d+\.?\d*/gi)[0]); //find out the linkid 
$("#toolbox_"+boxid+" a").removeClass("tabactive");
$(this).addClass("tabactive");
var index = $("#toolbox_"+boxid+" a").index(this);
if(index ==2) {index2=3;}  if(index ==3) {index2=5;} else {index2 = index;};
$("#toolboxcontent_"+boxid+" div:not(.post-ratings)").css("display", "none");
$("#toolboxcontent_"+boxid+" div").eq(index2).css("display", "block");
return false;
});
/*End Toolbar Tabs*/



function tabs (mainid, sidebarnr) {
active = $("#"+mainid+" div.submenu li a.tabactive").attr("href");
$("#"+mainid+" div."+sidebarnr).css("display", "none");
$(active).css("display", "block");

$("#"+mainid+" div.submenu li a").mouseover(function(){					  
$("#"+mainid+" div.submenu li a").removeClass("tabactive");
$(this).addClass("tabactive");
active=$(this).attr("href");
$("#"+mainid+" div."+sidebarnr).css("display", "none");
$(active).css("display", "block");
});

$("#"+mainid+" div.submenu li a").click(function(){
return false;
});

}

tabs("topnews", "sidebarlayer1");
tabs("overview", "sidebarlayer1");
tabs("about", "sidebarlayer");
tabs("highlights", "sidebarlayer");
tabs("creative", "creativeboxlayer");
	
	
	
$(".posttext tr:nth-child(odd)").addClass("odd");
$('.posttext tr').hover(
function() {$(this).addClass('pretty-hover');}, 
function() {$(this).removeClass('pretty-hover');
});
	
$("#post-165 tr:nth-child(odd), #post-168 tr:nth-child(odd)").addClass("odd");

	
});
/*---------------------END jQuery Ready---------------------------*/



/* Start Background Image Change Pattern4u*/
function change_bg(new_source,id)
{
    object=(document.all)?document.all[id]:document.getElementById(id);
    object.style.backgroundImage="url("+new_source+")";
}
/* End Background Image Change Pattern4u*/


/* Start Popup */
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+','
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
/*End Popup */



// Toggle display of movie reviews in page mode
function toggle_review(id) {
	var review = document.getElementById(id)
	var img_array = review.parentNode.getElementsByTagName('img')
	var img_plus = img_array[0]
	var img_minus = img_array[1]

	if (review && img_plus && img_minus) {
		// Show the review
		if (review.style.display == 'none') {
			if (review.style.setProperty) { 
				review.style.setProperty('display', 'block', 'important')
			} else {
				review.style.display = 'block'
			}

			img_plus.style.display = 'none'
			img_minus.style.display = 'block'

		} else { // Hide the review
			if (review.style.setProperty) {
				review.style.setProperty('display', 'none', 'important')
			} else {
				review.style.display = 'none'
			}

			img_minus.style.display = 'none'
			img_plus.style.display = 'block'
		}
	}
}
/* End Movie Reviews */
