
/*<![CDATA[*/

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Javascript Functions      														   *
 * ----------------------------------------------------------------------------------- *
 * Version:					1.0													   *
 * Author:					re-lounge (http://www.re-lounge.com)					   *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 			*/
 
/* --------------------------------------------------------------------------------------
 * FUNCTION P7_limit(a,b) 
 * --------------------------------------------------------------------------------------
 * Emulates min-width functionality in IE. (v1.1.2)
 * Author: P7, www.projectseven.com
 */
 function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

 
function P7_limit(a,b) {
	document.p7limit=a;
	document.p7min=b;
 	if(document.getElementById&&navigator.appVersion.indexOf("MSIE")>-1&&!window.opera){
		if(window.attachEvent){
			window.attachEvent("onresize",P7_setMinWidth);
			window.attachEvent("onload",P7_setMinWidth);
		} else {
			onload=P7_setMinWidth;
			onresize=P7_setMinWidth;
		}
	}
}
P7_limit('pageContainer',770);

/* --------------------------------------------------------------------------------------
 * FUNCTION P7_setMinWidth()
 * --------------------------------------------------------------------------------------
 * Emulates min-width functionality in IE. (v1.1.2)
 * Author: P7, www.projectseven.com
 */
function P7_setMinWidth(){
	var cw,w,pl,pr,ml,mr,br,bl,ad,theDiv=document.p7limit;
	var g=document.getElementById(theDiv);
	w=parseInt(document.p7min);
	if(g&&document.body&&document.body.clientWidth){
		gs=g.currentStyle;
		cw=parseInt(document.body.clientWidth);
		pl=parseInt(gs.paddingLeft);
		pr=parseInt(gs.paddingRight);
		ml=parseInt(gs.marginLeft);
		mr=parseInt(gs.marginRight);
		bl=parseInt(gs.borderLeftWidth);
		br=parseInt(gs.borderRightWidth);
		ml=ml?ml:0;
		mr=mr?mr:0;
		pl=pl?pl:0;
		pr=pr?pr:0;
		bl=bl?bl:0;
		br=br?br:0;
		ad=pl+pr+ml+mr+bl+br;
		if(cw<=w){
			w-=ad;
			g.style.width=w+"px";
		} else {
			g.style.width="auto";
		}
	}
}

/* --------------------------------------------------------------------------------------
 * FUNCTION openWindow(dir, name, width, height, scroll, toolbar, resizable)
 * --------------------------------------------------------------------------------------
 * used for opening big pictures and gallery in popup window
 * Author: 
 */
function openWindow(dir, name, width, height, scroll, toolbar, resizable) {
	dirName=dir
	param= "width="+width+",height="+height+",screenX=0,screenY=0, top=0, left=0, menubar=no, locationbar=no, status=no";
	
	if(toolbar)
		param+=",toolbar=yes"
	
	if(scroll)
		param+=",scrollbars=yes"
		
	if(resizable)
		param+=",resizable=yes"
	else
		param+=",resizable=no"
		
	winName= name.replace(/ /,"_")
	
	if(winName!='popup' && winName !='manager')
		winName+= Math.floor(Math.random()*100000);
	
	window.open(dirName, winName, param);
}

/* --------------------------------------------------------------------------------------
 * FUNCTION setLetterDimension()
 * --------------------------------------------------------------------------------------
 * Changes current letter dimension by increasing or decreasing by "val" and reloads page.
 * Uses minLetterSize and maxLetterSize to limit letter dimension
 * Writes an integer to the Cookie
 * Author: re-lounge, http://www.re-lounge.com
 */
var minLetterSize = 80; //for 0.65em;
var maxLetterSize = 115; //for 1.45em; 
var steps = 10; //for 0.1em;
function setLetterDimension(val) {
	var newSize = 80; //for 0.75em;
	if (GetCookie("letterSize")) {
		newSize = GetCookie("letterSize");
	}
	
	if (val==1) {
		for(i=0;i<steps;i++) {
			newSize++;
		}
	}
	
	if (val==0) {
		for(i=0;i<steps;i++) {
			newSize--;
		}	
	}
	
	// Set cookie
	SetCookie("letterSize",newSize,expdateAll,"/");
	// Reload
	window.history.go(0);
	
}
/* --------------------------------------------------------------------------------------
 * FUNCTION nextMin()
 * --------------------------------------------------------------------------------------
 * Returns true if next step of decreasing letter size is possible, else returns false
 * Author: re-lounge, http://www.re-lounge.com
 */
function nextMin() {
	var nextSize = GetCookie("letterSize");
	if (nextSize == "") nextSize=75;
	for(i=0;i<steps;i++) {
		nextSize--;
	}
	if(nextSize >= minLetterSize)
		return true;
	else
		return false;
}
/* --------------------------------------------------------------------------------------
 * FUNCTION nextMax()
 * --------------------------------------------------------------------------------------
 * Returns true if next step of increasing letter size is possible, else returns false
 * Author: re-lounge, http://www.re-lounge.com
 */
function nextMax() {
	var nextSize = GetCookie("letterSize");
	if (nextSize == "") nextSize=75;
	for(i=0;i<steps;i++) {
		nextSize++;
	}
	if(nextSize <= maxLetterSize)
		return true;
	else
		return false;	
}


/* --------------------------------------------------------------------------------------
 * FUNCTION setStylesheet()
 * --------------------------------------------------------------------------------------
 * Changes current stylesheet (to given stylesheet reference "val") and reloads page.
 * Author: re-lounge, http://www.re-lounge.com
 */
function setStylesheet(val) {
	// Set cookie
	SetCookie("style",val,expdateAll,"/");
	// Reload
	window.history.go(0);
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *																					   *
 * 	Cookie related functions														   *
 *																					   *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 			*/

/* --------------------------------------------------------------------------------------
 * FUNCTION cookiesEnabled()
 * --------------------------------------------------------------------------------------
 * Verifies if cookies are enabled and writes "true" or "false" in a global variable.
 * Author: re-lounge, http://www.re-lounge.com
 */
function cookiesEnabled(){
	var now = new Date();
	var val = String(now.getTime());
	SetCookie("cookieTest",val);
	cookiesEnabled = false;
	if (GetCookie("cookieTest")==val)
		return true;
	else
		return false;
} 
var cookiesEnabled = cookiesEnabled();
 
/* --------------------------------------------------------------------------------------
 * FUNCTION initCookieDate()
 * --------------------------------------------------------------------------------------
 * Initialises cookie expiries for new and changed cookies.
 * Author: re-lounge, http://www.re-lounge.com
 *
 * The following data is collected in cookies:
 *
 * - Current style used
 * - Current view of service elements in service area (open or closed)
 * - Current view service area (open or closed)
 *
 * The cookie expiry is 3 months for all element data.
 *
 */
function initCookieDate(){
	expdateAll = new Date ();
	expdateAll.setTime(expdateAll.getTime() + (3 * 30 * 24 * 60 * 60 * 1000));	// 3 Monate
}
initCookieDate();

// --------------------------------------------------------------------------------------
//  Cookie Functions -- "Night of the Living Cookie" Version (25-Jul-96)
// --------------------------------------------------------------------------------------
//
//  Written by:  Bill Dortch, hIdaho Design <bdortch@hidaho.com>
//  The following functions are released to the public domain.
//
//  This version takes a more aggressive approach to deleting
//  cookies.  Previous versions set the expiration date to one
//  millisecond prior to the current time; however, this method
//  did not work in Netscape 2.02 (though it does in earlier and
//  later versions), resulting in "zombie" cookies that would not
//  die.  DeleteCookie now sets the expiration date to the earliest
//  usable date (one second into 1970), and sets the cookie's value
//  to null for good measure.
//
//  Also, this version adds optional path and domain parameters to
//  the DeleteCookie function.  If you specify a path and/or domain
//  when creating (setting) a cookie**, you must specify the same
//  path/domain when deleting it, or deletion will not occur.
//
//  The FixCookieDate function must now be called explicitly to
//  correct for the 2.x Mac date bug.  This function should be
//  called *once* after a Date object is created and before it
//  is passed (as an expiration date) to SetCookie.  Because the
//  Mac date bug affects all dates, not just those passed to
//  SetCookie, you might want to make it a habit to call
//  FixCookieDate any time you create a new Date object:
//
//    var theDate = new Date();
//    FixCookieDate (theDate);
//
//  Calling FixCookieDate has no effect on platforms other than
//  the Mac, so there is no need to determine the user's platform
//  prior to calling it.
//
//  This version also incorporates several minor coding improvements.
//
//  **Note that it is possible to set multiple cookies with the same
//  name but different (nested) paths.  For example:
//
//    SetCookie ("color","red",null,"/outer");
//    SetCookie ("color","blue",null,"/outer/inner");
//
//  However, GetCookie cannot distinguish between these and will return
//  the first cookie that matches a given name.  It is therefore
//  recommended that you *not* use the same name for cookies with
//  different paths.  (Bear in mind that there is *always* a path
//  associated with a cookie; if you don't explicitly specify one,
//  the path of the setting document is used.)
//  
//  Revision History:
//
//    "Toss Your Cookies" Version (22-Mar-96)
//      - Added FixCookieDate() function to correct for Mac date bug
//
//    "Second Helping" Version (21-Jan-96)
//      - Added path, domain and secure parameters to SetCookie
//      - Replaced home-rolled encode/decode functions with Netscape's
//        new (then) escape and unescape functions
//
//    "Free Cookies" Version (December 95)
//
//
//  For information on the significance of cookie parameters, and
//  and on cookies in general, please refer to the official cookie
//  spec, at:
//
//      http://www.netscape.com/newsref/std/cookie_spec.html    
//
//******************************************************************
//
// "Internal" function to return the decoded value of a cookie
//
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
//
//  Function to correct for 2.x Mac date bug.  Call this function to
//  fix a date object prior to passing it to SetCookie.
//  IMPORTANT:  This function should only be called *once* for
//  any given date object!  See example at the end of this document.
//
function FixCookieDate (date) {
  var base = new Date(0);
  var skew = base.getTime(); // dawn of (Unix) time - should be 0
  if (skew > 0)  // Except on the Mac - ahead of its time
    date.setTime (date.getTime() - skew);
}
//
//  Function to return the value of the cookie specified by "name".
//    name - String object containing the cookie name.
//    returns - String object containing the cookie value, or null if
//      the cookie does not exist.
//
function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}
//
//  Function to create or update a cookie.
//    name - String object containing the cookie name.
//    value - String object containing the cookie value.  May contain
//      any valid string characters.
//    [expires] - Date object containing the expiration data of the cookie.  If
//      omitted or null, expires the cookie at the end of the current session.
//    [path] - String object indicating the path for which the cookie is valid.
//      If omitted or null, uses the path of the calling document.
//    [domain] - String object indicating the domain for which the cookie is
//      valid.  If omitted or null, uses the domain of the calling document.
//    [secure] - Boolean (true/false) value indicating whether cookie transmission
//      requires a secure channel (HTTPS).  
//
//  The first two parameters are required.  The others, if supplied, must
//  be passed in the order listed above.  To omit an unused optional field,
//  use null as a place holder.  For example, to call SetCookie using name,
//  value and path, you would code:
//
//      SetCookie ("myCookieName", "myCookieValue", null, "/");
//
//  Note that trailing omitted parameters do not require a placeholder.
//
//  To set a secure cookie for path "/myPath", that expires after the
//  current session, you might code:
//
//      SetCookie (myCookieVar, cookieValueVar, null, "/myPath", null, true);
//
function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

//  Function to delete a cookie. (Sets expiration date to start of epoch)
//    name -   String object containing the cookie name
//    path -   String object containing the path of the cookie to delete.  This MUST
//             be the same as the path used to create the cookie, or null/omitted if
//             no path was specified when creating the cookie.
//    domain - String object containing the domain of the cookie to delete.  This MUST
//             be the same as the domain used to create the cookie, or null/omitted if
//             no domain was specified when creating the cookie.
//
function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}


/* --------------------------------------------------------------------------------------
 * FUNCTION
 * --------------------------------------------------------------------------------------
 * 
 * Author: 
 */
function reload() {
	history.go(0);
}

function getHelp(){
	window.open("http://www.aquantum.net/syndicat/default.asp?id=help","syndicat_help");
}
function check_client() {      
    var client = "";
    var bName = navigator.appName;
    var bVer = parseInt(navigator.appVersion);

    if(bName == "Netscape" && bVer > 4) client = "n6";
    else if(bName == "Netscape" && bVer == 4) client = "n4";
    else if(bName == "Netscape" && bVer == 3) client = "n3";
    else if(bName == "Netscape" && bVer == 2) client = "n2";
    
    else if(bName == "Microsoft Internet Explorer" && bVer >= 4) client="e4";
    else if(bName == "Microsoft Internet Explorer" && bVer >= 2) client="e3";
    else client = "x";
    
    return client;
}

/* switch_display(id):
 *
 *	Schaltet bei dem Element mit der übergebenen ID den Display-Stil zwischen
 *	'block' und 'none' um. Falls zu dem Element auch noch ein Icon oder Link
 *	existiert (erkennbar am Anhang '_icon' oder '_link' an der ID), werden
 *	dort die Stile/Grafiken getauscht.
 */
function switch_display(id) {
	var obj = document.getElementById(id);
	var icon = document.getElementById(id+'_icon');
	var link = document.getElementById(id+'_link');
				
	if (obj.style.display == 'none') { 
		//open new
		obj.style.display = 'block';
		if (icon) 
			icon.src='media/css/icons/icon_offen.gif';
		if (link)
			link.className='subDocActive';
	} else {
		//close new
		obj.style.display = 'none';
		if (icon)
			icon.src='media/css/icons/icon_link_intern.gif';
		if (link)
			link.className='';
	}
}

/* --------------------------------------------------------------------------------------
 * FUNCTION addToFavorites()
 * --------------------------------------------------------------------------------------
 * Sets a new bookmark.
 * Author: re-lounge, http://www.re-lounge.com
 */
function addToFavorites(title,href) {
	// Get-Variable entfernen
	if (href.indexOf("?")>=0)
		href = href.substring(0,href.indexOf("?"));
	if (document.all) {
		window.external.AddFavorite(href,title);
	} else if (window.sidebar && window.sidebar.addPanel) {
		return true;
	} else if( window.opera && window.print ) {
		return true;
	} else {
		return false;
	}
	return false;
}


function machfenster()
{
   w = window.open('about:blank', 'MeinFenster', 'width=450,height=400');
   w.focus();
}


/*]]*/