
/*******************************************************************/
/*                                                                 */
/* Copyright (c) 2006-2008 Possible Solutions                      */
/* Version 1.1.0																									 */
/*                                                                 */
/*******************************************************************/
// JavaScript Document

function PSPL_MultiSelect(aN,az,aD,aG,aL,aP,aQ,au,ai,av){aV=this;this.aR=aN;this.g=az;this.T=aD;this.Q=aG;this.ag=aL;this.ah=aP;this.ad=aQ;this.ab=au;this.at=ai;this.ac=av;this.P=false;this.v=document.getElementById(this.g);this.U=false;this.aB=function(){this.v.style.display="none";V=document.getElementById(this.g+'_box');aC='<span id="'+this.g+'_optionDiv" class="'+this.ad+'" ></span><span class="innerContainerPSPL"><input readonly="readonly" id="'+this.g+'_text" name="'+this.g+'_text" type="text" value="" class="'+this.ah+'" />';aF='<img id="'+this.g+'_arrow" class="'+this.ag+'" src="'+this.Q+'" title="Click to Select" />';aE='</span>';V.innerHTML+=aC+aF+aE;this.v=document.getElementById(this.g);};this.af=function(){C=this.v.options;F='';for(l=0;l<C.length;l++){if(C[l].selected==true){F+=C[l].innerHTML+',';}}this.K.value=F;};this.al=function(){if(this.P==false){this.P=true;this.o.style.top=aw(this.K).top+this.K.offsetHeight+'px';this.o.style.left=aw(this.K).left+'px';this.o.style.display='block';this.af();}else{this.aa();}};this.aa=function(){this.P=false;this.o.style.top= -2000+'px';this.o.style.left= -2000+'px';this.o.style.display='none';};this.aM=function(){C=this.v.options;this.o=document.getElementById(this.g+'_optionDiv');this.o.style.width=this.K.scrollWidth+this.I.width+'px';F='<table id="'+this.g+'_table" cellpadding="0" cellspacing="0" border="0" width="100%" >';for(l=0;l<C.length;l++){if(C[l].selected==true){F+='<tr class="row"><td id="'+this.g+'_td_'+l+'" nowrap class="'+this.ac+'">'+C[l].innerHTML+'</td></tr>';}else{F+='<tr class="row"><td id="'+this.g+'_td_'+l+'" nowrap class="'+this.ab+'">'+C[l].innerHTML+'</td></tr>';}}F+='</table>';this.o.innerHTML=F;this.o.style.display='block';this.aj=document.getElementById(this.g+'_table');if(this.aj.scrollWidth>parseInt(this.o.style.width)){this.o.style.width=this.aj.scrollWidth+'px';}this.o.style.height=this.aj.scrollHeight+'px';aT=this;};this.aA=function(l){if(this.v.options[l].selected==true){this.v.options[l].selected=false;}else{this.v.options[l].selected=true;}this.af();};this.ae=function(index,am){if(this.v.options[index].selected==true){this.A[index].className=av;}else{if(am=="selected"){this.A[index].className=ai;}else if(am=="hover"){this.A[index].className=ai;}else{this.A[index].className=au;}}this.A[index].refresh;}};function aJ(f){c[f].I.onclick=function(){c[f].al();};c[f].I.onmouseover=function(){c[f].I.src=c[f].T;};c[f].I.onmouseout=function(){c[f].I.src=c[f].Q;};c[f].V.onclick=function(aX){c[f].U=true;};for(r=0;r<c[f].v.options.length;r++){c[f].A[r]=document.getElementById(c[f].g+'_td_'+r);eval('c['+f+'].A['+r+'].onclick = function(){ c['+f+'].aA( '+r+' ); c['+f+'].ae( '+r+',\'selected\' ); }');eval('c['+f+'].A[ '+r+'].onmouseover = function(){  c['+f+'].ae('+r+', \'hover\' ); }');eval('c['+f+'].A[ '+r+'].onmouseout = function(){  c['+f+'].ae( '+r+', \'normal\' ); }');}};function aS(){};c=Array();aq=false;function Init(ay,T,Q,ag,ah,ad,ab,at,ac){c[c.length]=new PSPL_MultiSelect(c.length,ay,T,Q,ag,ah,ad,ab,at,ac);c[c.length-1].aB();c[c.length-1].V=document.getElementById(c[c.length-1].g+'_box');c[c.length-1].K=document.getElementById(c[c.length-1].g+'_text');c[c.length-1].I=document.getElementById(c[c.length-1].g+'_arrow');c[c.length-1].o=document.getElementById(c[c.length-1].g+'_optionDiv');c[c.length-1].A=new Array();c[c.length-1].af();};function R(){if(aq==false){aq=true;for(y=0;y<c.length;y++){c[y].aM();aJ(y);}}};function aH(){for(t=0;t<c.length;t++){if(c[t].U==false){c[t].aa();}c[t].U=false;}};function aK(){for(t=0;t<c.length;t++){if(c[t].P==true){c[t].aa();c[t].al();}}};function ap(d,M){if(d.currentStyle){var B=M.match(/\w[^-]*/g);var s=B[0];for(var i=1;i<B.length;++i){s+=B[i].replace(/\w/,B[i].charAt(0).toUpperCase());}return d.currentStyle[s]}else if(document.defaultView.getComputedStyle){return document.defaultView.getComputedStyle(d,null).getPropertyValue(M);}else{return 0;}};function ax(J){if(document.documentElement["getBoundingClientRect"]){var box=J.getBoundingClientRect(),G=J.ownerDocument,body=G.body,H=G.documentElement,clientTop=H.clientTop||body.clientTop||0,clientLeft=H.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||body.scrollTop)-clientTop;left=box.left+(self.pageXOffset||body.scrollLeft)-clientLeft;return{top:top,left:left};}else{alert('normal');var top,left;if(!J)return{top:0,left:0};if(J===J.ownerDocument.body){top=body.offsetTop,left=body.offsetLeft;return{top:top,left:left};}var d=J,offsetParent=d.offsetParent,aO=d,G=d.ownerDocument,D,H=G.documentElement,body=G.body,defaultView=G.defaultView,O=defaultView.getComputedStyle(d,null),top=d.offsetTop,left=d.offsetLeft;while((d=d.parentNode)&&d!==body&&d!==H){D=defaultView.getComputedStyle(d,null);top-=d.scrollTop,left-=d.scrollLeft;if(d===offsetParent){top+=d.offsetTop,left+=d.offsetLeft;if(d.tagName=='table'||d.tagName=='td'||d.tagName=='th')top+=parseInt(D.borderTopWidth,10)||0,left+=parseInt(D.borderLeftWidth,10)||0;aO=offsetParent,offsetParent=d.offsetParent;}if(D.overflow!=="visible")top+=parseInt(D.borderTopWidth,10)||0,left+=parseInt(D.borderLeftWidth,10)||0;O=D;}if(O.position==="relative"||O.position==="static")top+=body.offsetTop,left+=body.offsetLeft;if(O.position==="fixed")top+=Math.max(H.scrollTop,body.scrollTop),left+=Math.max(H.scrollLeft,body.scrollLeft);return{top:top,left:left};}};function aw(ak){L=ak;aW=ak.offsetLeft;while(L.offsetParent!=null){L=L.offsetParent;if(ap(L,"position")=="relative"){aU=false;break;}}as=ax(ak);an=ax(L);return{top:(as.top-an.top),left:(as.left-an.left),};};function ap(d,M){if(document.defaultView.getComputedStyle){return document.defaultView.getComputedStyle(d,null).getPropertyValue(M);}else if(d.currentStyle){var B=M.match(/\w[^-]*/g);var s=B[0];for(var i=1;i<B.length;++i){s+=B[i].replace(/\w/,B[i].charAt(0).toUpperCase());}return d.currentStyle[s]}else{return 0;}};var ao;function aI(){if(ao)return;ao=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);R();},false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);R();}});if(document.documentElement.doScroll&&window==window.top)(function(){try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}R();})();}window.onload=R;};document.onclick=aH;window.onresize=aK;aI();