
// Window class
function windowInfo() {
	this.getOuterWidth = function() {
		if (is_ie) 	return document.body.clientWidth // provisorisch: IE aeussere Fenstergoesse?
		else 		return window.outerWidth
	}
	this.getOuterHeigth = function() {
		if (is_ie) 	return document.body.clientHeight
		else 		return window.outerHeight
	}
	/*
	if (is_ie) {
		 	mouseX = window.event.clientX;
		   	mouseY = window.event.clientY;
			windowWidth = document.body.clientWidth
			windowHeight= document.body.clientHeight
	} else {
			mouseX = e.clientX;
		   	mouseY = e.clientY;
			windowWidth = window.innerWidth
			windowHeight= window.innerHeight
	}
	*/
}




//alert("jbasics");
function btn_Set(obj,className) {obj.className=className}
function btn_hover(obj) 	{obj.className="btn_hover"}
function btn_out(obj) 		{obj.className="btn"}
function btn_down(obj) 		{obj.className="btn_active"}
function btn_up(obj) 		{obj.className="btn"}
function btntop_hover(obj) 	{obj.className="btntop_hover"}
function btntop_out(obj) 	{obj.className="btntop"}
function btntop_down(obj) 	{obj.className="btntop_active"}
function btntop_up(obj) 	{obj.className="btntop"}

// BROWSERCHECKS
function checkbrowser() {
	agt       = navigator.userAgent.toLowerCase();
	//alert("checkbrowser" +agt)
	is_ie	  = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	is_opera  = (agt.indexOf("opera") != -1);
	is_mac	  = (agt.indexOf("mac")   != -1);
	is_safari = (agt.indexOf("safari")  != -1); // Safari
	is_mac_ie = (is_ie && is_mac);
	is_win_ie = (is_ie && !is_mac);
	is_gecko  = (navigator.product == "Gecko");
	is_mac_not_moz = (!is_gecko && is_mac);
	is_mac_moz= (is_gecko && is_mac);
	// loadeditor = 1;
	//alert("is_safari "+ is_safari)
	//alert("is_mac_not_moz "+ is_mac_not_moz)
	// alert("is_gecko "+ is_gecko)
	//alert("is_mac_ie "+ is_mac_ie)
}


function openNewWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}


function addevent(el, evname, func) {
	// alert("is_ie " + is_ie + " el: " + el + "   evname: " + evname + " func: " + func);
	if(el) {
		if (is_ie) el.attachEvent("on" + evname, func);
		else       el.addEventListener(evname, func, true);
	} else {
		if (is_ie) attachEvent("on" + evname, func); 			// geht nicht mit document.body
		else       addEventListener(evname, func, true);
	}
}
