
jQuery.extend(Array.prototype,{clear:function(){this.length=0;},add:function(a){this.push(a);},remove:function(a){if(typeof a=='string')a=this.get(a);if(!a||!a.id)return;for(var i=0;i<this.length;i++){if(this[i].id==a.id){this.splice(i,1);return;}}},get:function(id){for(var i=0;i<this.length;i++){if(this[i].id==id)return this[i];}return null;}});String.prototype.trim=function(){return this.replace(/^\s+|\s+jQuery/,'');};var dateFormat=function(){var token=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloZ]|"[^"]*"|'[^']*'/g,timezone=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,timezoneClip=/[^-+\dA-Z]/g,pad=function(value,length){value=String(value);length=parseInt(length)||2;while(value.length<length) value="0"+value;return value;};return function(date,mask){if(arguments.length==1&&(typeof date=="string"||date instanceof String)&&!/\d/.test(date)){mask=date;date=undefined;};date=date?new Date(date):new Date();if(isNaN(date)) throw"invalid date";var dF=dateFormat;mask=String(dF.masks[mask]||mask||dF.masks["default"]);var d=date.getDate(),D=date.getDay(),m=date.getMonth(),y=date.getFullYear(),H=date.getHours(),M=date.getMinutes(),s=date.getSeconds(),L=date.getMilliseconds(),o=date.getTimezoneOffset(),flags={d:d,dd:pad(d),ddd:dF.i18n.dayNames[D],dddd:dF.i18n.dayNames[D+7],m:m+1,mm:pad(m+1),mmm:dF.i18n.monthNames[m],mmmm:dF.i18n.monthNames[m+12],yy:String(y).slice(2),yyyy:y,h:H%12||12,hh:pad(H%12||12),H:H,HH:pad(H),M:M,MM:pad(M),s:s,ss:pad(s),l:pad(L,3),L:pad(L>99?Math.round(L/10):L),t:H<12?"a":"p",tt:H<12?"am":"pm",T:H<12?"A":"P",TT:H<12?"AM":"PM",Z:(String(date).match(timezone)||[""]).pop().replace(timezoneClip,""),o:(o>0?"-":"+")+pad(Math.floor(Math.abs(o)/60)*100+Math.abs(o)%60,4)};return mask.replace(token,function(jQuery0){return(jQuery0 in flags)?flags[jQuery0]:jQuery0.slice(1,jQuery0.length-1);});};}();dateFormat.masks={"default":"ddd mmm d yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoFullDateTime:"yyyy-mm-dd'T'HH:MM:ss.lo"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thr","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(mask){return dateFormat(this,mask);};function GetObjPos(B){var C=0,A=0;var D=null;if(B){C=B.offsetLeft;A=B.offsetTop;D=B.offsetParent;while(D!==null){C+=D.offsetLeft;A+=D.offsetTop;D=D.offsetParent}}return[C,A]}function GetPos(A){var C=0;var B=0;if(A.offsetParent){C=A.offsetLeft;B=A.offsetTop;while(A==A.offsetParent){C+=A.offsetLeft;B+=A.offsetTop}}return[C,B]};function getPageEventCoords(evt){var coords={left:0,top:0};if(evt.pageX){coords.left=evt.pageX;coords.top=evt.pageY;}else if(evt.clientX){coords.left=evt.clientX+document.body.scrollLeft-document.body.clientLeft;coords.top=evt.clientY+document.body.scrollTop-document.body.clientTop;if(document.body.parentElement&&document.body.parentElement.clientLeft){var bodParent=document.body.parentElement;coords.left+=bodParent.scrollLeft-bodParent.clientLeft;coords.top+=bodParent.scrollTop-bodParent.clientTop;}};return coords;};function GetEventXY(A){if(A===null){A=window.event}return[A.clientX+document.documentElement.scrollLeft,A.clientY+document.documentElement.scrollTop]};function getMouseY(A){if(A===null){A=event}return A.clientY+document.documentElement.scrollTop};function getMouseX(A){if(A===null){A=event}return A.clientX+document.documentElement.scrollLeft};function getPointerX(A){return((A!==null)?A.pageX:getMouseX(window.event))};function getPointerY(A){return((A!==null)?A.pageY:getMouseY(window.event))};function getRealTopByObj(A){yPos=0;if(A){yPos=A.offsetTop;tempEl=A.offsetParent;while(tempEl!==null){yPos+=tempEl.offsetTop;tempEl=tempEl.offsetParent}}return yPos}function getRealTop(A){thisObj=A;yPos=getRealTopByObj(A);return yPos}function getRealLeftByObj(A){xPos=0;if(A){xPos=A.offsetLeft;tempEl=A.offsetParent;while(tempEl!==null){xPos+=tempEl.offsetLeft;tempEl=tempEl.offsetParent}}return xPos}function getRealLeft(A){thisObj=A;xPos=getRealLeftByObj(A);return xPos}

var AP=window.AP||{};AP.namespace=function(D){if(!D||!D.length){return null}var C=D.split(".");var A=AP;for(var B=(C[0]=="AP")?1:0;B<C.length;++B){A[C[B]]=A[C[B]]||{};A=A[C[B]]}return A};
AP.namespace("Core.JS");
Initialization=function(){this.list=[];};Initialization.prototype={clear:function(){this.list=[];},add:function(f){if(!f||typeof(f)!='function'){alert('Initialization cannot add none function!!!');return null;}var fname=this.getFunctionName(f);var obj=this.get(fname);if(obj){alert('this function: \''+fname+'\' is existed.');return null;}this.list.push(f);return f;},call:function(f){if(!f||typeof(f)!='function'){alert('Initialization cannot add none function!!!');return;}f();},remove:function(f){if(typeof f=='string')f=this.get(f);var fname=this.getFunctionName(f);for(var i=0;i<this.list.length;i++){if(this.getFunctionName(this.list[i])===fname){this.list.splice(i,1);return;}}},get:function(n){for(var i=0;i<this.list.length;i++){if(this.getFunctionName(this.list[i])===n)return this.list[i];};return null;},getFunctionName:function(fn){var name=/\W*function\s+([\w\jQuery]+)\(/.exec(fn);if(!name)return'';return name[1];}};AP.Core.JS.Initialization=new Initialization();AP.Core.JS.Initialization.run=function(){for(var i=0;i<AP.Core.JS.Initialization.list.length;i++){AP.Core.JS.Initialization.list[i]();}};jQuery(function(){AP.Core.JS.Initialization.run();});//window.onload=AP.Core.JS.Initialization.run;

//AP.Core.JS.PopupLead={items:[],getItem:function(){if(AP.Core.JS.PopupLead.items.length<=0){return'/Photo/tooltipQC.gif';}else{var l=AP.Core.JS.PopupLead.items.length;var p=Math.floor(Math.random()*l);return AP.Core.JS.PopupLead.items[p];}},init:function(c){var ri=350;if(!c){c=jQuery(document.body);}else{if(typeof(c)=='string'){c=jQuery('#'+c)}};jQuery('*[showLead="true"]',c).each(function(){var _itm=this;jQuery('a[lead="true"]',this).mouseover(function(e){var L=e.pageX+5;var T=e.pageY+5;if(window.screen.width-ri<L){L=window.screen.width-ri;};var E='<div id="leadBox" class="box box1 popup" style="left:'+L+"px;top:"+T+'px;width:300px;z-index:10001;">'+''+'<div class="content">'+'<p style="padding-top:5px;"><b>'+jQuery(this).text()+'</b></p>'+jQuery("div.leadContent",_itm).html()+'<br/><p class="center"><img alt="" src="'+AP.Core.JS.PopupLead.getItem()+'" /></p>'+'</div>'+'<div class="bottom"><div><div>&nbsp;</div></div></div>'+'</div>';jQuery(E).appendTo("body");}).mouseout(function(){jQuery('#leadBox').remove();}).mousemove(function(e){var L=e.pageX+5;var T=e.pageY+5;if(window.screen.width-ri<L){L=window.screen.width-ri;};jQuery('#leadBox').css({top:T,left:L});});});}};
AP.Core.JS.PopupLead={items:[],getItem:function(){if(AP.Core.JS.PopupLead.items.length<=0){return'/Photo/tooltipQC.gif';}else{var l=AP.Core.JS.PopupLead.items.length;var p=Math.floor(Math.random()*l);return AP.Core.JS.PopupLead.items[p];}},init:function(c){var ri=350;if(!c){c=jQuery(document.body);}else{if(typeof(c)=='string'){c=jQuery('#'+c)}};jQuery('*[showLead="true"]',c).each(function(){var _itm=this;jQuery('a[lead="true"]',this).mouseover(function(e){var L=e.pageX+5;var T=e.pageY+5;if(window.screen.width-ri<L){L=window.screen.width-ri;};var E='<div id="leadBox" class="box box1 popup" style="left:'+L+"px;top:"+T+'px;width:300px;z-index:10001;">'+''+'<div class="content">'+'<p style="padding-top:5px;"><b>'+jQuery(this).text()+'</b></p>'+jQuery("div.leadContent",_itm).html()+'<br>'+'</div>'+'</div>';jQuery(E).appendTo("body");}).mouseout(function(){jQuery('#leadBox').remove();}).mousemove(function(e){var L=e.pageX+5;var T=e.pageY+5;if(window.screen.width-ri<L){L=window.screen.width-ri;};jQuery('#leadBox').css({top:T,left:L});});});}};

AP.Core.JS.PhotoSlide={Direction:{Vertical:0,Horizontal:1},init:function(cfg){var _A=jQuery("#"+cfg.id);var A=jQuery.extend({photoDeck:jQuery(".photoDeck",_A),photoContainer:jQuery(".photoDeck .photo-container",_A),currentIndex:0,prev:jQuery("div.prev a",_A),next:jQuery("div.next a",_A),autoHide:0,hideAction:null,animation:false,isAnimating:false,autoStart:false,isPaused:true,slidePause:6.5,titleTransition:1.0,direction:AP.Core.JS.PhotoSlide.Direction.Vertical,action:null,step:1,slides:[]},cfg);A.isPaused=!A.autoStart;A.slidePause=A.slidePause*1000;A.titleTransition=A.titleTransition*1000;this.getMainContent(A);this.previousHandler(A);this.nextHandler(A);this.start(A);_A.onselectstart=function(){return false}},getMainContent:function(A){jQuery("div.photoItem",A.photoContainer).each(function(D){var C=this;C={width:this.offsetWidth,height:this.offsetHeight,top:this.offsetTop,left:this.offsetLeft};A.slides.push(C);})},start:function(A){if(A.action){jQuery(A.photoContainer).find("a").click(function(){A.action(this)})};this.goFirst(A);if(A.autoHide>0){this.hide(A);}},hide:function(A){window.setTimeout(function(){jQuery("#"+A.id).hide(function(){if(A.hideAction)A.hideAction();});},A.autoHide*1000)},showSelected:function(A,B){this.goTo(A,B);},goTo:function(A,B){if(B<0||B>=A.slides.length){return};AP.Core.JS.PhotoSlide.clearInterval(A);A.currentIndex=B;AP.Core.JS.PhotoSlide.slideTransition(A);},goFirst:function(A){this.goTo(A,0);},slideTransition:function(A){if(A.slides.length==0)return;A.isAnimating=true;var t=A.slides[A.currentIndex].top;var l=A.slides[A.currentIndex].left;var o=(A.direction==AP.Core.JS.PhotoSlide.Direction.Vertical)?{left:-l}:{top:-t};if(A.animation){jQuery(A.photoContainer).animate(o,A.titleTransition,'linear',function(){A.isAnimating=false;AP.Core.JS.PhotoSlide.previousHandler(A);AP.Core.JS.PhotoSlide.nextHandler(A)});}else{jQuery(A.photoContainer).css(o);A.isAnimating=false;AP.Core.JS.PhotoSlide.previousHandler(A);AP.Core.JS.PhotoSlide.nextHandler(A)};AP.Core.JS.PhotoSlide.setNextTransition(A);},setNextTransition:function(A){if(A.slides.length==1){return};if(!A.isPaused){A.transitionTimeoutId=window.setTimeout(function(){AP.Core.JS.PhotoSlide.showNext(A);},A.slidePause)}},showPrevious:function(A){if(A.currentIndex>=A.step){this.goTo(A,A.currentIndex-A.step)}else if(A.currentIndex>0){this.goTo(A,0)}},showNext:function(A){if(A.currentIndex<(A.slides.length-A.step)){AP.Core.JS.PhotoSlide.goTo(A,A.currentIndex+A.step)}else if(A.currentIndex<(A.slides.length-1)){AP.Core.JS.PhotoSlide.goTo(A,A.slides.length-1)}else{this.goFirst(A);}},previousHandler:function(A){jQuery(A.prev).click(function(){if(A.isAnimating){return};jQuery(A.photoContainer).dequeue();AP.Core.JS.PhotoSlide.showPrevious(A);return false})},nextHandler:function(A){jQuery(A.next).click(function(){if(A.isAnimating){return};jQuery(A.photoContainer).dequeue();AP.Core.JS.PhotoSlide.showNext(A);return false})},clearInterval:function(A){window.clearTimeout(A.transitionTimeoutId);A.transitionTimeoutId=null}};