

	/*
	 * highlight the VereinList Table
	 */
	function vlistOn(was) {
		was.className = was.className + "_high";
	}
	
	/*
	 * down-light the VereinList Table
	 */
	function vlistOff(was) {
		cl = was.className;
		if (cl=="row1_high") {
			was.className = "row1";
		} else {
			was.className = "row2";
		}
	}
	
	/*
	 * select a row, show the detail popup
	 */
	function selectRow(element, was, moveY) { 
		popName = "detail_popup";
		if (moveY!=null) {
			shiftTo(popName, 20, moveY);
		}
		var x = getElement(popName);
		x.style.display = "block";
		url = "main?module=site&action=ajax" + element + "Detail&sid=" + was.id;
		ajax_loadContent("box", url);
	}
	
	/*
	 * close the verein popup again
	 */
	function closeDetailPopup() {
		var x = getElement("detail_popup");
		x.style.display = "none";
	}
	
	
	/*
	 * load the verein profile popup
	 */
	function showVereinProfil(guid, detail) {
		popName = "detail_popup";
		var x = getElement(popName);
		x.style.display = "block";
		url = "main?module=site&action=ajaxVereinDetail&sid=" + guid;
		if (detail!=null) {
			url = url + "&detail=" + detail;
		}
		ajax_loadContent("box", url);
	}

	/*
	 *  table sorting
	 */
	function sortColumn(module, columnIndex, tableId, localAnchor) {
		var url = "main?module=" + module + "&action=filter_sort&ut=admin&sortCode=" + columnIndex;
		if (tableId!=null) {
			var url = url + "&tableid=" + tableId;
		}
		if (localAnchor!=null) {
			url = url + "#" + localAnchor;
		}
		document.location.href = url;
	}


var currentRssBox = null;
	
function rss_show(databoxid, driverId, offset, forceWidth) {
	
	// hide current one
	if (currentRssBox!=null) {
		currentRssBox.visibility = "hidden";
	}
	
	if (!offset) {
		offset = 0;
	}
	offset = offset + 23;

	var driver = getElement(driverId);
	var y = getAbsTop(driver); //  + getObjectHeight(driver);

	var databox = getElement(databoxid);
	y = y - getAbsTop(databox) - 10 + offset;

	var data = driverId + "_data";
    var dataDiv = getObject(data);
    
    if (dataDiv) {
        dataDiv.visibility = "visible";
        var x1 = getElement(data);
        x1.style.top = y;
        x1.style.left = 0;
        if (forceWidth) {
        	x1.style.width = forceWidth;
        }
        x1.style.zIndex = 1000;
    }
    currentRssBox = dataDiv;
}

function rss_hide_box() {
	if (currentRssBox!=null) {
		currentRssBox.visibility = "hidden";
	}
	currentRssBox = null;
}

function openRss(link) {
	var h = screen.height - 120;
	var params = "width=860,height="+h+",top=15,scrollbars=yes,resizable=yes";
	var hdl = window.open(link, "Schwäbischer Sängerbund  ", params);	
	hdl.focus();
}


function vereinanmeldung() {
	var h = screen.height - 120;
	var params = "width=670,height="+h+",top=15,scrollbars=yes,resizable=yes";
	var hdl = window.open("http://www.ssb1849.de/main?module=vereinanmeldung&action=start", "Anmeldung zum Musikfestival", params);	
	hdl.focus();
}


function anmeldung(was) {
	var h = screen.height - 120;
	var params = "width=670,height="+h+",top=15,scrollbars=yes,resizable=yes";
	var hdl = window.open("anmeldung.jsp?"+was, "Anmeldung", params);	
	hdl.focus();
}

var hoverOffsetX = 0;
var hoverOffsetY = 0;

var curMain = null;
var curHover= null;
var hideMain = null;
var hideHover= null;

var hideWait = 2000;

// mouse über Main-Menu
function mainMove(mainMenu) {
	// erst mal noch ausstehende hides löschen
	hideMain = null;
	hideHover = null;
	if (browserType==null) {
		determineBrowserType();
		var pos = browserType.indexOf("IE");
		if (pos==0) {
			hoverOffsetX = -10;
			hoverOffsetY = 3;
		}
	} 
	// hat sich das MainMenu geändert?
	if (mainMenu!=curMain) {
		hideMain = curMain;
		hideHover = curHover;
		hideMenus();		// sofort ausführen
	}
	// jetzt current anzeigen
	var hoverBox = getElement(mainMenu.id + '_hover');
	curMain = mainMenu;
	mainCssIn(curMain);
	if (hoverBox) {
		curHover = hoverBox;
		var y = getAbsTop(curMain); 
		curHover.style.display = 'block';
		curHover.style.left = 178 + hoverOffsetX;
		curHover.style.top = y - 140 + hoverOffsetY;
		// setZIndex(hoverBox, 1000);
    }
}

// mouse-out über Main-Menu
function mainOut(mainMenu) {
	// hide vorbereiten
	hideMain = mainMenu;
	var hoverBox = getElement(mainMenu.id + '_hover');
    if (hoverBox) {
    	hideHover = hoverBox;	
    }	
    window.setTimeout("hideMenus()", hideWait);		// verzögert aufrufen
}

// mouse über hover
function hoverMove(hoverMenu) {
	// hides löschen
	hideMain = null;
	hideHover = null;
	subCssIn(hoverMenu);
}
// mouse out hover
function hoverOut(hoverMenu) {
	subCssOut(hoverMenu);
	// hide vorbereiten
	hideMain = curMain;
	hideHover = curHover;
    window.setTimeout("hideMenus()", hideWait);		// verzögert aufrufen
}



function hideMenus() {
	if (hideMain!=null) {
		mainCssOut(hideMain);
		hideMain = null;
	}
	if (hideHover!=null) {
        hideHover.style.display = 'none';
	    hideHover = null;
	}	
}


function mainCssIn(menu) {
	setBGColor(menu, "#F9AC52");	
}
function mainCssOut(menu) {
	setBGColor(menu, "#F7F0E0");	
}
function subCssIn(menu) {
	if (menu) {
		setBGColor(menu, "#F9AC52");
	}	
}
function subCssOut(menu) {
	if (menu) {
		setBGColor(menu, "#FDDCB1");
	}
}



var browserType = null;

function determineBrowserType() {
   check=[
	['window.postMessage','window.XMLHttpRequest&&(document.postMessage||window.external)','document.compatMode','(document.detachEvent||document.contentType)'],
	['window.execScript','window.pkcs11','window.opera','window.navigator&&window.navigator.vendor'],
	[['IE 8','FF 3','Op 9.5','KDE?'],
	 ['IE 7','FF 2','Op 9','KDE?'],
	 ['IE 6','FF 1.5','Op 8','KDE/Safari 3'],
	 ['IE 5x','NN 7','Op 7','KDE/Konqu. 3']
	]
   ];
	var j; 
	var b; 
	for(n=0;n<check[1].length;n++) {
		if(!eval(check[1][n])==0)
			b=n;
	}
	for(n=check[0].length;n>-1;n--) {
		if(!eval(check[0][n])==0)
			j=n;
	}
	browserType = (j>-1&&b>-1)?check[2][j][b]:'Älterer Browser o. unbekannt.';
}
