/*
Copyright (c) 2009 SymfoniP / CRM technik Limited
V1.1  Stacks symSlider Images Automated - anchor reference enabled 
*/
jQuery.noConflict();jQuery(document).ready(function(h){var f={width:450,height:300,padding:10,interval:3000};if(typeof sliOpts=="object"){sliDef=h.extend({},f,sliOpts)}else{sliDef=f}var e=sliDef.width-2*sliDef.padding;var d=sliDef.height-2*sliDef.padding;h("img.resize").each(function(){imgWidth=h(this).width();imgHeight=h(this).height();if(imgWidth>=e&&imgHeight<d){h(this).width(Math.round(imgWidth*d/imgHeight));h(this).height(d)}else{if(imgWidth<e&&imgHeight>=d){h(this).width(e);h(this).height(Math.round(imgHeight*e/imgWidth))}else{if((imgWidth>e&&imgHeight>d)||(imgWidth<e&&imgHeight<d)){imgWidthRatio=imgWidth/e;imgHeightRatio=imgHeight/d;if(imgWidthRatio>imgHeightRatio){h(this).width(Math.round(imgWidth*d/imgHeight));h(this).height(d)}else{h(this).width(e);h(this).height(Math.round(imgHeight*e/imgWidth))}}}}});h("#symslider-wrap").css({width:(sliDef.width-sliDef.padding)+"px",height:(sliDef.height)+"px",margin:"25px auto","padding-left":sliDef.padding+"px",position:"relative","-moz-border-radius":"5px","-webkit-border-radius":"5px","overflow-y":"hidden"});h(".slider-wrap").css({width:e+"px",left:sliDef.padding+"px",top:sliDef.padding+"px",height:d+"px"});h("#main-photo-slider").css({width:e+"px"});imgCount=0;h("div.symimagegrab div.centered_image img.imageStyle").each(function(){var k=h("<div class='wrapper'></div>").css({width:sliDef.width-2*sliDef.padding+"px"});var i=h("<div class='panel'></div>");i.attr("width",sliDef.width-2*sliDef.padding+"px");var m=h(this).attr("title");var l=h(this).attr("alt");h(this).removeAttr("alt").removeAttr("title").removeClass("imageStyle").addClass("symImageStyle");if(h(this).parent().is("a")){h(k).append(h(this).parent())}else{h(k).append(this)}if(m!=""){h(k).append(m)}var j=new RegExp(/^stacks_image/);if(l!=""&&!l.match(j)){h(k).append(h("<div class='photo-meta-data'></div>").append(l))}h(i).append(h(k));h("#main-photo-slider .panelContainer").append(h(i));imgCount++});metaHeight=parseInt(h(".photo-meta-data").css("height"))+parseInt(h(".photo-meta-data").css("padding-top"))+parseInt(h(".photo-meta-data").css("padding-bottom"));metaPadding=parseInt(h(".photo-meta-data").css("paddingLeft"))+parseInt(h(".photo-meta-data").css("paddingRight"));h(".photo-meta-data").css({width:(e-metaPadding)+"px",top:(d-metaHeight)+"px"});h("#main-photo-slider").css({height:d+"px"});h(".panel").width(e+"px");var g=null;var a,c;var b=0;theInterval=function(i){clearInterval(g);if(typeof i!="undefined"){b=i}a.removeClass("active-thumb");c.eq(b).parent().addClass("active-thumb");h(".stripNav ul li a").eq(b).trigger("click");g=setInterval(function(){a.removeClass("active-thumb");c.eq(b).parent().addClass("active-thumb");h(".stripNav ul li a").eq(b).trigger("click");b++;if(imgCount==b){b=0}},sliDef.interval)};h(function(){h("#main-photo-slider").codaSlider();c=h(".nav-thumb");a=h(".cross-link");c.click(function(){var i=h(this);theInterval(i.parent().attr("href").slice(1)-1);return false});theInterval()})});
