(function($){$.fn.fold=function(options){var ie55=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 5.5")!=-1);var ie6=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 6.0")!=-1);if(ie55||ie6){this.remove();return true;}
options=options||{};var defaults={directory:'.',side:'left',turnImage:'js/jquery/sexy.curly/fold.png',maxHeight:400,starting_width:80,starting_height:80,autoCurl:true};if(options.side=='right'&&!options.turnImage)defaults.turnImage='fold-sw.png';var options=$.extend(defaults,options);var turn_hideme=$('<div id="turn_hideme">');var turn_wrapper=$('<div id="turn_wrapper">');var turn_object=$('<div id="turn_object">');var img=$('<img id="turn_fold" src="'+(options.directory+'/'+options.turnImage)+'">');turn_object.css({width:options.starting_width,height:options.starting_height});if(options.side=='right')turn_wrapper.addClass('right');this.wrap(turn_wrapper).wrap(turn_object).after(img).wrap(turn_hideme);turn_wrapper=$('#turn_wrapper');turn_object=$('#turn_object');if(!options.autoCurl){turn_object.resizable({maxHeight:options.maxHeight,aspectRatio:true,ratio:true,border:false,dragHandle:false,knobHandles:true,handles:options.side=='left'?'se':'sw'});}else{turn_wrapper.hover(function(){turn_object.stop().animate({width:options.maxHeight,height:options.maxHeight});},function(){turn_object.stop().animate({width:options.starting_height,height:options.starting_height});});}};})(jQuery);

$(document).ready(function(){$('#sexy').fold();});