/*start of the core Object*/
if(typeof com=="undefined"){var com=new Object();}
if(typeof com.zetzi=="undefined"){com.zetzi=new Object();}
com.zetzi.core = function(){
  this.IE = document.all ? true : false;
  this.hexziffern	= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")
  this.winDims();
};
com.zetzi.core.prototype = {
  winDims:function(){
    this.windowWidth = (this.IE)? document.body.offsetWidth:window.innerWidth;
    this.windowHeight = (this.IE)? document.body.offsetHeight:window.innerHeight;
  },
  getWindowWidth:function(){
    fwidth = 0;
    if (document.all){
      fwidth = document.body.offsetWidth;
    }else{
      fwidth = document.documentElement.clientWidth;
    }
    return fwidth;
  },
  getWindowHeight:function(){
    fheight = 0;
    if (document.all){
      fheight = document.body.offsetHeight;
    }else{
      fheight = document.documentElement.clientHeight;
    }
    return fwidth;
  },
  winDimension:function(){
    fensterb = 0;
    fensterh = 0;
    if (document.all){
      fensterb = document.body.offsetWidth;// + window.scrollMaxX;
  		fensterh = document.body.offsetHeight;// + window.scrollMaxY;
  	}else if ( document.documentElement.clientWidth ){
  		fensterb = document.documentElement.clientWidth;
  		fensterh = document.documentElement.clientHeight;
   	}
  	return Array( fensterb, fensterh );
  },
  getScrollingY:function(){
    if (typeof window.pageYOffset != 'undefined'){
      this.position = window.pageYOffset;
    }else if (typeof document.documentElement.scrollTop != 'undefined' && document.documentElement.scrollTop > 0){
      this.position = document.documentElement.scrollTop;
    }else if (typeof document.body.scrollTop != 'undefined'){
      this.position = document.body.scrollTop;
    }
    return this.position;
  },
  getScrollingPosition:function(){
    if (typeof window.pageYOffset != 'undefined'){
      this.position = [window.pageXOffset,window.pageYOffset];
    }else if (typeof document.documentElement.scrollTop != 'undefined' && document.documentElement.scrollTop > 0){
      this.position = [document.documentElement.scrollLeft,document.documentElement.scrollTop];
    }else if (typeof document.body.scrollTop != 'undefined'){
      this.position = [document.body.scrollLeft,document.body.scrollTop];
    }
    return this.position;
  },
  getElement:function(id){
    if (document.all) return document.all[id];
	  else if (document.getElementById) return document.getElementById(id);
	  else return null;
  },
  getElementStyle:function(id){
    if (document.all) return document.all[id].style;
	  else if (document.getElementById) return document.getElementById(id).style;
	  else return null;
  },
  dezhex:function(x){
  	var	dwert	= parseInt(x)
  	if(isNaN(dwert)){
  		alert("Dezimalzahlen bestehen nur aus den Ziffern 0 bis 9!")
  		return x
  	}
  	if(dwert == 0){
      return "FF";
    }
  	var	wert	= "";
  	while(dwert > 0){
  		zf	= dwert % 16;
  		wert	= this.hexziffern[zf] + wert;
  		dwert	-= zf;
  		dwert	/= 16;
  	}
  	return wert
  },
  priceHtml:function(zahl){
    zahl = zahl.toFixed(2);
    //alert(zahl);
    if(zahl.indexOf(".") != -1){
  		temp = zahl.substr(zahl.indexOf(".")+1);
  		if(temp.length == 1){
  			zahl = zahl.replace(".",",") + "0";
  		}else{
  			zahl = zahl.replace(".",",");
  		}
  	}
  	zahl = zahl.substr(0,zahl.indexOf(",")+3);
    return zahl;
  },
  priceFloat:function(zahl){
    //zahl = zahl.toFixed(2);
    //alert(zahl);
    if(zahl.indexOf(",") != -1){
  		temp = zahl.substr(zahl.indexOf(",")+1);
  		if(temp.length == 1){
  			zahl = zahl.replace(",",".") + "0";
  		}else{
  			zahl = zahl.replace(",",".");
  		}
  	}else{
      zahl = zahl + ",00";
    }
  	zahl = zahl.substr(0,zahl.indexOf(".")+3);
    
    return zahl;
  }
}
var core = com.zetzi.core;
var MZCore=null;
/*end of the core*/
