$(function(){$(".gradualfader").css("opacity","0.5");$(".gradualfader").hover(function(){$(this).stop().animate({opacity:1.0},"slow");},function(){$(this).stop().animate({opacity:0.5},"slow");});});$(function(){$("#text p").css("opacity","0.5");$("#text p").hover(function(){$(this).stop().animate({opacity:1.0},"slow");},function(){$(this).stop().animate({opacity:0.5},"slow");});});$(function(){$("#div").css("opacity","0.5");$("#div").hover(function(){$(this).stop().animate({opacity:1.0},"slow");},function(){$(this).stop().animate({opacity:0.5},"slow");});});(function($){jQuery.fn.tooltip=function(options){var defaults={offsetX:15,offsetY:10,fadeIn:'400',fadeOut:'200',dataAttr:'data',bordercolor:'#85A3A4',bgcolor:'#E7EFE7',fontcolor:'#111111',fontsize:'13px',folderurl:'js/contents/',filetype:'txt',height:'auto',width:'325px',cursor:'hand'};var options=$.extend(defaults,options);var $tooltip=$('<div id="divToolTip"></div>');return this.each(function(){$('body').append($tooltip);$tooltip.hide();var element=this;var id=$(element).attr('id');var filename=options.folderurl+id+'.'+options.filetype;var dialog_id='#divToolTip';$(this).hover(function(e){if(options.folderurl!="NULL"){$(dialog_id).load(filename);}else
{if($('#'+options.dataAttr+'_'+id).length>0){$(dialog_id).html($('#'+options.dataAttr+'_'+id).html());}else{$(dialog_id).html(id);}}
$(element).css({'cursor':options.cursor});if($(document).width()/2<e.pageX){$(dialog_id).css({'position':'absolute','border':'1px solid '+options.bordercolor,'background-color':options.bgcolor,'padding':'5px 5px 5px 5px','-moz-border-radius':'5px 5px 5px 5px','-webkit-border-radius':'5px 5px 5px 5px','top':e.pageY+options.offsetY,'left':e.pageX-$(dialog_id).width()+options.offsetX,'color':options.fontcolor,'font-size':options.fontsize,'height':options.height,'width':options.width});}else{$(dialog_id).css({'position':'absolute','border':'1px solid '+options.bordercolor,'background-color':options.bgcolor,'padding':'5px 5px 5px 5px','-moz-border-radius':'5px 5px 5px 5px','-webkit-border-radius':'5px 5px 5px 5px','top':e.pageY+options.offsetY,'left':e.pageX+options.offsetX,'color':options.fontcolor,'font-size':options.fontsize,'cursor':options.cursor,'height':options.height,'width':options.width});}
$(dialog_id).stop(true,true).fadeIn(options.fadeIn);},function(){$(dialog_id).stop(true,true).fadeOut(options.fadeOut);}).mousemove(function(e){if($(document).width()/2<e.pageX){$(dialog_id).css({'top':e.pageY+options.offsetY,'left':e.pageX-$(dialog_id).width(),'height':options.height,'width':options.width});}else{$(dialog_id).css({'top':e.pageY+options.offsetY,'left':e.pageX+options.offsetX,'height':options.height,'width':options.width});}});});};})(jQuery);jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});(function($){$.fn.miniTip=function(opts){var d={title:'',content:false,delay:300,anchor:'n',event:'hover',fadeIn:200,fadeOut:200,aHide:true,maxW:'250px',offset:5,doHide:false},o=$.extend(d,opts);if(!$('#miniTip')[0])
$('body').append('<div id="miniTip"><div id="miniTip_t"></div><div id="miniTip_c"></div><div id="miniTip_a"></div></div>');var tt_w=$('#miniTip'),tt_t=$('#miniTip_t'),tt_c=$('#miniTip_c'),tt_a=$('#miniTip_a');if(o.doHide){tt_w.stop(true,true).fadeOut(o.fadeOut);return false;}
return this.each(function(){var el=$(this);var cont=o.content?o.content:el.attr('title');if(cont!=''&&typeof cont!='undefined'){window.delay=false;var tHov=false,aHov=true;if(!o.content)
el.removeAttr('title');if(o.event=='hover'){el.hover(function(){tt_w.removeAttr('click');aHov=true;show();},function(){aHov=false;hide();});if(!o.aHide){tt_w.hover(function(){tHov=true;},function(){tHov=false;setTimeout(function(){if(!aHov&&!tt_w.attr('click'))hide()},20);});}}else if(o.event=='click'){o.aHide=true;el.click(function(){tt_w.attr('click','t');if(tt_w.css('display')=='none')show();else hide();return false;});$('html').click(function(e){if(tt_w.css('display')=='block'&&!$(e.target).closest('#miniTip').length)hide();});}
var show=function(){if(o.show)o.show.call(this);tt_c.html(cont);if(o.title!='')
tt_t.html(o.title).show();else
tt_t.hide();if(o.render)o.render(tt_w);tt_a.removeAttr('class');tt_w.hide().width('').width(tt_w.width()).css('max-width',o.maxW);if(el.is('area')){var i,x=[],y=[],c=el.attr('coords').split(',');for(i=0;i<c.length;i++){x.push(c[i++]);y.push(c[i]);}
var left=parseInt(el.parent().offset().left,10)+parseInt((parseInt(x.sort(num)[0],10)+parseInt(x.sort(num)[x.length-1],10))/2,10),top=parseInt(el.parent().offset().top,10)+parseInt((parseInt(y.sort(num)[0],10)+parseInt(y.sort(num)[y.length-1],10))/2,10);function num(a,b){return a-b;}}else{var top=parseInt(el.offset().top,10),left=parseInt(el.offset().left,10);}
var elW=parseInt(el.outerWidth(),10),elH=parseInt(el.outerHeight(),10),tipW=tt_w.outerWidth(),tipH=tt_w.outerHeight(),mLeft=Math.round(left+Math.round((elW-tipW)/2)),mTop=Math.round(top+elH+o.offset+8),aLeft=(Math.round(tipW-16)/2)-parseInt(tt_w.css('borderLeftWidth'),10),aTop=0,eOut=(left+elW+tipW+o.offset+8)>parseInt($(window).width(),10),wOut=(tipW+o.offset+8)>left,nOut=(tipH+o.offset+8)>top-$(window).scrollTop(),sOut=(top+elH+tipH+o.offset+8)>parseInt($(window).height()+$(window).scrollTop(),10),elPos=o.anchor;if(wOut||o.anchor=='e'&&!eOut){if(o.anchor=='w'||o.anchor=='e'){elPos='e';aTop=Math.round((tipH/2)-8-parseInt(tt_w.css('borderRightWidth'),10));aLeft=-8-parseInt(tt_w.css('borderRightWidth'),10);mLeft=left+elW+o.offset+8;mTop=Math.round((top+elH/2)-(tipH/2));}}else if(eOut||o.anchor=='w'&&!wOut){if(o.anchor=='w'||o.anchor=='e'){elPos='w';aTop=Math.round((tipH/2)-8-parseInt(tt_w.css('borderLeftWidth'),10));aLeft=tipW-parseInt(tt_w.css('borderLeftWidth'),10);mLeft=left-tipW-o.offset-8;mTop=Math.round((top+elH/2)-(tipH/2));}}
if(sOut||o.anchor=='n'&&!nOut){if(o.anchor=='n'||o.anchor=='s'){elPos='n';aTop=tipH-parseInt(tt_w.css('borderTopWidth'),10);mTop=top-(tipH+o.offset+8);}}else if(nOut||o.anchor=='s'&&!sOut){if(o.anchor=='n'||o.anchor=='s'){elPos='s';aTop=-8-parseInt(tt_w.css('borderBottomWidth'),10);mTop=top+elH+o.offset+8;}}
if(o.anchor=='n'||o.anchor=='s'){if((tipW/2)>left){mLeft=mLeft<0?aLeft+mLeft:aLeft;aLeft=0;}else if((left+tipW/2)>parseInt($(window).width(),10)){mLeft-=aLeft;aLeft*=2;}}else{if(nOut){mTop=mTop+aTop
aTop=0;}else if(sOut){mTop-=aTop;aTop*=2;}}
tt_a.css({'margin-left':aLeft+'px','margin-top':aTop+'px'}).attr('class',elPos);if(delay)clearTimeout(delay);delay=setTimeout(function(){tt_w.css({"margin-left":mLeft+"px","margin-top":mTop+'px'}).stop(true,true).fadeIn(o.fadeIn);},o.delay);}
var hide=function(){if(!o.aHide&&!tHov||o.aHide){if(delay)clearTimeout(delay);delay=setTimeout(function(){hide2()},o.delay);}}
var hide2=function(){if(!o.aHide&&!tHov||o.aHide){tt_w.stop(true,true).fadeOut(o.fadeOut);if(o.hide)o.hide.call(this);}else
setTimeout(function(){hide()},200);}}});}})(jQuery);(function($){$.fn.extend({popify:function(options){var index=1;return this.each(function(){$(this).click(function(event){event.preventDefault();var url=$(this).attr('href');var classes=$(this).attr('class');var rel=$(this).attr('rel');var profiles={small:{width:300,height:300},large:{width:820,height:440},all:{createnew:1,menubar:1,toolbar:1,scrollbars:1,location:1,status:1,resizable:1,center:1,focused:false,forceresize:false}};var defaults={width:820,height:440,top:48,left:48,createnew:0,menubar:0,toolbar:0,scrollbars:0,location:0,status:0,resizable:0,center:1,close:false,refresh:true,focused:true,forceresize:true,element:''};settings=$.extend(defaults,options);popupOpen(classes);function popupOpen(classes){var currentClasses=classes;for(var i in profiles){if(currentClasses.match(i)){var profile=i;break;}}
if(profile!=undefined){settings=$.extend(defaults,profiles[profile]);}
if(rel!=''){var relObject={};var relSettings=rel.replace(/\s+/g,':').split(':');for(var i=0;i<relSettings.length;i+=2){next=i+1;relObject[relSettings[i]]=relSettings[next];}
settings=$.extend(defaults,relObject);}
if(currentClasses.match(/opener/)){if(settings.refresh==true){window.opener.location.href=window.opener.location.href;}else{window.opener.location=url;}
if(settings.close==true){self.close();}}else if(currentClasses.match(/close/)){self.close();}else{var name,opened,parameters='';if(settings.center==1){settings.top=(((window.screen.height-settings.height)/2)-40);settings.left=(window.screen.width-settings.width)/2;}
parameters="location="+settings.location+",menubar="+settings.menubar+",height="+settings.height+",width="+settings.width+",toolbar="+settings.toolbar+",scrollbars="+settings.scrollbars+",status="+settings.status+",resizable="+settings.resizable+",left="+settings.left+",top="+settings.top+",screenX="+settings.left+",screenY="+settings.top;name=(settings.createnew=='1')?('Popify'+index):('Popify');if(window.focus&&settings.focused==true){opened=window.open(url,name,parameters);opened.focus();}else{opened=window.open(url,name,parameters);opened.opener.focus();}
if(window.focus&&settings.element!=''){opened.focus();opened.onload=function(){$(settings.element,opened.document).focus();}}
if(settings.createnew!='1'&&name=='Popify'&&settings.forceresize==true){$(opened).ready(function(){var windowWidth=parseInt(settings.height);var windowHeight=parseInt(settings.width);opened.resizeTo(windowWidth+8,windowHeight+80);});}
index++;}}});});}});})(jQuery);var animatedcollapse={divholders:{},divgroups:{},statusholders:{},lastactiveingroup:{},show:function(divids){if(typeof divids=="object"){for(var i=0;i<divids.length;i++)
this.showhide(divids[i],"show")}
else
this.showhide(divids,"show")},hide:function(divids){if(typeof divids=="object"){for(var i=0;i<divids.length;i++)
this.showhide(divids[i],"hide")}
else
this.showhide(divids,"hide")},toggle:function(divid){if(typeof divid=="object")
divid=divid[0]
this.showhide(divid,"toggle")},addDiv:function(divid,attrstring){this.divholders[divid]=({id:divid,$divref:null,attrs:attrstring})
this.divholders[divid].getAttr=function(name){var attr=new RegExp(name+"=([^,]+)","i")
return(attr.test(this.attrs)&&parseInt(RegExp.$1)!=0)?RegExp.$1:null}
this.currentid=divid
return this},showhide:function(divid,action){var $divref=this.divholders[divid].$divref
if(this.divholders[divid]&&$divref.length==1){var targetgroup=this.divgroups[$divref.attr('groupname')]
if($divref.attr('groupname')&&targetgroup.count>1&&(action=="show"||action=="toggle"&&$divref.css('display')=='none')){if(targetgroup.lastactivedivid&&targetgroup.lastactivedivid!=divid)
this.slideengine(targetgroup.lastactivedivid,'hide')
this.slideengine(divid,'show')
targetgroup.lastactivedivid=divid}
else{this.slideengine(divid,action)}}},slideengine:function(divid,action){var $divref=this.divholders[divid].$divref
if(this.divholders[divid]&&$divref.length==1){var animateSetting={height:action}
if($divref.attr('fade'))
animateSetting.opacity=action
$divref.animate(animateSetting,$divref.attr('speed')?parseInt($divref.attr('speed')):500,function(){if(animatedcollapse.ontoggle){try{animatedcollapse.ontoggle(jQuery,$divref.get(0),$divref.css('display'))}
catch(e){alert("An error exists inside your \"ontoggle\" function:\n\n"+e+"\n\nAborting execution of function.")}}})
return false}},generatemap:function(){var map={}
for(var i=0;i<arguments.length;i++){if(arguments[i][1]!=null){map[arguments[i][0]]=arguments[i][1]}}
return map},init:function(){var ac=this
jQuery(document).ready(function($){animatedcollapse.ontoggle=animatedcollapse.ontoggle||null
var urlparamopenids=animatedcollapse.urlparamselect()
var persistopenids=ac.getCookie('acopendivids')
var groupswithpersist=ac.getCookie('acgroupswithpersist')
if(persistopenids!=null)
persistopenids=(persistopenids=='nada')?[]:persistopenids.split(',')
groupswithpersist=(groupswithpersist==null||groupswithpersist=='nada')?[]:groupswithpersist.split(',')
jQuery.each(ac.divholders,function(){this.$divref=$('#'+this.id)
if((this.getAttr('persist')||jQuery.inArray(this.getAttr('group'),groupswithpersist)!=-1)&&persistopenids!=null){var cssdisplay=(jQuery.inArray(this.id,persistopenids)!=-1)?'block':'none'}
else{var cssdisplay=this.getAttr('hide')?'none':null}
if(urlparamopenids[0]=="all"||jQuery.inArray(this.id,urlparamopenids)!=-1){cssdisplay='block'}
else if(urlparamopenids[0]=="none"){cssdisplay='none'}
this.$divref.css(ac.generatemap(['height',this.getAttr('height')],['display',cssdisplay]))
this.$divref.attr(ac.generatemap(['groupname',this.getAttr('group')],['fade',this.getAttr('fade')],['speed',this.getAttr('speed')]))
if(this.getAttr('group')){var targetgroup=ac.divgroups[this.getAttr('group')]||(ac.divgroups[this.getAttr('group')]={})
targetgroup.count=(targetgroup.count||0)+1
if(jQuery.inArray(this.id,urlparamopenids)!=-1){targetgroup.lastactivedivid=this.id
targetgroup.overridepersist=1}
if(!targetgroup.lastactivedivid&&this.$divref.css('display')!='none'||cssdisplay=="block"&&typeof targetgroup.overridepersist=="undefined")
targetgroup.lastactivedivid=this.id
this.$divref.css({display:'none'})}})
jQuery.each(ac.divgroups,function(){if(this.lastactivedivid&&urlparamopenids[0]!="none")
ac.divholders[this.lastactivedivid].$divref.show()})
if(animatedcollapse.ontoggle){jQuery.each(ac.divholders,function(){animatedcollapse.ontoggle(jQuery,this.$divref.get(0),this.$divref.css('display'))})}
$(window).bind('unload',function(){ac.uninit()})})},uninit:function(){var opendivids='',groupswithpersist=''
jQuery.each(this.divholders,function(){if(this.$divref.css('display')!='none'){opendivids+=this.id+','}
if(this.getAttr('group')&&this.getAttr('persist'))
groupswithpersist+=this.getAttr('group')+','})
opendivids=(opendivids=='')?'nada':opendivids.replace(/,$/,'')
groupswithpersist=(groupswithpersist=='')?'nada':groupswithpersist.replace(/,$/,'')
this.setCookie('acopendivids',opendivids)
this.setCookie('acgroupswithpersist',groupswithpersist)},getCookie:function(Name){var re=new RegExp(Name+"=[^;]*","i");if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return null},setCookie:function(name,value,days){if(typeof days!="undefined"){var expireDate=new Date()
expireDate.setDate(expireDate.getDate()+days)
document.cookie=name+"="+value+"; path=/; expires="+expireDate.toGMTString()}
else
document.cookie=name+"="+value+"; path=/"},urlparamselect:function(){window.location.search.match(/expanddiv=([\w\-_,]+)/i)
return(RegExp.$1!="")?RegExp.$1.split(","):[]}}
$(function(){$('.newsOpen').popify({height:820,width:440});$('#showCart').miniTip({content:$('#CartContents').html(),delay:500,anchor:'s',fadeIn:300,fadeOut:500,maxW:'320px',aHide:false});$('.tooltip').tooltip({});anchor.init()});anchor={init:function(){$("a.anchorLink").click(function(){elementClick=$(this).attr("href")
destination=$(elementClick).offset().top;$("html:not(:animated),body:not(:animated)").animate({scrollTop:destination},1200,'easeInOutCubic');return false;})}}
function clearInput(e){if(e.value=='Search Here...')e.value="";}
$(document).ready(function(){$("#searchbox").keyup(function(){if($("#searchbox").val()==""){$("#resultsContainer").hide("blind");exit();}else{getResults()}});function getResults(){if($("#searchbox").val()==""){$("#resultsContainer").hide("blind");exit();}
$.get("searches.php",{query:$("#searchbox").val(),type:"results"},function(data){if(!$("#resultsContainer").is(":visible")){$("#resultsContainer").show("blind");}
$("#resultsContainer").html(data);});}});
