var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return}f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return}if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return}}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return}var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return}var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return}AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();;var UFO={req:["movie","width","height","majorversion","build"],opt:["play","loop","menu","quality","scale","salign","wmode","bgcolor","base","flashvars","devicefont","allowscriptaccess","seamlesstabbing","allowfullscreen","allownetworking"],optAtt:["id","name","align"],optExc:["swliveconnect"],ximovie:"ufo.swf",xiwidth:"215",xiheight:"138",ua:navigator.userAgent.toLowerCase(),pluginType:"",fv:[0,0],foList:[],create:function(FO,id){if(!UFO.uaHas("w3cdom")||UFO.uaHas("ieMac"))return;UFO.getFlashVersion();UFO.foList[id]=UFO.updateFO(FO);UFO.createCSS("#"+id,"visibility:hidden;");UFO.domLoad(id);},updateFO:function(FO){if(typeof FO.xi!="undefined"&&FO.xi=="true"){if(typeof FO.ximovie=="undefined")FO.ximovie=UFO.ximovie;if(typeof FO.xiwidth=="undefined")FO.xiwidth=UFO.xiwidth;if(typeof FO.xiheight=="undefined")FO.xiheight=UFO.xiheight;}
FO.mainCalled=false;return FO;},domLoad:function(id){var _t=setInterval(function(){if((document.getElementsByTagName("body")[0]!=null||document.body!=null)&&document.getElementById(id)!=null){UFO.main(id);clearInterval(_t);}},250);if(typeof document.addEventListener!="undefined"){document.addEventListener("DOMContentLoaded",function(){UFO.main(id);clearInterval(_t);},null);}},main:function(id){var _fo=UFO.foList[id];if(_fo.mainCalled)return;UFO.foList[id].mainCalled=true;document.getElementById(id).style.visibility="hidden";if(UFO.hasRequired(id)){if(UFO.hasFlashVersion(parseInt(_fo.majorversion,10),parseInt(_fo.build,10))){if(typeof _fo.setcontainercss!="undefined"&&_fo.setcontainercss=="true")UFO.setContainerCSS(id);UFO.writeSWF(id);}
else if(_fo.xi=="true"&&UFO.hasFlashVersion(6,65)){UFO.createDialog(id);}}
document.getElementById(id).style.visibility="visible";},createCSS:function(selector,declaration){var _h=document.getElementsByTagName("head")[0];var _s=UFO.createElement("style");if(!UFO.uaHas("ieWin"))_s.appendChild(document.createTextNode(selector+" {"+declaration+"}"));_s.setAttribute("type","text/css");_s.setAttribute("media","screen");_h.appendChild(_s);if(UFO.uaHas("ieWin")&&document.styleSheets&&document.styleSheets.length>0){var _ls=document.styleSheets[document.styleSheets.length-1];if(typeof _ls.addRule=="object")_ls.addRule(selector,declaration);}},setContainerCSS:function(id){var _fo=UFO.foList[id];var _w=/%/.test(_fo.width)?"":"px";var _h=/%/.test(_fo.height)?"":"px";UFO.createCSS("#"+id,"width:"+_fo.width+_w+"; height:"+_fo.height+_h+";");if(_fo.width=="100%"){UFO.createCSS("body","margin-left:0; margin-right:0; padding-left:0; padding-right:0;");}
if(_fo.height=="100%"){UFO.createCSS("html","height:100%; overflow:hidden;");UFO.createCSS("body","margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;");}},createElement:function(el){return(UFO.uaHas("xml")&&typeof document.createElementNS!="undefined")?document.createElementNS("http://www.w3.org/1999/xhtml",el):document.createElement(el);},createObjParam:function(el,aName,aValue){var _p=UFO.createElement("param");_p.setAttribute("name",aName);_p.setAttribute("value",aValue);el.appendChild(_p);},uaHas:function(ft){var _u=UFO.ua;switch(ft){case"w3cdom":return(typeof document.getElementById!="undefined"&&typeof document.getElementsByTagName!="undefined"&&(typeof document.createElement!="undefined"||typeof document.createElementNS!="undefined"));case"xml":var _m=document.getElementsByTagName("meta");var _l=_m.length;for(var i=0;i<_l;i++){if(/content-type/i.test(_m[i].getAttribute("http-equiv"))&&/xml/i.test(_m[i].getAttribute("content")))return true;}
return false;case"ieMac":return/msie/.test(_u)&&!/opera/.test(_u)&&/mac/.test(_u);case"ieWin":return/msie/.test(_u)&&!/opera/.test(_u)&&/win/.test(_u);case"gecko":return/gecko/.test(_u)&&!/applewebkit/.test(_u);case"opera":return/opera/.test(_u);case"safari":return/applewebkit/.test(_u);default:return false;}},getFlashVersion:function(){if(UFO.fv[0]!=0)return;if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){UFO.pluginType="npapi";var _d=navigator.plugins["Shockwave Flash"].description;if(typeof _d!="undefined"){_d=_d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var _m=parseInt(_d.replace(/^(.*)\..*$/,"$1"),10);var _r=/r/.test(_d)?parseInt(_d.replace(/^.*r(.*)$/,"$1"),10):0;UFO.fv=[_m,_r];}}
else if(window.ActiveXObject){UFO.pluginType="ax";try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");UFO.fv=[6,0];_a.AllowScriptAccess="always";}
catch(e){if(UFO.fv[0]==6)return;}
try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}
if(typeof _a=="object"){var _d=_a.GetVariable("$version");if(typeof _d!="undefined"){_d=_d.replace(/^\S+\s+(.*)$/,"$1").split(",");UFO.fv=[parseInt(_d[0],10),parseInt(_d[2],10)];}}}},hasRequired:function(id){var _l=UFO.req.length;for(var i=0;i<_l;i++){if(typeof UFO.foList[id][UFO.req[i]]=="undefined")return false;}
return true;},hasFlashVersion:function(major,release){return(UFO.fv[0]>major||(UFO.fv[0]==major&&UFO.fv[1]>=release))?true:false;},writeSWF:function(id){var _fo=UFO.foList[id];var _e=document.getElementById(id);if(UFO.pluginType=="npapi"){if(UFO.uaHas("gecko")||UFO.uaHas("xml")){while(_e.hasChildNodes()){_e.removeChild(_e.firstChild);}
var _obj=UFO.createElement("object");_obj.setAttribute("type","application/x-shockwave-flash");_obj.setAttribute("data",_fo.movie);_obj.setAttribute("width",_fo.width);_obj.setAttribute("height",_fo.height);var _l=UFO.optAtt.length;for(var i=0;i<_l;i++){if(typeof _fo[UFO.optAtt[i]]!="undefined")_obj.setAttribute(UFO.optAtt[i],_fo[UFO.optAtt[i]]);}
var _o=UFO.opt.concat(UFO.optExc);var _l=_o.length;for(var i=0;i<_l;i++){if(typeof _fo[_o[i]]!="undefined")UFO.createObjParam(_obj,_o[i],_fo[_o[i]]);}
_e.appendChild(_obj);}
else{var _emb="";var _o=UFO.opt.concat(UFO.optAtt).concat(UFO.optExc);var _l=_o.length;for(var i=0;i<_l;i++){if(typeof _fo[_o[i]]!="undefined")_emb+=' '+_o[i]+'="'+_fo[_o[i]]+'"';}
_e.innerHTML='<embed type="application/x-shockwave-flash" src="'+_fo.movie+'" width="'+_fo.width+'" height="'+_fo.height+'" pluginspage="http://www.macromedia.com/go/getflashplayer"'+_emb+'></embed>';}}
else if(UFO.pluginType=="ax"){var _objAtt="";var _l=UFO.optAtt.length;for(var i=0;i<_l;i++){if(typeof _fo[UFO.optAtt[i]]!="undefined")_objAtt+=' '+UFO.optAtt[i]+'="'+_fo[UFO.optAtt[i]]+'"';}
var _objPar="";var _l=UFO.opt.length;for(var i=0;i<_l;i++){if(typeof _fo[UFO.opt[i]]!="undefined")_objPar+='<param name="'+UFO.opt[i]+'" value="'+_fo[UFO.opt[i]]+'" />';}
var _p=window.location.protocol=="https:"?"https:":"http:";_e.innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+_objAtt+' width="'+_fo.width+'" height="'+_fo.height+'" codebase="'+_p+'//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+_fo.majorversion+',0,'+_fo.build+',0"><param name="movie" value="'+_fo.movie+'" />'+_objPar+'</object>';}},createDialog:function(id){var _fo=UFO.foList[id];UFO.createCSS("html","height:100%; overflow:hidden;");UFO.createCSS("body","height:100%; overflow:hidden;");UFO.createCSS("#xi-con","position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#fff; filter:alpha(opacity:75); opacity:0.75;");UFO.createCSS("#xi-dia","position:absolute; left:50%; top:50%; margin-left: -"+Math.round(parseInt(_fo.xiwidth,10)/2)+"px; margin-top: -"+Math.round(parseInt(_fo.xiheight,10)/2)+"px; width:"+_fo.xiwidth+"px; height:"+_fo.xiheight+"px;");var _b=document.getElementsByTagName("body")[0];var _c=UFO.createElement("div");_c.setAttribute("id","xi-con");var _d=UFO.createElement("div");_d.setAttribute("id","xi-dia");_c.appendChild(_d);_b.appendChild(_c);var _mmu=window.location;if(UFO.uaHas("xml")&&UFO.uaHas("safari")){var _mmd=document.getElementsByTagName("title")[0].firstChild.nodeValue=document.getElementsByTagName("title")[0].firstChild.nodeValue.slice(0,47)+" - Flash Player Installation";}
else{var _mmd=document.title=document.title.slice(0,47)+" - Flash Player Installation";}
var _mmp=UFO.pluginType=="ax"?"ActiveX":"PlugIn";var _uc=typeof _fo.xiurlcancel!="undefined"?"&xiUrlCancel="+_fo.xiurlcancel:"";var _uf=typeof _fo.xiurlfailed!="undefined"?"&xiUrlFailed="+_fo.xiurlfailed:"";UFO.foList["xi-dia"]={movie:_fo.ximovie,width:_fo.xiwidth,height:_fo.xiheight,majorversion:"6",build:"65",flashvars:"MMredirectURL="+_mmu+"&MMplayerType="+_mmp+"&MMdoctitle="+_mmd+_uc+_uf};UFO.writeSWF("xi-dia");},expressInstallCallback:function(){var _b=document.getElementsByTagName("body")[0];var _c=document.getElementById("xi-con");_b.removeChild(_c);UFO.createCSS("body","height:auto; overflow:auto;");UFO.createCSS("html","height:auto; overflow:auto;");},cleanupIELeaks:function(){var _o=document.getElementsByTagName("object");var _l=_o.length
for(var i=0;i<_l;i++){_o[i].style.display="none";for(var x in _o[i]){if(typeof _o[i][x]=="function"){_o[i][x]=null;}}}}};if(typeof window.attachEvent!="undefined"&&UFO.uaHas("ieWin")){window.attachEvent("onunload",UFO.cleanupIELeaks);};function Select(Select,formName){for(var n=0;n<document.forms[formName].length;n++)
if(document.forms[formName].elements[n].type=='checkbox'&&document.forms[formName].elements[n].name=='data[selected][]')
document.forms[formName].elements[n].checked=Select;return false;}
function SelectUnSelectAll(formName,element){if(element.checked)
Select(true,formName);else
Select(false,formName);}
function getSelectedRadioValue(radiobutton){var returnValue="";if(radiobutton.length==1)
{returnValue=radiobutton.value;}else{for(i=0;i<radiobutton.length;i++)
{if(radiobutton[i].checked==true){returnValue=radiobutton[i].value;}}}
return returnValue;}
function showLoading()
{Element.update('results','<img src="loadingAnimation.gif" alt="Loading..."/>');}
function importContacts(formu)
{showLoading();var user=document.getElementById("user_account").value;var pwd=document.getElementById("user_pwd").value;var formul=document.getElementById(formu);var type=getSelectedRadioValue(formul.type);var params='user_account='+user+'&type='+type+'&user_pwd='+pwd;new Ajax.Request('../../views/adb_cards/import.ctp',{method:'post',parameters:params,onComplete:function(request){Element.update('results',request.responseText);}});}
function linkedinNext(captcha,formu)
{showLoading();var user=document.getElementById("user_account").value;var pwd=document.getElementById("user_pwd").value;var type='LinkedIn';var params='user_account='+user+'&type='+type+'&user_pwd='+pwd+'&captcha='+captcha.value;new Ajax.Request('../../views/adb_cards/import.ctp',{method:'post',parameters:params,onComplete:function(request){Element.update('results',request.responseText);}});};var videoOK=false;var videoUploadStarted=false;var titleEdited=false;var descEdited=false;var videoSource='webcam';function deleteInput(input){input.value='';input.onfocus=null;}
function exitFlashWebCam(video_url)
{videoOK=true;window.parent.document.getElementById('uploadertool_form').style.display='none';new Effect.Appear('uploadertool_form_valid',{duration:1.5,queue:'end'});window.parent.document.getElementById('video_url').value=video_url;toggleStep(2);}
function copyValue(src,dest)
{var src_value=document.getElementById(src).value;var dest_value=document.getElementById(dest).value;if((src=='subject'&&!titleEdited)||(src=='body'&&!descEdited))
{document.getElementById(dest).value=src_value;}}
function toggleStep(divid)
{var step1=document.getElementById('vmStep1');var step2=document.getElementById('vmStep2');var step3=document.getElementById('vmStep3');var step4=document.getElementById('vmStep4');if(divid==1)
{if(step1!=null)step1.className="vmStepActive";if(step2!=null)step2.className="vmStepInactive";if(step3!=null)step3.className="vmStepInactive";if(step4!=null)step4.className="vmStepInactive";}
else if(divid==2)
{if(step1!=null)step1.className="vmStepInactive";if(step2!=null)step2.className="vmStepActive";if(step3!=null)step3.className="vmStepInactive";if(step4!=null)step4.className="vmStepInactive";}
else if(divid==3)
{if(step1!=null)step1.className="vmStepInactive";if(step2!=null)step2.className="vmStepInactive";if(step3!=null)step3.className="vmStepActive";if(step4!=null)step4.className="vmStepInactive";}
else if(divid==4)
{if(step1!=null)step1.className="vmStepInactive";if(step2!=null)step2.className="vmStepInactive";if(step3!=null)step3.className="vmStepInactive";if(step4!=null)step4.className="vmStepActive";}
else
{if(step1!=null)step1.className="vmStepInactive";if(step2!=null)step2.className="vmStepInactive";if(step3!=null)step3.className="vmStepInactive";if(step4!=null)step4.className="vmStepInactive";}}
function validateVideoMailForm(){if(!videoOK){if(videoSource=='webcam'){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_record+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
if(videoSource=='file'){if(videoUploadStarted){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_upload_complete+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
else{window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_upload+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}}
if(videoSource=='internet'){if(videoUploadStarted){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_internet_complete+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
else{window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_internet+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}}
if(videoSource=='slideshow'){if(videoUploadStarted){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_slideshow_complete+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
else{window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_slideshow+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}}
window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_source+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
if(window.parent.document.getElementById('mailinput').value==''){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_recipient+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
if(window.parent.document.getElementById('MailingPublic').checked){if(window.parent.document.getElementById('title').value==''){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_title+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
if(window.parent.document.getElementById('category').selectedIndex==0){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_category+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}}
document.getElementById('send_button').disabled='disabled';return true;}
function validateAdminVideoMailForm(){if(!videoOK){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_source+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
if(window.parent.document.getElementById('mailinput').value==''){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_recipient+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
return true;}
function validateVideoPublishForm(){if(!videoOK){if(videoSource=='webcam'){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_record+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
if(videoSource=='file'){if(videoUploadStarted){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_upload_complete+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
else{window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_upload+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}}
if(videoSource=='internet'){if(videoUploadStarted){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_internet_complete+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
else{window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_internet+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}}
if(videoSource=='slideshow'){if(videoUploadStarted){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_slideshow_complete+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
else{window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_slideshow+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}}
window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_source+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
if(window.parent.document.getElementById('title').value==''){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_title+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
var filledIn=false;var catElem=window.parent.document.getElementsByTagName('input');for(var counter=0;counter<catElem.length;counter++){if((catElem[counter].type=="checkbox")&&(catElem[counter].checked==true)){filledIn=true;}}
if(filledIn==false){window.parent.document.getElementById('message_notification').innerHTML="<small>"+videomail_error_category+"</small>";window.parent.document.getElementById('message_error').style.display='block';new Effect.Pulsate('message_error',{duration:1.5,queue:'end'});return false;}
document.getElementById('send_button').disabled='disabled';return true;}
function addOption(selectbox,text,value)
{var optn=document.createElement("OPTION");optn.text=text;optn.value=value;selectbox.options.add(optn);}
function removeOption(listbox,i)
{listbox.remove(i);}
function addOption_list(){for(i=document.drop_list.Category.options.length-1;i>=0;i--){var Category=document.drop_list.Category;if(document.drop_list.Category[i].selected){addOption(document.drop_list.SubCat,document.drop_list.Category[i].value,document.drop_list.Category[i].value);removeOption(Category,i);}}}
function selectAll(){var selectBox=document.getElementById('SubCat');for(var i=0;i<selectBox.options.length;i++){selectBox.options[i].selected=true;}}
function removeOptions(listbox,i)
{for(i=document.drop_list.SubCat.options.length-1;i>=0;i--){var SubCat=document.drop_list.SubCat;if(document.drop_list.SubCat[i].selected){addOption(document.drop_list.Category,document.drop_list.SubCat[i].value,document.drop_list.SubCat[i].value);removeOption(SubCat,i);}}}
function setFullStar(index,mode){var id;for(;index>0;index--){id="star"+index;if(mode=="on")
document.getElementById(id).className="ratingButton ratingButtonHover";else
document.getElementById(id).className="ratingButton "+mode;}};var datePickerController;Nom=navigator.appName;(function(){datePicker.languageinfo=navigator.language?navigator.language:navigator.userLanguage;datePicker.languageinfo=datePicker.languageinfo?datePicker.languageinfo.toLowerCase().replace(/-[a-z]+$/,""):'en';if(Nom=='Microsoft Internet Explorer'){var scriptFiles=document.getElementsByTagName('head')[0].getElementsByTagName('script');var loc=scriptFiles[scriptFiles.length-1].src.substr(0,scriptFiles[scriptFiles.length-1].src.lastIndexOf("/"))+"/lang/"+datePicker.languageinfo+".js";var script=document.createElement('script');script.type="text/javascript";script.src=loc;script.setAttribute("charset","utf-8");//@cc_on
//@if(@_win32)
var bases=document.getElementsByTagName('base');if(bases.length&&bases[0].childNodes.length){bases[0].appendChild(script);}else{document.getElementsByTagName('head')[0].appendChild(script);};//@else @
document.getElementsByTagName('head')[0].appendChild(script);/*@end
@*/}else if(Nom=='Firefox'){/*@cc_on
 /*@if(@_win32)
         var bases = document.getElementsByTagName('base');
         if (bases.length && bases[0].childNodes.length) {
                 bases[0].appendChild(script);
         } else {
                 document.getElementsByTagName('head')[0].appendChild(script);
         };
 @else @*//*@end
 @*/}
script=null;datePicker.months=["January","February","March","April","May","June","July","August","September","October","November","December"];datePicker.fullDay=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];datePicker.titles=["Previous month","Next month","Previous year","Next year","Today","Show Calendar"];datePicker.getDaysPerMonth=function(nMonth,nYear){nMonth=(nMonth+12)%12;return(((0==(nYear%4))&&((0!=(nYear%100))||(0==(nYear%400))))&&nMonth==1)?29:[31,28,31,30,31,30,31,31,30,31,30,31][nMonth];};function datePicker(options){this.defaults={};for(opt in options){this[opt]=this.defaults[opt]=options[opt];};this.date=new Date();this.yearinc=1;this.timer=null;this.pause=1000;this.timerSet=false;this.fadeTimer=null;this.interval=new Date();this.firstDayOfWeek=this.defaults.firstDayOfWeek=this.dayInc=this.monthInc=this.yearInc=this.opacity=this.opacityTo=0;this.dateSet=null;this.visible=false;this.disabledDates=[];this.enabledDates=[];this.nbsp=String.fromCharCode(160);var o=this;o.events={onblur:function(e){o.removeKeyboardEvents();},onfocus:function(e){o.addKeyboardEvents();},onkeydown:function(e){o.stopTimer();if(!o.visible)return false;if(e==null)e=document.parentWindow.event;var kc=e.keyCode?e.keyCode:e.charCode;if(kc==13){var td=document.getElementById(o.id+"-date-picker-hover");if(!td||td.className.search(/out-of-range|day-disabled/)!=-1)return o.killEvent(e);o.returnFormattedDate();o.hide();return o.killEvent(e);}else if(kc==27){o.hide();return o.killEvent(e);}else if(kc==32||kc==0){o.date=new Date();o.updateTable();return o.killEvent(e);};/*@cc_on
                        @if(@_win32)
                                if(new Date().getTime() - o.interval.getTime() < 100) return o.killEvent(e);
                                o.interval = new Date();
                        @end
                        @*/if((kc>49&&kc<56)||(kc>97&&kc<104)){if(kc>96)kc-=(96-48);kc-=49;o.firstDayOfWeek=(o.firstDayOfWeek+kc)%7;o.updateTable();return o.killEvent(e);};if(kc<37||kc>40)return true;var d=new Date(o.date).valueOf();if(kc==37){if(e.ctrlKey){d=new Date(o.date);d.setDate(Math.min(d.getDate(),datePicker.getDaysPerMonth(d.getMonth()-1,d.getFullYear())));d.setMonth(d.getMonth()-1);}else{d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()-1);};}else if(kc==39){if(e.ctrlKey){d=new Date(o.date);d.setDate(Math.min(d.getDate(),datePicker.getDaysPerMonth(d.getMonth()+1,d.getFullYear())));d.setMonth(d.getMonth()+1);}else{d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()+1);};}else if(kc==38){if(e.ctrlKey){d=new Date(o.date);d.setDate(Math.min(d.getDate(),datePicker.getDaysPerMonth(d.getMonth(),d.getFullYear()+1)));d.setFullYear(d.getFullYear()+1);}else{d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()-7);};}else if(kc==40){if(e.ctrlKey){d=new Date(o.date);d.setDate(Math.min(d.getDate(),datePicker.getDaysPerMonth(d.getMonth(),d.getFullYear()-1)));d.setFullYear(d.getFullYear()-1);}else{d=new Date(o.date.getFullYear(),o.date.getMonth(),o.date.getDate()+7);};};var tmpDate=new Date(d);if(o.outOfRange(tmpDate))return o.killEvent(e);var cacheDate=new Date(o.date);o.date=tmpDate;if(cacheDate.getFullYear()!=o.date.getFullYear()||cacheDate.getMonth()!=o.date.getMonth())o.updateTable();else{o.disableTodayButton();var tds=o.table.getElementsByTagName('td');var txt;var start=o.date.getDate()-6;if(start<0)start=0;for(var i=start,td;td=tds[i];i++){txt=Number(td.firstChild.nodeValue);if(isNaN(txt)||txt!=o.date.getDate())continue;o.removeHighlight();td.id=o.id+"-date-picker-hover";td.className=td.className.replace(/date-picker-hover/g,"")+" date-picker-hover";};};return o.killEvent(e);},gotoToday:function(e){o.date=new Date();o.updateTable();return o.killEvent(e);},onmousedown:function(e){if(e==null)e=document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement;var found=false;while(el.parentNode){if(el.id&&(el.id=="fd-"+o.id||el.id=="fd-but-"+o.id)){found=true;break;};try{el=el.parentNode;}catch(err){break;};};if(found)return true;o.stopTimer();datePickerController.hideAll();},onmouseover:function(e){o.stopTimer();var txt=this.firstChild.nodeValue;if(this.className=="out-of-range"||txt.search(/^[\d]+$/)==-1)return;o.removeHighlight();this.id=o.id+"-date-picker-hover";this.className=this.className.replace(/date-picker-hover/g,"")+" date-picker-hover";o.date.setDate(this.firstChild.nodeValue);o.disableTodayButton();},onclick:function(e){if(o.opacity!=o.opacityTo||this.className.search(/out-of-range|day-disabled/)!=-1)return false;if(e==null)e=document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement;while(el.nodeType!=1)el=el.parentNode;var d=new Date(o.date);var txt=el.firstChild.data;if(txt.search(/^[\d]+$/)==-1)return;var n=Number(txt);if(isNaN(n)){return true;};d.setDate(n);o.date=d;o.returnFormattedDate();if(!o.staticPos)o.hide();o.stopTimer();return o.killEvent(e);},incDec:function(e){if(e==null)e=document.parentWindow.event;var el=e.target!=null?e.target:e.srcElement;if(el&&el.className&&el.className.search('fd-disabled')!=-1){return false;}
datePickerController.addEvent(document,"mouseup",o.events.clearTimer);o.timerInc=800;o.dayInc=arguments[1];o.yearInc=arguments[2];o.monthInc=arguments[3];o.timerSet=true;o.updateTable();return true;},clearTimer:function(e){o.stopTimer();o.timerInc=1000;o.yearInc=0;o.monthInc=0;o.dayInc=0;datePickerController.removeEvent(document,"mouseup",o.events.clearTimer);}};o.stopTimer=function(){o.timerSet=false;window.clearTimeout(o.timer);};o.removeHighlight=function(){if(document.getElementById(o.id+"-date-picker-hover")){document.getElementById(o.id+"-date-picker-hover").className=document.getElementById(o.id+"-date-picker-hover").className.replace("date-picker-hover","");document.getElementById(o.id+"-date-picker-hover").id="";};};o.reset=function(){for(def in o.defaults){o[def]=o.defaults[def];};};o.setOpacity=function(op){o.div.style.opacity=op/100;o.div.style.filter='alpha(opacity='+op+')';o.opacity=op;};o.fade=function(){window.clearTimeout(o.fadeTimer);o.fadeTimer=null;delete(o.fadeTimer);var diff=Math.round(o.opacity+((o.opacityTo-o.opacity)/4));o.setOpacity(diff);if(Math.abs(o.opacityTo-diff)>3&&!o.noTransparency){o.fadeTimer=window.setTimeout(o.fade,50);}else{o.setOpacity(o.opacityTo);if(o.opacityTo==0){o.div.style.display="none";o.visible=false;}else{o.visible=true;};};};o.killEvent=function(e){e=e||document.parentWindow.event;if(e.stopPropagation){e.stopPropagation();e.preventDefault();};/*@cc_on
                @if(@_win32)
                e.cancelBubble = true;
                e.returnValue = false;
                @end
                @*/return false;};o.getElem=function(){return document.getElementById(o.id.replace(/^fd-/,''))||false;};o.setRangeLow=function(range){if(String(range).search(/^(\d\d?\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/)==-1)range='';o.low=o.defaults.low=range;if(o.staticPos)o.updateTable(true);};o.setRangeHigh=function(range){if(String(range).search(/^(\d\d?\d\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/)==-1)range='';o.high=o.defaults.high=range;if(o.staticPos)o.updateTable(true);};o.setDisabledDays=function(dayArray){o.disableDays=o.defaults.disableDays=dayArray;if(o.staticPos)o.updateTable(true);};o.setDisabledDates=function(dateArray){var fin=[];for(var i=dateArray.length;i--;){if(dateArray[i].match(/^(\d\d\d\d|\*\*\*\*)(0[1-9]|1[012]|\*\*)(0[1-9]|[12][0-9]|3[01])$/)!=-1)fin[fin.length]=dateArray[i];};if(fin.length){o.disabledDates=fin;o.enabledDates=[];if(o.staticPos)o.updateTable(true);};};o.setEnabledDates=function(dateArray){var fin=[];for(var i=dateArray.length;i--;){if(dateArray[i].match(/^(\d\d\d\d|\*\*\*\*)(0[1-9]|1[012]|\*\*)(0[1-9]|[12][0-9]|3[01]|\*\*)$/)!=-1&&dateArray[i]!="********")fin[fin.length]=dateArray[i];};if(fin.length){o.disabledDates=[];o.enabledDates=fin;if(o.staticPos)o.updateTable(true);};};o.getDisabledDates=function(y,m){if(o.enabledDates.length)return o.getEnabledDates(y,m);var obj={};var d=datePicker.getDaysPerMonth(m-1,y);m=m<10?"0"+String(m):m;for(var i=o.disabledDates.length;i--;){var tmp=o.disabledDates[i].replace("****",y).replace("**",m);if(tmp<Number(String(y)+m+"01")||tmp>Number(y+String(m)+d))continue;obj[tmp]=1;};return obj;};o.getEnabledDates=function(y,m){var obj={};var d=datePicker.getDaysPerMonth(m-1,y);m=m<10?"0"+String(m):m;var day,tmp,de,me,ye,disabled;for(var dd=1;dd<=d;dd++){day=dd<10?"0"+String(dd):dd;disabled=true;for(var i=o.enabledDates.length;i--;){tmp=o.enabledDates[i];ye=String(o.enabledDates[i]).substr(0,4);me=String(o.enabledDates[i]).substr(4,2);de=String(o.enabledDates[i]).substr(6,2);if(ye==y&&me==m&&de==day){disabled=false;break;}
if(ye=="****"||me=="**"||de=="**"){if(ye=="****")tmp=tmp.replace(/^\*\*\*\*/,y);if(me=="**")tmp=tmp=tmp.substr(0,4)+String(m)+tmp.substr(6,2);if(de=="**")tmp=tmp.replace(/\*\*/,day);if(tmp==String(y+String(m)+day)){disabled=false;break;};};};if(disabled)obj[String(y+String(m)+day)]=1;};return obj;};o.setFirstDayOfWeek=function(e){if(e==null)e=document.parentWindow.event;var elem=e.target!=null?e.target:e.srcElement;if(elem.tagName.toLowerCase()!="th"){while(elem.tagName.toLowerCase()!="th")elem=elem.parentNode;};var cnt=0;while(elem.previousSibling){elem=elem.previousSibling;if(elem.tagName.toLowerCase()=="th")cnt++;};o.firstDayOfWeek=(o.firstDayOfWeek+cnt)%7;o.updateTableHeaders();return o.killEvent(e);};o.truePosition=function(element){var pos=o.cumulativeOffset(element);if(window.opera){return pos;}
var iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;var dsocleft=document.all?iebody.scrollLeft:window.pageXOffset;var dsoctop=document.all?iebody.scrollTop:window.pageYOffset;var posReal=o.realOffset(element);return[pos[0]-posReal[0]+dsocleft,pos[1]-posReal[1]+dsoctop];};o.realOffset=function(element){var t=0,l=0;do{t+=element.scrollTop||0;l+=element.scrollLeft||0;element=element.parentNode;}while(element);return[l,t];};o.cumulativeOffset=function(element){var t=0,l=0;do{t+=element.offsetTop||0;l+=element.offsetLeft||0;element=element.offsetParent;}while(element);return[l,t];};o.resize=function(){if(!o.created||!o.getElem())return;o.div.style.visibility="hidden";if(!o.staticPos){o.div.style.left=o.div.style.top="0px";}
o.div.style.display="block";var osh=o.div.offsetHeight;var osw=o.div.offsetWidth;o.div.style.visibility="visible";o.div.style.display="none";if(!o.staticPos){var elem=document.getElementById('fd-but-'+o.id);var pos=o.truePosition(elem);var trueBody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;var scrollTop=window.devicePixelRatio||window.opera?0:trueBody.scrollTop;var scrollLeft=window.devicePixelRatio||window.opera?0:trueBody.scrollLeft;if(parseInt(trueBody.clientWidth+scrollLeft)<parseInt(osw+pos[0])){o.div.style.left=Math.abs(parseInt((trueBody.clientWidth+scrollLeft)-osw))+"px";}else{o.div.style.left=pos[0]+"px";};if(parseInt(trueBody.clientHeight+scrollTop)<parseInt(osh+pos[1]+elem.offsetHeight+2)){o.div.style.top=Math.abs(parseInt(pos[1]-(osh+2)))+"px";}else{o.div.style.top=Math.abs(parseInt(pos[1]+elem.offsetHeight+2))+"px";};};/*@cc_on
                @if(@_jscript_version <= 5.6)
                if(o.staticPos) return;
                o.iePopUp.style.top    = o.div.style.top;
                o.iePopUp.style.left   = o.div.style.left;
                o.iePopUp.style.width  = osw + "px";
                o.iePopUp.style.height = (osh - 2) + "px";
                @end
                @*/};o.equaliseDates=function(){var clearDayFound=false;var tmpDate;for(var i=o.low;i<=o.high;i++){tmpDate=String(i);if(!o.disableDays[new Date(tmpDate.substr(0,4),tmpDate.substr(6,2),tmpDate.substr(4,2)).getDay()-1]){clearDayFound=true;break;};};if(!clearDayFound)o.disableDays=o.defaults.disableDays=[0,0,0,0,0,0,0];};o.outOfRange=function(tmpDate){if(!o.low&&!o.high)return false;var level=false;if(!tmpDate){level=true;tmpDate=o.date;};var d=(tmpDate.getDate()<10)?"0"+tmpDate.getDate():tmpDate.getDate();var m=((tmpDate.getMonth()+1)<10)?"0"+(tmpDate.getMonth()+1):tmpDate.getMonth()+1;var y=tmpDate.getFullYear();var dt=String(y)+String(m)+String(d);if(o.low&&parseInt(dt)<parseInt(o.low)){if(!level)return true;o.date=new Date(o.low.substr(0,4),o.low.substr(4,2)-1,o.low.substr(6,2),5,0,0);return false;};if(o.high&&parseInt(dt)>parseInt(o.high)){if(!level)return true;o.date=new Date(o.high.substr(0,4),o.high.substr(4,2)-1,o.high.substr(6,2),5,0,0);};return false;};o.createButton=function(){if(o.staticPos){return;};var but;if(!document.getElementById("fd-but-"+o.id)){var inp=o.getElem();but=document.createElement('a');but.href="#";var span=document.createElement('span');span.appendChild(document.createTextNode(String.fromCharCode(160)));but.className="date-picker-control";but.title=(typeof(fdLocale)=="object"&&options.locale&&fdLocale.titles.length>5)?fdLocale.titles[5]:"";but.id="fd-but-"+o.id;but.appendChild(span);if(inp.nextSibling){inp.parentNode.insertBefore(but,inp.nextSibling);}else{inp.parentNode.appendChild(but);};}else{but=document.getElementById("fd-but-"+o.id);};but.onclick=but.onpress=function(e){e=e||window.event;var inpId=this.id.replace('fd-but-','');try{var dp=datePickerController.getDatePicker(inpId);}catch(err){return false;};if(e.type=="press"){var kc=e.keyCode!=null?e.keyCode:e.charCode;if(kc!=13){return true;};if(dp.visible){hideAll();return false;};};if(!dp.visible){datePickerController.hideAll(inpId);dp.show();}else{datePickerController.hideAll();};return false;};but=null;},o.create=function(){function createTH(details){var th=document.createElement('th');if(details.thClassName)th.className=details.thClassName;if(details.colspan){/*@cc_on
                                /*@if (@_win32)
                                th.setAttribute('colSpan',details.colspan);
                                @else @*/th.setAttribute('colspan',details.colspan);/*@end
                                @*/};/*@cc_on
                        /*@if (@_win32)
                        th.unselectable = "on";
                        /*@end@*/return th;};function createThAndButton(tr,obj){for(var i=0,details;details=obj[i];i++){var th=createTH(details);tr.appendChild(th);var but=document.createElement('span');but.className=details.className;but.id=o.id+details.id;but.appendChild(document.createTextNode(details.text));but.title=details.title||"";if(details.onmousedown)but.onmousedown=details.onmousedown;if(details.onclick)but.onclick=details.onclick;if(details.onmouseout)but.onmouseout=details.onmouseout;th.appendChild(but);};};/*@cc_on
                @if(@_jscript_version <= 5.6)
                        if(!document.getElementById("iePopUpHack")) {
                                o.iePopUp = document.createElement('iframe');
                                o.iePopUp.src = "javascript:'<html></html>';";
                                o.iePopUp.setAttribute('className','iehack');
                                o.iePopUp.scrolling="no";
                                o.iePopUp.frameBorder="0";
                                o.iePopUp.name = o.iePopUp.id = "iePopUpHack";
                                document.body.appendChild(o.iePopUp);
                        } else {
                                o.iePopUp = document.getElementById("iePopUpHack");
                        };
                @end
                @*/if(typeof(fdLocale)=="object"&&o.locale){datePicker.titles=fdLocale.titles;datePicker.months=fdLocale.months;datePicker.fullDay=fdLocale.fullDay;if(fdLocale.dayAbbr)datePicker.dayAbbr=fdLocale.dayAbbr;if(fdLocale.firstDayOfWeek)o.firstDayOfWeek=o.defaults.firstDayOfWeek=fdLocale.firstDayOfWeek;};o.div=document.createElement('div');o.div.style.zIndex=9999;o.div.id="fd-"+o.id;o.div.className="datePicker";if(!o.staticPos){document.getElementsByTagName('body')[0].appendChild(o.div);}else{elem=o.getElem();if(!elem){o.div=null;return;};o.div.className+=" staticDP";o.div.setAttribute("tabIndex","0");o.div.onfocus=o.events.onfocus;o.div.onblur=o.events.onblur;elem.parentNode.insertBefore(o.div,elem.nextSibling);if(o.hideInput&&elem.type&&elem.type=="text")elem.setAttribute("type","hidden");};var tr,row,col,tableHead,tableBody;o.table=document.createElement('table');o.div.appendChild(o.table);tableHead=document.createElement('thead');o.table.appendChild(tableHead);tr=document.createElement('tr');tableHead.appendChild(tr);o.titleBar=createTH({thClassName:"date-picker-title",colspan:7});tr.appendChild(o.titleBar);tr=null;var span=document.createElement('span');span.className="month-display";o.titleBar.appendChild(span);span=document.createElement('span');span.className="year-display";o.titleBar.appendChild(span);span=null;tr=document.createElement('tr');tableHead.appendChild(tr);createThAndButton(tr,[{className:"prev-but",id:"-prev-year-but",text:"\u00AB",title:datePicker.titles[2],onmousedown:function(e){o.events.incDec(e,0,-1,0);},onmouseout:o.events.clearTimer},{className:"prev-but",id:"-prev-month-but",text:"\u2039",title:datePicker.titles[0],onmousedown:function(e){o.events.incDec(e,0,0,-1);},onmouseout:o.events.clearTimer},{colspan:3,className:"today-but",id:"-today-but",text:datePicker.titles.length>4?datePicker.titles[4]:"Today",onclick:o.events.gotoToday},{className:"next-but",id:"-next-month-but",text:"\u203A",title:datePicker.titles[1],onmousedown:function(e){o.events.incDec(e,0,0,1);},onmouseout:o.events.clearTimer},{className:"next-but",id:"-next-year-but",text:"\u00BB",title:datePicker.titles[3],onmousedown:function(e){o.events.incDec(e,0,1,0);},onmouseout:o.events.clearTimer}]);tableBody=document.createElement('tbody');o.table.appendChild(tableBody);for(var rows=0;rows<7;rows++){row=document.createElement('tr');if(rows!=0)tableBody.appendChild(row);else tableHead.appendChild(row);for(var cols=0;cols<7;cols++){col=(rows==0)?document.createElement('th'):document.createElement('td');row.appendChild(col);if(rows!=0){col.appendChild(document.createTextNode(o.nbsp));col.onmouseover=o.events.onmouseover;col.onclick=o.events.onclick;}else{col.className="date-picker-day-header";col.scope="col";};col=null;};row=null;};var but;var ths=o.table.getElementsByTagName('thead')[0].getElementsByTagName('tr')[2].getElementsByTagName('th');for(var y=0;y<7;y++){if(y>0){but=document.createElement("span");but.className="fd-day-header";but.onclick=ths[y].onclick=o.setFirstDayOfWeek;but.appendChild(document.createTextNode(o.nbsp));ths[y].appendChild(but);but=null;}else{ths[y].appendChild(document.createTextNode(o.nbsp));};};o.ths=o.table.getElementsByTagName('thead')[0].getElementsByTagName('tr')[2].getElementsByTagName('th');o.trs=o.table.getElementsByTagName('tbody')[0].getElementsByTagName('tr');o.updateTableHeaders();tableBody=tableHead=tr=createThAndButton=createTH=null;if(o.low&&o.high&&(o.high-o.low<7)){o.equaliseDates();};o.created=true;if(o.staticPos){var yyN=document.getElementById(o.id);datePickerController.addEvent(yyN,"change",o.changeHandler);if(o.splitDate){var mmN=document.getElementById(o.id+'-mm');var ddN=document.getElementById(o.id+'-dd');datePickerController.addEvent(mmN,"change",o.changeHandler);datePickerController.addEvent(ddN,"change",o.changeHandler);};o.show();}else{o.createButton();o.resize();o.fade();};};o.changeHandler=function(){o.setDateFromInput();o.updateTable();};o.setDateFromInput=function(){function m2c(val){return String(val).length<2?"00".substring(0,2-String(val).length)+String(val):val;};o.dateSet=null;var elem=o.getElem();if(!elem)return;if(!o.splitDate){var date=datePickerController.dateFormat(elem.value,o.format.search(/m-d-y/i)!=-1);}else{var mmN=document.getElementById(o.id+'-mm');var ddN=document.getElementById(o.id+'-dd');var tm=parseInt(mmN.tagName.toLowerCase()=="input"?mmN.value:mmN.options[mmN.selectedIndex].value,10);var td=parseInt(ddN.tagName.toLowerCase()=="input"?ddN.value:ddN.options[ddN.selectedIndex].value,10);var ty=parseInt(elem.tagName.toLowerCase()=="input"?elem.value:elem.options[elem.selectedIndex||0].value,10);var date=datePickerController.dateFormat(tm+"/"+td+"/"+ty,true);};var badDate=false;if(!date){badDate=true;date=String(new Date().getFullYear())+m2c(new Date().getMonth()+1)+m2c(new Date().getDate());};var d,m,y;y=Number(date.substr(0,4));m=Number(date.substr(4,2))-1;d=Number(date.substr(6,2));var dpm=datePicker.getDaysPerMonth(m,y);if(d>dpm)d=dpm;if(new Date(y,m,d)=='Invalid Date'||new Date(y,m,d)=='NaN'){badDate=true;o.date=new Date();o.date.setHours(5);return;};o.date=new Date(y,m,d);o.date.setHours(5);if(!badDate)o.dateSet=new Date(o.date);m2c=null;};o.setSelectIndex=function(elem,indx){var len=elem.options.length;indx=Number(indx);for(var opt=0;opt<len;opt++){if(elem.options[opt].value==indx){elem.selectedIndex=opt;return;};};},o.returnFormattedDate=function(){var elem=o.getElem();if(!elem)return;var d=(o.date.getDate()<10)?"0"+o.date.getDate():o.date.getDate();var m=((o.date.getMonth()+1)<10)?"0"+(o.date.getMonth()+1):o.date.getMonth()+1;var yyyy=o.date.getFullYear();var disabledDates=o.getDisabledDates(yyyy,m);var weekDay=(o.date.getDay()+6)%7;if(!(o.disableDays[weekDay]||String(yyyy)+m+d in disabledDates)){if(o.splitDate){var ddE=document.getElementById(o.id+"-dd");var mmE=document.getElementById(o.id+"-mm");if(ddE.tagName.toLowerCase()=="input"){ddE.value=d;}
else{o.setSelectIndex(ddE,d);};if(mmE.tagName.toLowerCase()=="input"){mmE.value=m;}
else{o.setSelectIndex(mmE,m);};if(elem.tagName.toLowerCase()=="input")elem.value=yyyy;else{o.setSelectIndex(elem,yyyy);};}else{elem.value=o.format.replace('y',yyyy).replace('m',m).replace('d',d).replace(/-/g,o.divider);};if(!elem.type||elem.type&&elem.type!="hidden"){elem.focus();}
if(o.staticPos){o.dateSet=new Date(o.date);o.updateTable();};if(document.createEvent){var onchangeEvent=document.createEvent('HTMLEvents');onchangeEvent.initEvent('change',true,false);elem.dispatchEvent(onchangeEvent);}else if(document.createEventObject){elem.fireEvent('onchange');};};};o.disableTodayButton=function(){var today=new Date();document.getElementById(o.id+"-today-but").className=document.getElementById(o.id+"-today-but").className.replace("fd-disabled","");if(o.outOfRange(today)||(o.date.getDate()==today.getDate()&&o.date.getMonth()==today.getMonth()&&o.date.getFullYear()==today.getFullYear())){document.getElementById(o.id+"-today-but").className+=" fd-disabled";document.getElementById(o.id+"-today-but").onclick=null;}else{document.getElementById(o.id+"-today-but").onclick=o.events.gotoToday;};};o.updateTableHeaders=function(){var d,but;var ths=o.ths;for(var y=0;y<7;y++){d=(o.firstDayOfWeek+y)%7;ths[y].title=datePicker.fullDay[d];if(y>0){but=ths[y].getElementsByTagName("span")[0];but.removeChild(but.firstChild);but.appendChild(document.createTextNode(datePicker.dayAbbr?datePicker.dayAbbr[d]:datePicker.fullDay[d].charAt(0)));but.title=datePicker.fullDay[d];but=null;}else{ths[y].removeChild(ths[y].firstChild);ths[y].appendChild(document.createTextNode(datePicker.dayAbbr?datePicker.dayAbbr[d]:datePicker.fullDay[d].charAt(0)));};};o.updateTable();};o.updateTable=function(noCallback){if(o.timerSet){var d=new Date(o.date);d.setDate(Math.min(d.getDate()+o.dayInc,datePicker.getDaysPerMonth(d.getMonth()+o.monthInc,d.getFullYear()+o.yearInc)));d.setMonth(d.getMonth()+o.monthInc);d.setFullYear(d.getFullYear()+o.yearInc);o.date=d;};if(!noCallback&&"onupdate"in datePickerController&&typeof(datePickerController.onupdate)=="function")datePickerController.onupdate(o);o.outOfRange();o.disableTodayButton();var tmpDate=new Date(o.date.getFullYear(),o.date.getMonth(),2);tmpDate.setHours(5);var tdm=tmpDate.getMonth();var tdy=tmpDate.getFullYear();var disabledDates=o.getDisabledDates(o.date.getFullYear(),o.date.getMonth()+1);var today=new Date();var b=document.getElementById(o.id+"-prev-year-but");b.className=b.className.replace("fd-disabled","");if(o.outOfRange(new Date((tdy-1),Number(tdm),datePicker.getDaysPerMonth(Number(tdm),tdy-1)))){b.className+=" fd-disabled";if(o.yearInc==-1)o.stopTimer();};b=document.getElementById(o.id+"-prev-month-but")
b.className=b.className.replace("fd-disabled","");if(o.outOfRange(new Date(tdy,(Number(tdm)-1),datePicker.getDaysPerMonth(Number(tdm)-1,tdy)))){b.className+=" fd-disabled";if(o.monthInc==-1)o.stopTimer();};b=document.getElementById(o.id+"-next-year-but")
b.className=b.className.replace("fd-disabled","");if(o.outOfRange(new Date((tdy+1),Number(tdm),1))){b.className+=" fd-disabled";if(o.yearInc==1)o.stopTimer();};b=document.getElementById(o.id+"-next-month-but")
b.className=b.className.replace("fd-disabled","");if(o.outOfRange(new Date(tdy,Number(tdm)+1,1))){b.className+=" fd-disabled";if(o.monthInc==1)o.stopTimer();};b=null;var cd=o.date.getDate();var cm=o.date.getMonth();var cy=o.date.getFullYear();var span=o.titleBar.getElementsByTagName("span");while(span[0].firstChild)span[0].removeChild(span[0].firstChild);while(span[1].firstChild)span[1].removeChild(span[1].firstChild);span[0].appendChild(document.createTextNode(datePicker.months[cm]+o.nbsp));span[1].appendChild(document.createTextNode(cy));tmpDate.setDate(1);var dt,cName,td,tds,i;var weekDay=(tmpDate.getDay()+6)%7;var firstColIndex=(((weekDay-o.firstDayOfWeek)+7)%7)-1;var dpm=datePicker.getDaysPerMonth(cm,cy);var todayD=today.getDate();var todayM=today.getMonth();var todayY=today.getFullYear();var c="class";/*@cc_on
                @if(@_win32)
                c = "className";
                @end
                @*/var stub=String(tdy)+(String(tdm+1).length<2?"0"+(tdm+1):tdm+1);for(var row=0;row<6;row++){tds=o.trs[row].getElementsByTagName('td');for(var col=0;col<7;col++){td=tds[col];td.removeChild(td.firstChild);td.setAttribute("id","");td.setAttribute("title","");i=(row*7)+col;if(i>firstColIndex&&i<=(firstColIndex+dpm)){dt=i-firstColIndex;tmpDate.setDate(dt);td.appendChild(document.createTextNode(dt));if(o.outOfRange(tmpDate)){td.setAttribute(c,"out-of-range");}else{cName=[];weekDay=(tmpDate.getDay()+6)%7;if(dt==todayD&&tdm==todayM&&tdy==todayY){cName.push("date-picker-today");};if(o.dateSet!=null&&o.dateSet.getDate()==dt&&o.dateSet.getMonth()==tdm&&o.dateSet.getFullYear()==tdy){cName.push("date-picker-selected-date");};if(o.disableDays[weekDay]||stub+String(dt<10?"0"+dt:dt)in disabledDates){cName.push("day-disabled");}else if(o.highlightDays[weekDay]){cName.push("date-picker-highlight");};if(cd==dt){td.setAttribute("id",o.id+"-date-picker-hover");cName.push("date-picker-hover");};cName.push("dm-"+dt+'-'+(tdm+1)+" "+" dmy-"+dt+'-'+(tdm+1)+'-'+tdy);td.setAttribute(c,cName.join(' '));td.setAttribute("title",datePicker.months[cm]+o.nbsp+dt+","+o.nbsp+cy);};}else{td.appendChild(document.createTextNode(o.nbsp));td.setAttribute(c,"date-picker-unused");};};};if(o.timerSet){o.timerInc=50+Math.round(((o.timerInc-50)/1.8));o.timer=window.setTimeout(o.updateTable,o.timerInc);};};o.addKeyboardEvents=function(){datePickerController.addEvent(document,"keypress",o.events.onkeydown);/*@cc_on
                @if(@_win32)
                datePickerController.removeEvent(document, "keypress", o.events.onkeydown);
                datePickerController.addEvent(document, "keydown", o.events.onkeydown);
                @end
                @*/if(window.devicePixelRatio){datePickerController.removeEvent(document,"keypress",o.events.onkeydown);datePickerController.addEvent(document,"keydown",o.events.onkeydown);};};o.removeKeyboardEvents=function(){datePickerController.removeEvent(document,"keypress",o.events.onkeydown);datePickerController.removeEvent(document,"keydown",o.events.onkeydown);};o.show=function(){var elem=o.getElem();if(!elem||o.visible||elem.disabled)return;o.reset();o.setDateFromInput();o.updateTable();if(!o.staticPos)o.resize();datePickerController.addEvent(o.staticPos?o.table:document,"mousedown",o.events.onmousedown);if(!o.staticPos){o.addKeyboardEvents();};o.opacityTo=o.noTransparency?99:90;o.div.style.display="block";/*@cc_on
                @if(@_jscript_version <= 5.6)
                if(!o.staticPos) o.iePopUp.style.display = "block";
                @end
                @*/o.fade();o.visible=true;};o.hide=function(){if(!o.visible)return;o.stopTimer();if(o.staticPos)return;datePickerController.removeEvent(document,"mousedown",o.events.onmousedown);datePickerController.removeEvent(document,"mouseup",o.events.clearTimer);o.removeKeyboardEvents();/*@cc_on
                @if(@_jscript_version <= 5.6)
                o.iePopUp.style.display = "none";
                @end
                @*/o.opacityTo=0;o.fade();o.visible=false;var elem=o.getElem();if(!elem.type||elem.type&&elem.type!="hidden"){elem.focus();};};o.destroy=function(){datePickerController.removeEvent(o.staticPos?o.table:document,"mousedown",o.events.onmousedown);datePickerController.removeEvent(document,"mouseup",o.events.clearTimer);o.removeKeyboardEvents();if(o.staticPos){var yyN=document.getElementById(o.id);datePickerController.removeEvent(yyN,"change",o.changeHandler);if(o.splitDate){var mmN=document.getElementById(o.id+'-mm');var ddN=document.getElementById(o.id+'-dd');datePickerController.removeEvent(mmN,"change",o.changeHandler);datePickerController.removeEvent(ddN,"change",o.changeHandler);};o.div.onfocus=o.div.onblur=null;};var ths=o.table.getElementsByTagName("th");for(var i=0,th;th=ths[i];i++){th.onmouseover=th.onmouseout=th.onmousedown=th.onclick=null;};var tds=o.table.getElementsByTagName("td");for(var i=0,td;td=tds[i];i++){td.onmouseover=td.onclick=null;};var butts=o.table.getElementsByTagName("span");for(var i=0,butt;butt=butts[i];i++){butt.onmousedown=butt.onclick=butt.onkeypress=null;};o.ths=o.trs=null;clearTimeout(o.fadeTimer);clearTimeout(o.timer);o.fadeTimer=o.timer=null;/*@cc_on
                @if(@_jscript_version <= 5.6)
                o.iePopUp = null;
                @end
                @*/if(!o.staticPos&&document.getElementById(o.id.replace(/^fd-/,'fd-but-'))){var butt=document.getElementById(o.id.replace(/^fd-/,'fd-but-'));butt.onclick=butt.onpress=null;};if(o.div&&o.div.parentNode){o.div.parentNode.removeChild(o.div);};o.titleBar=o.table=o.div=null;o=null;};o.create();};datePickerController=function(){var datePickers={};var uniqueId=0;var addEvent=function(obj,type,fn){if(obj.attachEvent){obj["e"+type+fn]=fn;obj[type+fn]=function(){obj["e"+type+fn](window.event);};obj.attachEvent("on"+type,obj[type+fn]);}else{obj.addEventListener(type,fn,true);};};var removeEvent=function(obj,type,fn){try{if(obj.detachEvent){obj.detachEvent("on"+type,obj[type+fn]);obj[type+fn]=null;}else{obj.removeEventListener(type,fn,true);};}catch(err){};};var hideAll=function(exception){var dp;for(dp in datePickers){if(!datePickers[dp].created||datePickers[dp].staticPos)continue;if(exception&&exception==datePickers[dp].id){continue;};if(document.getElementById(datePickers[dp].id)){datePickers[dp].hide();};};};var cleanUp=function(){var dp;for(dp in datePickers){if(!document.getElementById(datePickers[dp].id)){if(!datePickers[dp].created)continue;datePickers[dp].destroy();datePickers[dp]=null;delete datePickers[dp];};};};var destroy=function(){for(dp in datePickers){if(!datePickers[dp].created)continue;datePickers[dp].destroy();datePickers[dp]=null;delete datePickers[dp];};datePickers=null;/*@cc_on
                @if(@_jscript_version <= 5.6)
                        if(document.getElementById("iePopUpHack")) {
                                document.body.removeChild(document.getElementById("iePopUpHack"));
                        };
                @end
                @*/datePicker.script=null;removeEvent(window,'load',datePickerController.create);removeEvent(window,'unload',datePickerController.destroy);};var dateFormat=function(dateIn,favourMDY){var dateTest=[{regExp:/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,d:1,m:3,y:5},{regExp:/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,d:3,m:1,y:5},{regExp:/^(\d\d\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,d:5,m:3,y:1}];var start;var cnt=0;while(cnt<3){start=(cnt+(favourMDY?4:3))%3;if(dateIn.match(dateTest[start].regExp)){res=dateIn.match(dateTest[start].regExp);y=res[dateTest[start].y];m=res[dateTest[start].m];d=res[dateTest[start].d];if(m.length==1)m="0"+m;if(d.length==1)d="0"+d;if(y.length!=4)y=(parseInt(y)<50)?'20'+y:'19'+y;return String(y)+m+d;};cnt++;};return 0;};var joinNodeLists=function(){if(!arguments.length){return[];}
var nodeList=[];for(var i=0;i<arguments.length;i++){for(var j=0,item;item=arguments[i][j];j++){nodeList[nodeList.length]=item;};};return nodeList;};var addDatePicker=function(inpId,options){if(!(inpId in datePickers)){datePickers[inpId]=new datePicker(options);};};var getDatePicker=function(inpId){if(!(inpId in datePickers)){throw"No datePicker has been created for the form element with an id of '"+inpId.toString()+"'";};return datePickers[inpId];};var grepRangeLimits=function(sel){var range=[];for(var i=0;i<sel.options.length;i++){if(sel.options[i].value.search(/^\d\d\d\d$/)==-1){continue;};if(!range[0]||Number(sel.options[i].value)<range[0]){range[0]=Number(sel.options[i].value);};if(!range[1]||Number(sel.options[i].value)>range[1]){range[1]=Number(sel.options[i].value);};};return range;};var create=function(inp){if(!(typeof document.createElement!="undefined"&&typeof document.documentElement!="undefined"&&typeof document.documentElement.offsetWidth=="number"))return;var inputs=(inp&&inp.tagName)?[inp]:joinNodeLists(document.getElementsByTagName('input'),document.getElementsByTagName('select'));var regExp1=/disable-days-([1-7]){1,6}/g;var regExp2=/no-transparency/g;var regExp3=/highlight-days-([1-7]){1,7}/g;var regExp4=/range-low-(\d\d\d\d-\d\d-\d\d)/g;var regExp5=/range-high-(\d\d\d\d-\d\d-\d\d)/g;var regExp6=/format-(d-m-y|m-d-y|y-m-d)/g;var regExp7=/divider-(dot|slash|space|dash)/g;var regExp8=/no-locale/g;var regExp9=/no-fade/g;var regExp10=/hide-input/g;for(var i=0,inp;inp=inputs[i];i++){if(inp.className&&(inp.className.search(regExp6)!=-1||inp.className.search(/split-date/)!=-1)&&((inp.tagName.toLowerCase()=="input"&&(inp.type=="text"||inp.type=="hidden"))||inp.tagName.toLowerCase()=="select")){if(inp.id&&document.getElementById('fd-'+inp.id)){continue;};if(!inp.id){inp.id="fdDatePicker-"+uniqueId++;};var options={id:inp.id,low:"",high:"",divider:"/",format:"d-m-y",highlightDays:[0,0,0,0,0,1,1],disableDays:[0,0,0,0,0,0,0],locale:inp.className.search(regExp8)==-1,splitDate:0,noTransparency:inp.className.search(regExp2)!=-1,staticPos:inp.className.search(regExp9)!=-1,hideInput:inp.className.search(regExp10)!=-1};if(!options.staticPos){options.hideInput=false;}else{options.noTransparency=true;};if(inp.className.search(/split-date/)!=-1){if(document.getElementById(inp.id+'-dd')&&document.getElementById(inp.id+'-mm')&&document.getElementById(inp.id+'-dd').tagName.search(/input|select/i)!=-1&&document.getElementById(inp.id+'-mm').tagName.search(/input|select/i)!=-1){options.splitDate=1;};};if(inp.className.search(regExp6)!=-1){options.format=inp.className.match(regExp6)[0].replace('format-','');};if(inp.className.search(regExp7)!=-1){var dividers={dot:".",space:" ",dash:"-",slash:"/"};options.divider=(inp.className.search(regExp7)!=-1&&inp.className.match(regExp7)[0].replace('divider-','')in dividers)?dividers[inp.className.match(regExp7)[0].replace('divider-','')]:"/";};if(inp.className.search(regExp3)!=-1){var tmp=inp.className.match(regExp3)[0].replace(/highlight-days-/,'');options.highlightDays=[0,0,0,0,0,0,0];for(var j=0;j<tmp.length;j++){options.highlightDays[tmp.charAt(j)-1]=1;};};if(inp.className.search(regExp1)!=-1){var tmp=inp.className.match(regExp1)[0].replace(/disable-days-/,'');options.disableDays=[0,0,0,0,0,0,0];for(var j=0;j<tmp.length;j++){options.disableDays[tmp.charAt(j)-1]=1;};};if(inp.className.search(/range-low-today/i)!=-1){options.low=datePickerController.dateFormat((new Date().getMonth()+1)+"/"+new Date().getDate()+"/"+new Date().getFullYear(),true);}else if(inp.className.search(regExp4)!=-1){options.low=datePickerController.dateFormat(inp.className.match(regExp4)[0].replace(/range-low-/,''),false);if(!options.low){options.low='';};};if(inp.className.search(/range-high-today/i)!=-1&&inp.className.search(/range-low-today/i)==-1){options.high=datePickerController.dateFormat((new Date().getMonth()+1)+"/"+new Date().getDate()+"/"+new Date().getFullYear(),true);}else if(inp.className.search(regExp5)!=-1){options.high=datePickerController.dateFormat(inp.className.match(regExp5)[0].replace(/range-high-/,''),false);if(!options.high){options.high='';};};if(inp.tagName.search(/select/i)!=-1){var range=grepRangeLimits(inp);options.low=options.low?range[0]+String(options.low).substr(4,4):datePickerController.dateFormat(range[0]+"/01/01");options.high=options.high?range[1]+String(options.low).substr(4,4):datePickerController.dateFormat(range[1]+"/12/31");};addDatePicker(inp.id,options);};};}
return{addEvent:addEvent,removeEvent:removeEvent,create:create,destroy:destroy,cleanUp:cleanUp,addDatePicker:addDatePicker,getDatePicker:getDatePicker,dateFormat:dateFormat,datePickers:datePickers,hideAll:hideAll};}();})();datePickerController.addEvent(window,'load',datePickerController.create);datePickerController.addEvent(window,'unload',datePickerController.destroy);