if(!rootPath){var rootPath=''}var shift={include:function(path){var $s=$('<script>');$s.attr('type','text/javascript').attr('src',path);$('head').append($s)},importCSS:function(path,target){$('head').append('<link rel="stylesheet" type="text/css" href="'+path+'" />')},getURL:function(){var vars=[];var url=window.location.href;var arr=url.split('\/');var last=arr.length-1;if(arr[last]===''){arr.pop();last--}if(arr[last].indexOf('?')>0){arr[last]=arr[last].substring(0,arr[last].indexOf('?'))}if(arr[last].indexOf('#')>0){arr[last]=arr[last].substring(0,arr[last].indexOf('#'))}if(arr[last].indexOf('.htm')>0||arr[last].indexOf('.php')>0){vars['file']=arr[last];vars['dir']=arr[3];vars['parent']=arr[last-1]}else{vars['file']='';vars['dir']=arr[3];vars['parent']=arr[last]}return vars},getQuery:function(){var qs=location.search;if(qs){var qs_arr=qs.substring(1).split('&');var params={};for(var i=0;i<qs_arr.length;i++){var pair=qs_arr[i].split('=');if(pair[0]){params[pair[0]]=decodeURIComponent(pair[1])}}return params}else{return null}},smoothScroll:function(easing,speed){if(!easing){easing='swing'}if(!speed){speed=1200}$('a[href*=#]').click(function(){if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')&&location.hostname==this.hostname){var target=$(this.hash);target=target.length&&target;if(target.length){var targetOffset=target.offset().top-30;$('html,body').animate({scrollTop:targetOffset},{duration:speed,easing:easing});return false}}})},externalLink:function(options){$.extend(options);if(!$.string){$.string='external'}if(!$.type){$.type='rel'}if($.type=='class'&&$.absolute){$('a[href^=http]').addClass($.string)}if($.type!='class'&&$.absolute){$('a[href^=http]').attr($.type,$.string)}$('a['+$.type+'*='+$.string+']').click(function(){window.open($(this).attr('href'));return false});if($.bullet){$('a['+$.type+'*='+$.string+']').append($.bullet)}},jQueryUI:rootPath+'assets/scripts/jquery-ui-1.8.1.custom.min.js',jQueryEasing:rootPath+'assets/scripts/jquery.easing.1.3.js',png4IE:rootPath+'assets/scripts/DD_belatedPNG_0.0.8a-min.js'};$.fn.extend({hoverAlpha:function(options){var target,opacity,easing,speed;$.extend(options);(!opacity)?opacity=0.5:opacity=$.opacity;(!speed)?speed=['fast']:speed=$.speed;if(speed.length<2)speed[1]=speed[0];(!easing)?easing=['swing']:easing=$.easing;if(easing.length<2)easing[1]=easing[0];$(this).find('a').hover(function(){$(this).animate({opacity:opacity},speed[0],easing[0])},function(){$(this).animate({opacity:1},speed[1],easing[1])});$(this).find('button').hover(function(){$(this).animate({opacity:opacity},speed[0],easing[0])},function(){$(this).animate({opacity:1},speed[1],easing[1])});return opacity+speed},addCaption:function(options){var img,maxString;var count=0;$.extend(options);(!maxString)?maxString=30:maxString=$.maxString;if($.img)img=true;if(img){$(this).find('img').each(function(){if(!$(this).parent().is('a')){if($(this).attr('title').length<1)$(this).attr('title',$(this).attr('alt'));count++}});$('.insteadImage').each(function(){$(this).attr('title',$(this).text());count++})}else{$(this).find('a').each(function(){var str;if(($(this).attr('title')!=='')&&($(this).attr('title')!='undefind')){str=''}else if($(this).find('img').length>0){($(this).find('img').attr('title'))?str=$(this).find('img').attr('title'):str=$(this).find('img').attr('alt');count++}else{($(this).text().length>maxString)?str=$(this).text().substring(0,maxString)+'...':str=$(this).text();count++}if(str!==''){$(this).attr('title',str)}})}return count}});
