ï»¿
// designed by iFactory, Würzburg, Germany       //

// Copyright 2000-2008 by iFactory               //
// All rights reserved.                          //
// Duplication in any form or any use of this    //
// script or parts of it are strictly prohibited //
// for private and commercial use.               //


/****************************************************************
 * global constants
 ****************************************************************/
start    = false;

accounts = false;
units    = false;
events   = false;

join     = false;
contact  = false;


/****************************************************************
 * functions
 ****************************************************************/

/**
 * xmlHttp functionality for IE
 */
/*@cc_on @if (@_win32 && @_jscript_version >= 5) if (!window.XMLHttpRequest)
function XMLHttpRequest () {
	try {
		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
		try {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch(e) {
			xmlHttp = false;
		}
	}
	return xmlHttp;
}
@end @*/


/****************************************************************
 * classes
 ****************************************************************/

/**
 * acces key functionality
 */
var AccessKey = {
	akl: new Array(),   // access key list
	alt: false,         // alt key state

	// init access keys
	init: function () {
		link = document.getElementsByTagName("a");

		if (link) {
			for(l=0,a=0; l<link.length; l++) {
				akey = link[l].getAttribute("accesskey");
				if (akey)
					AccessKey.akl[a++] = new Array(akey.charCodeAt(0), link[l].getAttribute("href"));
			}
		}

		if (AccessKey.akl.length) window.document.onkeydown = AccessKey.onKeyDown;
	},

	// handle key event
	onKeyDown: function (evt) {

		if (AccessKey.akl.length) {

			if (evt)
				key = parseInt(evt.keyCode);
			else if (window.event)
				key = parseInt(window.event.keyCode);

			if(key == 18)
				// get alt key
				AccessKey.alt = true;

			else {
				// get command key
				for(a=0; a<AccessKey.akl.length; a++) {
					if(AccessKey.akl[a][0]==key && AccessKey.alt) {
						document.location.href = AccessKey.akl[a][1];
						break;
					}
				}
				AccessKey.alt = false;
			}
		}
	}
};


/**
 * global initialization
 */
function init (evt) {
	// init access keys
	AccessKey.init();

	// init lists
	row = document.getElementsByTagName("tr");
	for (r=0; r<row.length; r++) {
		if (!row[r].className.match('odd') && !row[r].className.match('even')) continue;

		row[r].onmouseover = function () { this.className += ' hover'; }
		row[r].onmouseout  = function () { this.className = this.className.replace(' hover',''); }
	}

	// init modules
	if (start) {
if(document.getElementById("b1").src.search("modedesign1")==-1){
document.getElementById("b1").src="../pic/modedesign1.jpg";
document.getElementById("b2").src="../pic/modedesign2.jpg";
}else{
document.getElementById("b1").src="../pic/textildesign1.jpg";
document.getElementById("b2").src="../pic/textildesign2.jpg";
}
window.setTimeout("chgPics();",5000);
	}

	if (accounts) initAccounts();
	if (units)    initUnits();
	if (events)   initEvents();

	if (join)     initJoin();
	if (contact)  initContact();
}

// set init handler
window.onload = init;

