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