// JavaScript Document
function changeFontSize( intID ) {
	intID = parseInt( intID );
	var strCSS = "BaseFont11px.css";
	var objSizeChangeCont = document.getElementById( "content" );
	var arrLinks = objSizeChangeCont.getElementsByTagName("a" );
	var objDefault, objBigger;
	for( var i = 0; i < arrLinks.length; i++ ) 	{
		if( getClassName( arrLinks[ i ] ).indexOf("fontsmall") != -1 ) objDefault = arrLinks[ i ] ;
		else if( getClassName( arrLinks[ i ] ).indexOf("fontbig") != -1 ) objBigger = arrLinks[ i ] ;
	}
	removeClass( objDefault, "selectedsmall" );
	removeClass( objBigger, "selectedbig" );
	switch( intID ) {
		case 2:
			strCSS = "BaseFont12px.css";
			addClass( objBigger, "selectedbig" );
			break;
		default:
			strCSS = "BaseFont11px.css";
			addClass( objDefault, "selectedsmall" );
	}
	if( document.getElementById( "fontsize" ).href != "/css/" + strCSS ) {
		// funktioniert nicht mit Opera
		if(navigator.userAgent.toLowerCase().indexOf("opera") == -1) document.getElementById( "fontsize" ).href = "/css/" + strCSS;
		var date = new Date( );
		// cookie valid for 100 days
		date.setTime( date.getTime( ) + ( 100 * 24 * 60 * 60 * 1000 ) );
		var expires = "; expires=" + date.toGMTString( );
		document.cookie = "fontsize=" + intID + expires + "; path=/";
	}
	return false;
}

/**
 * Fügt eine CSS-Klasse zu einem HTML-Element hinzu
 */
function addClass( objNode, strAdd ) {
	var strClass = getClassName( objNode );
	if( strClass.indexOf( strAdd ) != -1 ) return objNode;
	setClassName( objNode, trimString( strClass + ' ' + strAdd ) );
}


/**
 * Entfernt eine CSS-Klasse aus einem HTML-Element
 */
function removeClass( objNode, strRemove ) {
	var strClass = getClassName( objNode );
	setClassName( objNode, trimString( strClass.replace( strRemove, '' ) ) );
}

/**
 * Ermittelt die CSS Klasse eines Elements
 **/
function getClassName(objNode) {
	if(objNode.className) return objNode.className;
	else return objNode.getAttribute("class");
}


/**
 * Setzt den Wert des class-Attributs
 */
function setClassName( objNode, strClass ) {
	// Internet Explorer
	if(objNode.className) objNode.className = strClass;
	else objNode.setAttribute("class", strClass);
}

