//Pluginfile for IMX.jQuery Plugins
//Author: Axel Güldner (gueldner@infomax-it.de)
//Version 1.0
//Date 05.08.2008

jQuery.fn.extend({

//accordion
  accordion: function(value,direction,speed,callback){
		if(direction == "v"){
			newHeight = value + "px";
			return this.animate({height: newHeight}, speed, callback);
		}else{
			newWidth = value + "px";
			return this.animate({width: newWidth}, speed, callback);
		}
	}
});

jQuery.fn.extend({

//horizontal slide
  hslide: function(pixel,speed,callback){
		if(this.css("left") == "auto" || this.css("left") == "" || this.css("left") == "undefined"){
			this.css("left","0px");			
		}
		if(this.width() - parseInt(pixel) + 10 <= -1 * (parseInt(this.css("left"))- parseInt(pixel))){
			return this.animate({left: "0px"}, speed, callback);
		}else{
			pixel = parseInt(this.css("left")) - pixel + "px";			
			return this.animate({left: pixel}, speed, callback);
		}
	}
});

jQuery.fn.extend({
  pxTOem: function(value){		
		newValue = parseInt(this.css("font-size"));
		newValue = value / newValue;
		return newValue;
	}
	
});	