/*
 *  The Footer Plugin
 *  
 * 	Copyright© 2010 Icewares
 *  
 *  Licensed under the CPL (http://footer.icewares.com.br/licence.html)
 */
/*
 * 	The Footer Plugin
 *  version 1.0
 *  Created by Stéfano Stypulkowski @ Icewares
 *   
 *  Require jQuery 1.4 http://footer.icewares.com.br
 *  
 *  For instructions see: 
 */
var id=new String();var height=new Number();var footerHeight=new Number();var styleAbsolute={"position":"absolute","bottom":"0","z-index":"200"};var styleRelative={"position":"relative","bottom":"auto"};var config;var footerObject;var browserAdjust=0;(function(jQuery){jQuery.fn.footer=function(options){var defaults={"monitorTimeOut":200};config=jQuery.extend(defaults,options);if(config.monitorTimeOut<1){config.monitorTimeOut=1;}if(jQuery(this).attr("id")==""){jQuery(this).attr("id","footerAutoGeneratedId");}id="#"+jQuery(this).attr("id");height=jQuery(document).height();footerHeight=jQuery(id).height();if(jQuery.browser.msie){browserAdjust=4;}setPosition();monitor();}})(jQuery);function monitor(){if(height!=jQuery(document).height()){setPosition();height=jQuery(document).height();}if(footerHeight!=jQuery(id).height()){setFsmHeight();footerHeight=jQuery(id).height();}setTimeout('monitor()',config.monitorTimeOut);}function setPosition(){if((jQuery(document).height()-browserAdjust)>jQuery(window).height()){jQuery("#footerSpaceManager").remove();jQuery(id).css(styleRelative);}else{if(jQuery("#footerSpaceManager").size()==0){jQuery(id).parent().append("<div id='footerSpaceManager' style='height: "+jQuery(id).height()+"px;'></div>")}jQuery(id).css(styleAbsolute);}}function setFsmHeight(){if(jQuery("#footerSpaceManager").size()>0&&jQuery(id).height()!=jQuery("#footerSpaceManager").height()){jQuery("#footerSpaceManager").height(jQuery(id).height());}}
