/*
Copyright (c) 2009 SymfoniP / CRM technik Limited
V1.1  Stacks symSlider Flow PortFolio Automated - Circular Loop Tabs implemented
*/
jQuery.fn.resizeImage=function(a,b){if(this.is("img")){lWidth=this.width();lHeight=this.height();if(b*lWidth/lHeight>a){lHeight=Math.round(lHeight*a/lWidth);lWidth=a}else{lWidth=Math.round(lWidth*b/lHeight);lHeight=b}wPad=Math.round((a-lWidth)/2);hPad=Math.round((b-lHeight)/2);this.width(lWidth).height(lHeight);this.css({paddingLeft:wPad,paddingRight:wPad,paddingTop:hPad,paddingBottom:hPad})}return this};jQuery.noConflict();jQuery(document).ready(function(b){var a={tWidth:100,tHeight:75,circ:false,mwheel:true,Width:450,Height:300,rlPadding:90,tbPadding:50};if(typeof sliOpts=="object"){a=b.extend({},a,sliOpts)}b("#image_wrap").width(a.Width+2*a.rlPadding-3).height(a.Height+2*a.tbPadding);b(".scrollable").width(a.Width+2*a.rlPadding);b("div.symimagegrab div.centered_image img").each(function(){b(this).resizeImage(a.tWidth,a.tHeight).appendTo("div.items")});b("div.scrollable").scrollable({size:Math.floor((a.Width+2*a.rlPadding)/128),hoverClass:"hover"});if(a.mwheel){b("div.scrollable").mousewheel()}if(a.circ){b("div.scrollable").circular()}b(".items img").click(function(){var c=b("#image_wrap").fadeTo("medium",0.5);c.fadeTo("fast",1);wimg=c.find("img");wimg.height(b(this).height()).width(b(this).width());wimg.attr("src",b(this).attr("src")).resizeImage(a.Width,a.Height).css({paddingTop:a.tbPadding})}).filter(":first").click()});