var css_path_font_size_normal;
var css_path_font_size_big;
var css_path_font_size_bigger;

/* cookie function */
objNow=new Date();
intExp=2592000000;
objExp=new Date(objNow.getTime()+intExp);

function set_cookie(name, value) {
	document.cookie=name+'='+value+';path=/;';
	document.cookie='expires='+objExp.toGMTString()+';';
  return;
}

function get_cookie(name) {
var cookieValue = '';
  if(strCookie=document.cookie) {
    if(strCookie.indexOf(name) > -1) {
    	var cookiePart = strCookie.substring(strCookie.indexOf(name));
    	var semipos = cookiePart.indexOf(';');
    	if(semipos < 0)	{
      	cookieValue = cookiePart.substring((name.length+1));
      }
      else{
      	cookieValue = cookiePart.substring((name.length+1), semipos);
      }
    }
  }
  return(cookieValue);
}
/* END: cookie function */


/* Fontsizer */
var NORMAL_FONTSIZE = 1;
var currentFontSize = NORMAL_FONTSIZE;

function createStyleElements(){
	var header = document.getElementsByTagName("head")[0];
	
  var initFontSize = document.createElement('link');
  initFontSize.setAttribute('rel','stylesheet');
  initFontSize.setAttribute('media','screen');
  initFontSize.setAttribute('type','text/css');
  initFontSize.setAttribute('href','' + css_path_font_size_normal); //'style/html/css/font_size_normal.css'
  header.appendChild(initFontSize);
}

function fontsizer(size) {
	//alert('fontsizer('+size+') aufgerufen!');
	size = size*1;

	var header = document.getElementsByTagName("head")[0];
  
  if(size-currentFontSize == 2){
		header.lastChild.href = '' + css_path_font_size_big;
  }

  switch(size) {
  	case 0:
  		return;
  	case 1:
  		if (currentFontSize > size) {
				header.lastChild.href = ''+css_path_font_size_normal;
  		}  		
  		break;
  	case 2:
  		if(currentFontSize < size) {
  			header.lastChild.href = ''+css_path_font_size_big;
  		}
  		else {
  			header.lastChild.href = ''+css_path_font_size_big;
  		}
  		break;
  	case 3:
  		if(currentFontSize < size) {  			
  			header.lastChild.href = ''+css_path_font_size_bigger;
  		}
  		break;
  	case 4:
  		return;
		}
		
		set_cookie('EurohypoFontSize',size);
		currentFontSize = size;
		
}
