$(function(){

	goTop = function(){
		$.scrollTo(0, {queue:true, duration:300});
		return false;
	}

	$('#gotop').click(function () {
		goTop();
		 return false;
	})
	
	
	var inhaltH = $('.holder').height();
	var windowH = $("body").height();
//	console.log(windowH + " - " + inhaltH);
	if (inhaltH < windowH){
		$('#gotop').hide();
	}


	$('a.email_replace_low').nospam({
		replaceText: true,
		filterLevel: 'low'
	});

	window.defaultStatus="Design + Programming by FEINHEIT kreativ studio · www.feinheit.ch";

	
	$("#nextArtist").click(function(){
		var sel = $("#id_artist")[0];
		var newIndex = 0;
		if(sel.selectedIndex < sel.options.length-1){
			 newIndex = sel.selectedIndex +1;
		}
		window.location.href = "/artists/"+sel.options[newIndex].value;
		return false;
	});
	
	$("#prevArtist").click(function(){
		var sel = $("#id_artist")[0];
		var newIndex = sel.options.length-1;
		if(sel.selectedIndex > 0){
			 newIndex = sel.selectedIndex -1;
		}
		window.location.href = "/artists/"+sel.options[newIndex].value;
		return false;
	});
	
	
});

function checkpageposition(){
	$(".holder").height($(document).height()-200);
	$(".holder2").height($(document).height()-200);
}

$(window).resize(function(){
	checkpageposition();
});

$(function(){
	checkpageposition();
});

if($.browser.safari) {
	jQuery(window).load(function(){
		checkpageposition();
	});
}



function openPopupWindow(mypage,w,h,scrollbar){
	var myname = 'Popup';
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	if(typeof(scrollbar) == "undefined"){scrollbar='yes';}
	var settings ='height='+h+',';
	settings +='width='+w+',';
	settings +='top='+wint+',';
	settings +='left='+winl+',';
	/*settings +='scrollbars='+scrollonoff+',';
	settings +='scrollbars=yes,';*/
	settings +='scrollbars='+scrollbar+',';
	settings +='resizable=yes';
	win=window.open(mypage,myname,settings);
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
