/* ============================================================================ */
/* ==========================  GMF Core Objekt ================================ */
/* ============================================================================ */
var GMF = {
	CONFIG: {
		BASE_DIR:	(window.location.protocol + "//" + window.location.host + "/public/script/"), /* Für das scriptverzeichnis *.js */
		DEBUG:		false, /* schaltet den debugger ein|aus */
		LOCAL:		(window.location.host == '127.0.0.1' || window.location.host == 'localhost')
	},
	BROWSER: {
		IE:     		!!(window.attachEvent && !window.opera),
		Opera:  		!!window.opera,
		WebKit: 		navigator.userAgent.indexOf('AppleWebKit/') > -1,
		Gecko:  		navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
		MobileSafari: 	!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
	},
	d:document,
	tag:function(element){return this.d.getElementsByTagName(element)},
	name:function(element){return this.d.getElementsByName(element)},
	ce:function(element){return this.d.createElement(element)},
	init:function()
	{
		this.loadJS('iepngfix/iepngfix_tilebg.compressed.js');
		$.ajaxSetup({
			async:false,
			traditional:false,
			cache:false
			/*contentType:"multipart/form-data"*/
		});
	},
	loadJS:function(url)
	{
		var s = this.ce('script');
		s.type = "text/javascript";
		s.src = this.CONFIG.BASE_DIR + url;
		this.tag('head')[0].appendChild(s);
		this.debug('load: '+s.src);
	},
	debug:function(arg)
	{
		if(this.CONFIG.DEBUG == true) alert(arg);
	},
	getDivWidth:function(el)
	{
		return parseInt(el ? (el.style.width || el.clientWidth || el.offsetWidth || el.style.pixelWidth || 0) : 0);
	},
	getDivHeight:function(el)
	{
		return parseInt(el ? (el.style.height || el.clientHeight || el.offsetHeight || el.style.pixelHeight || 0) : 0);
	},
	hideShow:function(el) {
		if(el.style) {
			var current = el.style.display;
			el.style.display = (current == 'none') ? '' : 'none';
		}
	},
	goTo:function(url) {
		window.location.href = url;
	},
	$:function(i) {
		return this.d.getElementById(i) || null;
	}
};
