/** Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php

    Copyright (c) 2010 Chris Iona <chris.iona@gmail.com>

    Project:		http://chrisiona.com/fixedposition
  			https://code.google.com/p/fixedposition
    Version:		1.0.0
*/
(function(a){a.fn.fixedPosition=function(c){var d={fixedTo:"bottom",debug:false,effect:false,effectSpeed:1000};var e=a("body");var c=a.extend(d,c);var b=function(){e.append("<style>span#supportsPositionFixed{position:fixed;width:1px;height:1px;top:25px;}</style>");e.append('<span id="supportsPositionFixed"></span>');var f=a("#supportsPositionFixed").offset();a("#supportsPositionFixed").remove();return Boolean(f.top===25)};return this.each(function(){var j=a(this);var g=b();if(d.debug){var m;try{m=document.doctype.publicId}catch(l){try{m=document.getElementsByTagName("!")[0].nodeValue.replace(/^[^\"]*\"([^\"]+)\".*/,"$1")}catch(l){}}var f="<ul><h2>Debug Data</h2>";f+="<li>DOC TYPE: "+m+"</li>";f+="<li>Supports <u>position: fixed</u>: <strong>"+g+"</strong></li>";for(var h in a.browser){f+="<li>"+h+": <strong>"+a.browser[h]+"</strong></li>"}for(var h in d){f+="<li>"+h+": <strong>"+d[h]+"</strong> <em>("+(typeof d[h])+")</em></li>"}f+="</ul>";e.prepend('<div class="debug">'+f+"</div>")}if(!g){j.attr("id",function(i){return(a(this).attr("id").length?a(this).attr("id"):"positionFixedID"+i)});if((e.css("background-image"))=="none"){e.css("background","url(/images/positionFixed.jpg) fixed")}else{e.css("background-attachment","fixed")}var k="";if(d.fixedTo=="top"){k="$(document).scrollTop()"}else{k='$(document).scrollTop() - $("#'+j.attr("id")+'").outerHeight() + (document.documentElement.clientHeight || document.body.clientHeight)'}e.append("<style>.iefixedbar { background: #99CC99; background-image: url(/images/positionFixed.jpg);background-position: fixed; position: absolute; top: expression(eval("+k+"));width: expression(eval(document.documentElement.clientWidth || document.body.clientWidth));}</style>");j.addClass("iefixedbar");if(d.effect){switch(d.effect){case"fadeIn":j.hide().fadeIn(d.effectSpeed);break;case"slideDown":j.hide().slideDown(d.effectSpeed);break}}}})}})(jQuery);

