function movies(href)
{
	var win;
	var dest = href;
	win=window.open (href,"_blank","width=520,height=480,screenX=0,screenY=0,top=0,resizable=no, scrollbars=no, copyhistory=no");
	win.focus();
}

function vimeo(href)
{
	var win;
	var dest = href;
	win=window.open (href,"_blank","width=750,height=520,screenX=0,screenY=0,top=0,resizable=yes, scrollbars=no, copyhistory=no");
	win.focus();
}

function thumb(href)
{
	var win;
	var dest = href;
	win=window.open (href,"_blank","width=460,height=480,screenX=0,screenY=0,top=0,resizable=no, scrollbars=no, copyhistory=no");
	win.focus();
}
	
function city_games()
{
	var win;
	win=window.open ("popups/popup_cg.php","","width=510,height=460,screenX=0,screenY=0,top=0,resizable=no, scrollbars=no, copyhistory=no");
	win.focus();
}	

function results(href)
{
	var win;
	var dest = href;
	win=window.open (dest, "_blank","width=525,height=600, screenX=0, screenY=0, top=10, resizable=no, scrollbars=no, copyhistory=no");
	win.focus();
}

function info(text)
{
	var win;
	win=window.open ("popups/popup_info.php?text="+text,"","width=510,height=660,screenX=0,screenY=0,top=0,resizable=no, scrollbars=no, copyhistory=no");
	win.focus();
}

function camping(href)
{
	var win;
	win=window.open (href,"","width=510,height=660,screenX=0,screenY=0,top=0,resizable=no, scrollbars=no, copyhistory=no");
	win.focus();
}
	
function liga()
{
	var win;
	win=window.open ("popup_liga.php","Mellowparkliga","width=460,height=480,screenX=0,screenY=0,top=0,resizable=no, scrollbars=no, copyhistory=no");
	win.focus();
}

function karte(href) 
{
	var win;
	var dest = href; 
	window.open (dest, 'Karte', 'scrollbars=no, toolbar=no, location=no, directories=no, status=no,  resizable=no, copyhistory=no, width=900, menubar=no, height=658')
}

function picsShow(dir)
{
	var scrW = screen.availWidth;
	var scrH = screen.availHeight;
	
	scrX = (scrW - 800 - 20) * .5;
    scrY = (scrH - 600 - 20) * .5;
	
	var win;
	win=window.open ("mellowparkCampus/picsPopup.php?dir="+dir,"_blank","width=753,height=650,screenX="+scrX+",screenY="+scrY+",top="+scrY+",resizable=no, scrollbars=no, copyhistory=no");
	win.focus();
}

function overEffect(show, hide, active) {
	var show = show;
	var hide = hide;
	var active = active;
	
	document.getElementById(show).style.display = 'block';
	document.getElementById(hide).style.display = 'none';
	
	//den aktiven immer auf "over" lassen
	document.getElementById(active+"_over").style.display = 'block';
	document.getElementById(active).style.display = 'none';
}

//over effekt bei karte
function showTip(source, leftPx, topPx){

	var tip = source.nextSibling;
 	var top = 0;
 	tip.style.display = "block";
 	
 	if(topPx)
 		top = source.offsetTop - topPx;
 	else
 		top = source.offsetTop - (tip.offsetHeight/2);
 	
 	tip.style.top = top+"px";
 	left = source.offsetLeft+leftPx; 
 	tip.style.left = left+"px";
 	tip.style.visibility = "visible";
 	return false;
}

function hideTip(source){
 	var tip = source.nextSibling;
 	tip.style.display = "none";
 	tip.style.visibility = "hidden";
 	return false;
}

function showVideoTitle(titleDiv) {
	var title = titleDiv.previousSibling;
	title.style.display = "block";
	title.style.visibility = "visible";
 	return false;
}

function hideVideoTitle(titleDiv) {
	var title = titleDiv.previousSibling;
	title.style.display = "none";
	title.style.visibility = "hidden";
 	return false;
}

function showDiv(element) {
	var element = document.getElementById(element);
	element.style.display = "block";
}

function hideDiv(element) {
	var element = document.getElementById(element);
	element.style.display = "none";
}

function changeText(curText) {
	
	// erst mal alle ausschalten
	document.getElementById('Brot').style.display = 'none';
	document.getElementById('Lagerfeuer').style.display = 'none';
	document.getElementById('Mellowpark').style.display = 'none';
	document.getElementById('Ausstellungen').style.display = 'none';
	
	
	// aktuelles einschalten			
	element = document.getElementById(curText);
	element.style.display = 'block';
}

//player ein- & ausschalten & aktuelles thumbnail markieren
function changeVideo(id) {
	
	var player = document.getElementById('videos').getElementsByTagName('DIV');
	var thumbs = document.getElementById('video_thumbnails').getElementsByTagName('DIV');
	
	for(i=0;i<player.length;i++) {  
        player[i].style.display = "none";  
    } 
    
    for(i=0;i<thumbs.length;i++) {
    	if(thumbs[i].className != "none" && thumbs[i].className != "tooltip")
    		thumbs[i].className = "inactive";
    } 

	document.getElementById(id).style.display = "block";
   	document.getElementById('thumb_'+id).className = "active";
}

var aktiv;

function moveThumbs(op) {

	var speed = 315;
	var marginTop = document.getElementById('thumbs').style.marginTop;
	var height = document.getElementById('thumbs').scrollHeight;
	var marginNum = marginTop.split("px");
	var pos = 0;
	
	if(op == '+') {
		pos = marginNum[0] - speed;
		arrowCheck = pos-speed;
	} else {
		pos = parseInt(marginNum[0]) + speed;
		arrowCheck = pos-speed;
	}
	
	document.getElementById('thumbs').style.marginTop = pos+"px";
	
	if(pos >= 0)
		document.getElementById('up').style.visibility = "hidden";
	else
		document.getElementById('up').style.visibility = "visible";
	
	//alert("pos="+pos+"\narrowCheck="+arrowCheck+"\nneg. height="+(-height));
	
	if(arrowCheck <= -height)
		document.getElementById('down').style.visibility = "hidden";
	else
		document.getElementById('down').style.visibility = "visible";
}
