/************************************************
* jquery-addons.js
* jquery Funcs & Plugins
* Flexxtrader Shopsystem Version 5.1
* www.flexxmedien.com | Michael Suding
************************************************/

// Vertigo Tip by www.vertigo-project.com
this.vtip = function() {    
	this.xOffset = -85; // x distance from mouse
	this.yOffset = -62; // y distance from mouse       
	
	$(".ttip").unbind().hover(    
			function(e) {
					this.t = this.title;
					this.title = ''; 
					this.top = (e.pageY + yOffset); this.left = (e.pageX + xOffset);
					$('body').append( '<p id="vtip">' + this.t + '</p>' );
					$('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn("slow");
			},
			function() {
					this.title = this.t;
					$("p#vtip").fadeOut("slow").remove();
			}
	)
};

// Preload Images
// Bsp: jQuery.preLoadImages("image1.gif", "/path/to/image2.png");
(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery);


// ColorBox v1.3.14 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
// Copyright (c) 2010 Jack Moore - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function(b,ib){var t="none",M="LoadedContent",c=false,v="resize.",o="y",q="auto",e=true,L="nofollow",m="x";function f(a,c){a=a?' id="'+i+a+'"':"";c=c?' style="'+c+'"':"";return b("<div"+a+c+"/>")}function p(a,b){b=b===m?n.width():n.height();return typeof a==="string"?Math.round(/%/.test(a)?b/100*parseInt(a,10):parseInt(a,10)):a}function U(b){return a.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(b)}function cb(a){for(var c in a)if(b.isFunction(a[c])&&c.substring(0,2)!=="on")a[c]=a[c].call(l);a.rel=a.rel||l.rel||L;a.href=a.href||b(l).attr("href");a.title=a.title||l.title;return a}function w(c,a){a&&a.call(l);b.event.trigger(c)}function jb(){var b,e=i+"Slideshow_",c="click."+i,f,k;if(a.slideshow&&h[1]){f=function(){F.text(a.slideshowStop).unbind(c).bind(V,function(){if(g<h.length-1||a.loop)b=setTimeout(d.next,a.slideshowSpeed)}).bind(W,function(){clearTimeout(b)}).one(c+" "+N,k);j.removeClass(e+"off").addClass(e+"on");b=setTimeout(d.next,a.slideshowSpeed)};k=function(){clearTimeout(b);F.text(a.slideshowStart).unbind([V,W,N,c].join(" ")).one(c,f);j.removeClass(e+"on").addClass(e+"off")};a.slideshowAuto?f():k()}}function db(c){if(!O){l=c;a=cb(b.extend({},b.data(l,r)));h=b(l);g=0;if(a.rel!==L){h=b("."+G).filter(function(){return (b.data(this,r).rel||this.rel)===a.rel});g=h.index(l);if(g===-1){h=h.add(l);g=h.length-1}}if(!u){u=E=e;j.show();if(a.returnFocus)try{l.blur();b(l).one(eb,function(){try{this.focus()}catch(a){}})}catch(f){}x.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":q}).show();a.w=p(a.initialWidth,m);a.h=p(a.initialHeight,o);d.position(0);X&&n.bind(v+P+" scroll."+P,function(){x.css({width:n.width(),height:n.height(),top:n.scrollTop(),left:n.scrollLeft()})}).trigger("scroll."+P);w(fb,a.onOpen);Y.add(H).add(I).add(F).add(Z).hide();ab.html(a.close).show()}d.load(e)}}var gb={transition:"elastic",speed:300,width:c,initialWidth:"600",innerWidth:c,maxWidth:c,height:c,initialHeight:"450",innerHeight:c,maxHeight:c,scalePhotos:e,scrolling:e,inline:c,html:c,iframe:c,photo:c,href:c,title:c,rel:c,opacity:.9,preloading:e,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:c,returnFocus:e,loop:e,slideshow:c,slideshowAuto:e,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:c,onLoad:c,onComplete:c,onCleanup:c,onClosed:c,overlayClose:e,escKey:e,arrowKey:e},r="colorbox",i="cbox",fb=i+"_open",W=i+"_load",V=i+"_complete",N=i+"_cleanup",eb=i+"_closed",Q=i+"_purge",hb=i+"_loaded",A=b.browser.msie&&!b.support.opacity,X=A&&b.browser.version<7,P=i+"_IE6",x,j,B,s,bb,T,R,S,h,n,k,J,K,Z,Y,F,I,H,ab,C,D,y,z,l,g,a,u,E,O=c,d,G=i+"Element";d=b.fn[r]=b[r]=function(c,f){var a=this,d;if(!a[0]&&a.selector)return a;c=c||{};if(f)c.onComplete=f;if(!a[0]||a.selector===undefined){a=b("<a/>");c.open=e}a.each(function(){b.data(this,r,b.extend({},b.data(this,r)||gb,c));b(this).addClass(G)});d=c.open;if(b.isFunction(d))d=d.call(a);d&&db(a[0]);return a};d.init=function(){var l="hover",m="clear:left";n=b(ib);j=f().attr({id:r,"class":A?i+"IE":""});x=f("Overlay",X?"position:absolute":"").hide();B=f("Wrapper");s=f("Content").append(k=f(M,"width:0; height:0; overflow:hidden"),K=f("LoadingOverlay").add(f("LoadingGraphic")),Z=f("Title"),Y=f("Current"),I=f("Next"),H=f("Previous"),F=f("Slideshow").bind(fb,jb),ab=f("Close"));B.append(f().append(f("TopLeft"),bb=f("TopCenter"),f("TopRight")),f(c,m).append(T=f("MiddleLeft"),s,R=f("MiddleRight")),f(c,m).append(f("BottomLeft"),S=f("BottomCenter"),f("BottomRight"))).children().children().css({"float":"left"});J=f(c,"position:absolute; width:9999px; visibility:hidden; display:none");b("body").prepend(x,j.append(B,J));s.children().hover(function(){b(this).addClass(l)},function(){b(this).removeClass(l)}).addClass(l);C=bb.height()+S.height()+s.outerHeight(e)-s.height();D=T.width()+R.width()+s.outerWidth(e)-s.width();y=k.outerHeight(e);z=k.outerWidth(e);j.css({"padding-bottom":C,"padding-right":D}).hide();I.click(d.next);H.click(d.prev);ab.click(d.close);s.children().removeClass(l);b("."+G).live("click",function(a){if(!(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)){a.preventDefault();db(this)}});x.click(function(){a.overlayClose&&d.close()});b(document).bind("keydown",function(b){if(u&&a.escKey&&b.keyCode===27){b.preventDefault();d.close()}if(u&&a.arrowKey&&!E&&h[1])if(b.keyCode===37&&(g||a.loop)){b.preventDefault();H.click()}else if(b.keyCode===39&&(g<h.length-1||a.loop)){b.preventDefault();I.click()}})};d.remove=function(){j.add(x).remove();b("."+G).die("click").removeData(r).removeClass(G)};d.position=function(f,d){function b(a){bb[0].style.width=S[0].style.width=s[0].style.width=a.style.width;K[0].style.height=K[1].style.height=s[0].style.height=T[0].style.height=R[0].style.height=a.style.height}var e,h=Math.max(document.documentElement.clientHeight-a.h-y-C,0)/2+n.scrollTop(),g=Math.max(n.width()-a.w-z-D,0)/2+n.scrollLeft();e=j.width()===a.w+z&&j.height()===a.h+y?0:f;B[0].style.width=B[0].style.height="9999px";j.dequeue().animate({width:a.w+z,height:a.h+y,top:h,left:g},{duration:e,complete:function(){b(this);E=c;B[0].style.width=a.w+z+D+"px";B[0].style.height=a.h+y+C+"px";d&&d()},step:function(){b(this)}})};d.resize=function(b){if(u){b=b||{};if(b.width)a.w=p(b.width,m)-z-D;if(b.innerWidth)a.w=p(b.innerWidth,m);k.css({width:a.w});if(b.height)a.h=p(b.height,o)-y-C;if(b.innerHeight)a.h=p(b.innerHeight,o);if(!b.innerHeight&&!b.height){b=k.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}k.css({height:a.h});d.position(a.transition===t?0:a.speed)}};d.prep=function(o){var e="hidden";function m(t){var q,f,o,e,m=h.length,s=a.loop;d.position(t,function(){if(u){A&&p&&k.fadeIn(100);k.show();w(hb);Z.show().html(a.title);if(m>1){typeof a.current==="string"&&Y.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,m)).show();I[s||g<m-1?"show":"hide"]().html(a.next);H[s||g?"show":"hide"]().html(a.previous);q=g?h[g-1]:h[m-1];o=g<m-1?h[g+1]:h[0];a.slideshow&&F.show();if(a.preloading){e=b.data(o,r).href||o.href;f=b.data(q,r).href||q.href;e=b.isFunction(e)?e.call(o):e;f=b.isFunction(f)?f.call(q):f;if(U(e))b("<img/>")[0].src=e;if(U(f))b("<img/>")[0].src=f}}K.hide();if(a.transition==="fade")j.fadeTo(l,1,function(){if(A)j[0].style.filter=c});else if(A)j[0].style.filter=c;n.bind(v+i,function(){d.position(0)});w(V,a.onComplete)}})}if(u){var p,l=a.transition===t?0:a.speed;n.unbind(v+i);k.remove();k=f(M).html(o);k.hide().appendTo(J.show()).css({width:function(){a.w=a.w||k.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?q:e}).css({height:function(){a.h=a.h||k.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(s);J.hide();b("#"+i+"Photo").css({cssFloat:t,marginLeft:q,marginRight:q});X&&b("select").not(j.find("select")).filter(function(){return this.style.visibility!==e}).css({visibility:e}).one(N,function(){this.style.visibility="inherit"});a.transition==="fade"?j.fadeTo(l,0,function(){m(0)}):m(l)}};d.load=function(u){var n,c,s,q=d.prep;E=e;l=h[g];u||(a=cb(b.extend({},b.data(l,r))));w(Q);w(W,a.onLoad);a.h=a.height?p(a.height,o)-y-C:a.innerHeight&&p(a.innerHeight,o);a.w=a.width?p(a.width,m)-z-D:a.innerWidth&&p(a.innerWidth,m);a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=p(a.maxWidth,m)-z-D;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=p(a.maxHeight,o)-y-C;a.mh=a.h&&a.h<a.mh?a.h:a.mh}n=a.href;K.show();if(a.inline){f().hide().insertBefore(b(n)[0]).one(Q,function(){b(this).replaceWith(k.children())});q(b(n))}else if(a.iframe){j.one(hb,function(){var c=b("<iframe name='"+(new Date).getTime()+"' frameborder=0"+(a.scrolling?"":" scrolling='no'")+(A?" allowtransparency='true'":"")+" style='width:100%; height:100%; border:0; display:block;'/>");c[0].src=a.href;c.appendTo(k).one(Q,function(){c[0].src='//about:blank'})});q(" ")}else if(a.html)q(a.html);else if(U(n)){c=new Image;c.onload=function(){var e;c.onload=null;c.id=i+"Photo";b(c).css({border:t,display:"block",cssFloat:"left"});if(a.scalePhotos){s=function(){c.height-=c.height*e;c.width-=c.width*e};if(a.mw&&c.width>a.mw){e=(c.width-a.mw)/c.width;s()}if(a.mh&&c.height>a.mh){e=(c.height-a.mh)/c.height;s()}}if(a.h)c.style.marginTop=Math.max(a.h-c.height,0)/2+"px";h[1]&&(g<h.length-1||a.loop)&&b(c).css({cursor:"pointer"}).click(d.next);if(A)c.style.msInterpolationMode="bicubic";setTimeout(function(){q(c)},1)};setTimeout(function(){c.src=n},1)}else n&&J.load(n,function(d,c,a){q(c==="error"?"Request unsuccessful: "+a.statusText:b(this).children())})};d.next=function(){if(!E){g=g<h.length-1?g+1:0;d.load()}};d.prev=function(){if(!E){g=g?g-1:h.length-1;d.load()}};d.close=function(){if(u&&!O){O=e;u=c;w(N,a.onCleanup);n.unbind("."+i+" ."+P);x.fadeTo("fast",0);j.stop().fadeTo("fast",0,function(){w(Q);k.remove();j.add(x).css({opacity:1,cursor:q}).hide();setTimeout(function(){O=c;w(eb,a.onClosed)},1)})}};d.element=function(){return b(l)};d.settings=gb;b(d.init)})(jQuery,this);

// In-Field Label jQuery Plugin http://fuelyourcoding.com/scripts/infield.html
// Copyright (c) 2009 Doug Neiner Dual licensed under the MIT and GPL licenses.  http://docs.jquery.com/License @version 0.1
(function($){$.InFieldLabels=function(b,c,d){var f=this;f.$label=$(b);f.label=b;f.$field=$(c);f.field=c;f.$label.data("InFieldLabels",f);f.showing=true;f.init=function(){f.options=$.extend({},$.InFieldLabels.defaultOptions,d);if(f.$field.val()!=""){f.$label.hide();f.showing=false};f.$field.focus(function(){f.fadeOnFocus()}).blur(function(){f.checkForEmpty(true)}).bind('keydown.infieldlabel',function(e){f.hideOnChange(e)}).change(function(e){f.checkForEmpty()}).bind('onPropertyChange',function(){f.checkForEmpty()})};f.fadeOnFocus=function(){if(f.showing){f.setOpacity(f.options.fadeOpacity)}};f.setOpacity=function(a){f.$label.stop().animate({opacity:a},f.options.fadeDuration);f.showing=(a>0.0)};f.checkForEmpty=function(a){if(f.$field.val()==""){f.prepForShow();f.setOpacity(a?1.0:f.options.fadeOpacity)}else{f.setOpacity(0.0)}};f.prepForShow=function(e){if(!f.showing){f.$label.css({opacity:0.0}).show();f.$field.bind('keydown.infieldlabel',function(e){f.hideOnChange(e)})}};f.hideOnChange=function(e){if((e.keyCode==16)||(e.keyCode==9))return;if(f.showing){f.$label.hide();f.showing=false};f.$field.unbind('keydown.infieldlabel')};f.init()};$.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};$.fn.inFieldLabels=function(c){return this.each(function(){var a=$(this).attr('for');if(!a)return;var b=$("input#"+a+"[type='text'],"+"input#"+a+"[type='password'],"+"textarea#"+a);if(b.length==0)return;(new $.InFieldLabels(this,b[0],c))})}})(jQuery);

// bgIframe 
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);

// pngFix 
(function($) { jQuery.fn.pngFix = function(settings) {
settings = jQuery.extend({ blankgif: 'images/blank.gif', allie: false}, settings);
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(jQuery.browser.msie&&(ie55||ie6||settings.allie)){jQuery(this).find("img[src$=.png]").each(function(){jQuery(this).attr('width',jQuery(this).width());jQuery(this).attr('height',jQuery(this).height());var a='';var b='';var c=(jQuery(this).attr('id'))?'id="'+jQuery(this).attr('id')+'" ':'';var d=(jQuery(this).attr('class'))?'class="'+jQuery(this).attr('class')+'" ':'';var e=(jQuery(this).attr('title'))?'title="'+jQuery(this).attr('title')+'" ':'';var f=(jQuery(this).attr('alt'))?'alt="'+jQuery(this).attr('alt')+'" ':'';var g=(jQuery(this).attr('align'))?'float:'+jQuery(this).attr('align')+';':'';var h=(jQuery(this).parent().attr('href'))?'cursor:hand;':'';if(this.style.border){a+='border:'+this.style.border+';';this.style.border=''}if(this.style.padding){a+='padding:'+this.style.padding+';';this.style.padding=''}if(this.style.margin){a+='margin:'+this.style.margin+';';this.style.margin=''}var i=(this.style.cssText);b+='<span '+c+d+e+f;b+='style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+g+h;b+='width:'+jQuery(this).width()+'px;'+'height:'+jQuery(this).height()+'px;';b+='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader'+'(src=\''+jQuery(this).attr('src')+'\', sizingMethod=\'scale\');';b+=i+'"></span>';if(a!=''){b='<span style="position:relative;display:inline-block;'+a+h+'width:'+jQuery(this).width()+'px;'+'height:'+jQuery(this).height()+'px;'+'">'+b+'</span>'}jQuery(this).hide();jQuery(this).after(b)});jQuery(this).find("*").each(function(){var a=jQuery(this).css('background-image');if(a.indexOf(".png")!=-1){var b=jQuery(this).css('background-repeat');var c=a.split('url("')[1].split('")')[0];jQuery(this).css('background-image','none');if(b=='no-repeat'){jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c+"',sizingMethod='crop')"}else{jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c+"',sizingMethod='scale')"}}});jQuery(this).find("input[src$=.png]").each(function(){var a=jQuery(this).attr('src');jQuery(this).get(0).runtimeStyle.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader'+'(src=\''+a+'\', sizingMethod=\'scale\');';jQuery(this).attr('src',settings.blankgif)})}return jQuery}})(jQuery);

// ClueTip() , Tooltip Plugin
(function($){$.cluetip={version:'1.0.6'};var I,$cluetipInner,$cluetipOuter,$cluetipTitle,$cluetipArrows,$cluetipWait,$dropShadow,imgCount;$.fn.cluetip=function(G,H){if(typeof G=='object'){H=G;G=null}if(G=='destroy'){return this.removeData('thisInfo').unbind('.cluetip')}return this.each(function(m){var n=this,$this=$(this);var o=$.extend(true,{},$.fn.cluetip.defaults,H||{},$.metadata?$this.metadata():$.meta?$this.data():{});var p=false;var q=+o.cluezIndex;$this.data('thisInfo',{title:n.title,zIndex:q});var r=false,closeOnDelay=0;if(!$('#cluetip').length){$(['<div id="cluetip">','<div id="cluetip-outer">','<h3 id="cluetip-title"></h3>','<div id="cluetip-inner"></div>','</div>','<div id="cluetip-extra"></div>','<div id="cluetip-arrows" class="cluetip-arrows"></div>','</div>'].join(''))[J](insertionElement).hide();I=$('#cluetip').css({position:'absolute'});$cluetipOuter=$('#cluetip-outer').css({position:'relative',zIndex:q});$cluetipInner=$('#cluetip-inner');$cluetipTitle=$('#cluetip-title');$cluetipArrows=$('#cluetip-arrows');$cluetipWait=$('<div id="cluetip-waitimage"></div>').css({position:'absolute'}).insertBefore(I).hide()}var s=(o.dropShadow)?+o.dropShadowSteps:0;if(!$dropShadow){$dropShadow=$([]);for(var i=0;i<s;i++){$dropShadow=$dropShadow.add($('<div></div>').css({zIndex:q-1,opacity:.1,top:1+i,left:1+i}))}$dropShadow.css({position:'absolute',backgroundColor:'#000'}).prependTo(I)}var t=$this.attr(o.attribute),ctClass=o.cluetipClass;if(!t&&!o.splitTitle&&!G){return true}if(o.local&&o.localPrefix){t=o.localPrefix+t}if(o.local&&o.hideLocal){$(t+':first').hide()}var u=parseInt(o.topOffset,10),lOffset=parseInt(o.leftOffset,10);var v,wHeight,defHeight=isNaN(parseInt(o.height,10))?'auto':(/\D/g).test(o.height)?o.height:o.height+'px';var w,linkTop,posY,tipY,mouseY,baseline;var x=parseInt(o.width,10)||275,tipWidth=x+(parseInt(I.css('paddingLeft'),10)||0)+(parseInt(I.css('paddingRight'),10)||0)+s,linkWidth=this.offsetWidth,linkLeft,posX,tipX,mouseX,winWidth;var y;var z=(o.attribute!='title')?$this.attr(o.titleAttribute):'';if(o.splitTitle){if(z==undefined){z=''}y=z.split(o.splitTitle);z=y.shift()}if(o.escapeTitle){z=z.replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;')}var A;function returnFalse(){return false}var B=function(d){if(!o.onActivate($this)){return false}r=true;I.removeClass().css({width:x});if(t==$this.attr('href')){$this.css('cursor',o.cursor)}if(o.hoverClass){$this.addClass(o.hoverClass)}linkTop=posY=$this.offset().top;linkLeft=$this.offset().left;mouseX=d.pageX;mouseY=d.pageY;if(n.tagName.toLowerCase()!='area'){w=$(document).scrollTop();winWidth=$(window).width()}if(o.positionBy=='fixed'){posX=linkWidth+linkLeft+lOffset;I.css({left:posX})}else{posX=(linkWidth>linkLeft&&linkLeft>tipWidth)||linkLeft+linkWidth+tipWidth+lOffset>winWidth?linkLeft-tipWidth-lOffset:linkWidth+linkLeft+lOffset;if(n.tagName.toLowerCase()=='area'||o.positionBy=='mouse'||linkWidth+tipWidth>winWidth){if(mouseX+20+tipWidth>winWidth){I.addClass(' cluetip-'+ctClass);posX=(mouseX-tipWidth-lOffset)>=0?mouseX-tipWidth-lOffset-parseInt(I.css('marginLeft'),10)+parseInt($cluetipInner.css('marginRight'),10):mouseX-(tipWidth/2)}else{posX=mouseX+lOffset}}var e=posX<0?d.pageY+u:d.pageY;I.css({left:(posX>0&&o.positionBy!='bottomTop')?posX:(mouseX+(tipWidth/2)>winWidth)?winWidth/2-tipWidth/2:Math.max(mouseX-(tipWidth/2),0),zIndex:$this.data('thisInfo').zIndex});$cluetipArrows.css({zIndex:$this.data('thisInfo').zIndex+1})}wHeight=$(window).height();if(G){if(typeof G=='function'){G=G.call(n)}$cluetipInner.html(G);C(e)}else if(y){var f=y.length;$cluetipInner.html(f?y[0]:'');if(f>1){for(var i=1;i<f;i++){$cluetipInner.append('<div class="split-body">'+y[i]+'</div>')}}C(e)}else if(!o.local&&t.indexOf('#')!==0){if(/\.(jpe?g|tiff?|gif|png)$/i.test(t)){$cluetipInner.html('<img src="'+t+'" alt="'+z+'" />');C(e)}else if(p&&o.ajaxCache){$cluetipInner.html(p);C(e)}else{var g=o.ajaxSettings.beforeSend,optionError=o.ajaxSettings.error,optionSuccess=o.ajaxSettings.success,optionComplete=o.ajaxSettings.complete;var h={cache:false,url:t,beforeSend:function(a){if(g){g.call(n,a,I,$cluetipInner)}$cluetipOuter.children().empty();if(o.waitImage){$cluetipWait.css({top:mouseY+20,left:mouseX+20,zIndex:$this.data('thisInfo').zIndex-1}).show()}},error:function(a,b){if(r){if(optionError){optionError.call(n,a,b,I,$cluetipInner)}else{$cluetipInner.html('<i>sorry, the contents could not be loaded</i>')}}},success:function(a,b){p=o.ajaxProcess.call(n,a);if(r){if(optionSuccess){optionSuccess.call(n,a,b,I,$cluetipInner)}$cluetipInner.html(p)}},complete:function(a,b){if(optionComplete){optionComplete.call(n,a,b,I,$cluetipInner)}var c=$cluetipInner[0].getElementsByTagName('img');imgCount=c.length;for(var i=0,l=c.length;i<l;i++){if(c[i].complete){imgCount--}}if(imgCount&&!$.browser.opera){$(c).bind('load error',function(){imgCount--;if(imgCount<1){$cluetipWait.hide();if(r){C(e)}}})}else{$cluetipWait.hide();if(r){C(e)}}}};var j=$.extend(true,{},o.ajaxSettings,h);$.ajax(j)}}else if(o.local){var k=$(t+(/#\S+$/.test(t)?'':':eq('+m+')')).clone(true).show();$cluetipInner.html(k);C(e)}};var C=function(a){I.addClass('cluetip-'+ctClass);if(o.truncate){var b=$cluetipInner.text().slice(0,o.truncate)+'...';$cluetipInner.html(b)}function doNothing(){};z?$cluetipTitle.show().html(z):(o.showTitle)?$cluetipTitle.show().html('&nbsp;'):$cluetipTitle.hide();if(o.sticky){var c=$('<div id="cluetip-close"><a href="#">'+o.closeText+'</a></div>');(o.closePosition=='bottom')?c.appendTo($cluetipInner):(o.closePosition=='title')?c.prependTo($cluetipTitle):c.prependTo($cluetipInner);c.bind('click.cluetip',function(){E();return false});if(o.mouseOutClose){I.bind('mouseleave.cluetip',function(){E()})}else{I.unbind('mouseleave.cluetip')}}var d='';$cluetipOuter.css({zIndex:$this.data('thisInfo').zIndex,overflow:defHeight=='auto'?'visible':'auto',height:defHeight});v=defHeight=='auto'?Math.max(I.outerHeight(),I.height()):parseInt(defHeight,10);tipY=posY;baseline=w+wHeight;if(o.positionBy=='fixed'){tipY=posY-o.dropShadowSteps+u}else if((posX<mouseX&&Math.max(posX,0)+tipWidth>mouseX)||o.positionBy=='bottomTop'){if(posY+v+u>baseline&&mouseY-w>v+u){tipY=mouseY-v-u;d='top'}else{tipY=mouseY+u;d='bottom'}}else if(posY+v+u>baseline){tipY=(v>=wHeight)?w:baseline-v-u}else if($this.css('display')=='block'||n.tagName.toLowerCase()=='area'||o.positionBy=="mouse"){tipY=a-u}else{tipY=posY-o.dropShadowSteps}if(d==''){posX<linkLeft?d='left':d='right'}I.css({top:tipY+'px'}).removeClass().addClass('clue-'+d+'-'+ctClass).addClass(' cluetip-'+ctClass);if(o.arrows){var e=(posY-tipY-o.dropShadowSteps);$cluetipArrows.css({top:(/(left|right)/.test(d)&&posX>=0&&e>0)?e+'px':/(left|right)/.test(d)?0:''}).show()}else{$cluetipArrows.hide()}$dropShadow.hide();I.hide()[o.fx.open](o.fx.openSpeed||0);if(o.dropShadow){$dropShadow.css({height:v,width:x,zIndex:$this.data('thisInfo').zIndex-1}).show()}if($.fn.bgiframe){I.bgiframe()}if(o.delayedClose>0){closeOnDelay=setTimeout(E,o.delayedClose)}o.onShow.call(n,I,$cluetipInner)};var D=function(a){r=false;$cluetipWait.hide();if(!o.sticky||(/click|toggle/).test(o.activation)){E();clearTimeout(closeOnDelay)}if(o.hoverClass){$this.removeClass(o.hoverClass)}};var E=function(){$cluetipOuter.parent().hide().removeClass();o.onHide.call(n,I,$cluetipInner);$this.removeClass('cluetip-clicked');if(z){$this.attr(o.titleAttribute,z)}$this.css('cursor','');if(o.arrows){$cluetipArrows.css({top:''})}};$(document).bind('hideCluetip',function(e){E()});if((/click|toggle/).test(o.activation)){$this.bind('click.cluetip',function(a){if(I.is(':hidden')||!$this.is('.cluetip-clicked')){B(a);$('.cluetip-clicked').removeClass('cluetip-clicked');$this.addClass('cluetip-clicked')}else{D(a)}this.blur();return false})}else if(o.activation=='focus'){$this.bind('focus.cluetip',function(a){B(a)});$this.bind('blur.cluetip',function(a){D(a)})}else{$this[o.clickThrough?'unbind':'bind']('click',returnFalse);var F=function(b){if(o.tracking==true){var c=posX-b.pageX;var d=tipY?tipY-b.pageY:posY-b.pageY;$this.bind('mousemove.cluetip',function(a){I.css({left:a.pageX+c,top:a.pageY+d})})}};if($.fn.hoverIntent&&o.hoverIntent){$this.hoverIntent({sensitivity:o.hoverIntent.sensitivity,interval:o.hoverIntent.interval,over:function(a){B(a);F(a)},timeout:o.hoverIntent.timeout,out:function(a){D(a);$this.unbind('mousemove.cluetip')}})}else{$this.bind('mouseenter.cluetip',function(a){B(a);F(a)}).bind('mouseleave.cluetip',function(a){D(a);$this.unbind('mousemove.cluetip')})}$this.bind('mouseover.cluetip',function(a){$this.attr('title','')}).bind('mouseleave.cluetip',function(a){$this.attr('title',$this.data('thisInfo').title)})}})};$.fn.cluetip.defaults={width:275,height:'auto',cluezIndex:97,positionBy:'auto',topOffset:15,leftOffset:15,local:false,localPrefix:null,hideLocal:true,attribute:'rel',titleAttribute:'title',splitTitle:'',escapeTitle:false,showTitle:true,cluetipClass:'default',hoverClass:'',waitImage:true,cursor:'help',arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:'hover',clickThrough:false,tracking:false,delayedClose:0,closePosition:'top',closeText:'Close',truncate:0,fx:{open:'show',openSpeed:''},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(e){return true},onShow:function(a,b){},onHide:function(a,b){},ajaxCache:true,ajaxProcess:function(a){a=a.replace(/<(script|style|title)[^<]+<\/(script|style|title)>/gm,'').replace(/<(link|meta)[^>]+>/g,'');return a},ajaxSettings:{dataType:'html'},debug:false};var J='appendTo',insertionElement='body';$.cluetip.setup=function(a){if(a&&a.insertionType&&(a.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){J=a.insertionType}if(a&&a.insertionElement){insertionElement=a.insertionElement}}})(jQuery);

/** PrintArea Plugin **/
(function($) {
    var printAreaCount = 0;
    $.fn.printArea = function()
        {
				var ele = $(this);
				var idPrefix = "printArea_";
				removePrintArea( idPrefix + printAreaCount );
				$("#printwk").addClass("printarea");
				printAreaCount++;
				var iframeId = idPrefix + printAreaCount;
				var iframeStyle = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;font-size:11px;color:#000;';
				iframe = document.createElement('IFRAME');
				$(iframe).attr({ style : iframeStyle, id  : iframeId});
				document.body.appendChild(iframe);
				var doc = iframe.contentWindow.document;
				$(document).find("link")
					.filter(function(){
							return $(this).attr("rel").toLowerCase() == "stylesheet";
						})
					.each(function(){
							doc.write('<link type="text/css" rel="stylesheet" href="' + $(this).attr("href") + '" >');
						});
		
				doc.write('<div class="' + $(ele).attr("class") + '">' + $(ele).html() + '</div>');
				doc.close();
				var frameWindow=iframe.contentWindow;
				frameWindow.close();frameWindow.focus();frameWindow.print();
        }

    var removePrintArea = function(id){$( "iframe#" + id ).remove();};
})(jQuery);
