
var functionCalled=false;var contacts;var emailImportWindow;function openEmailImport(b){try{emailImportWindow.focus()}catch(a){emailImportWindow=window.open(b,"_blank","width=680,height=350,scrollbars")}}function closeEmailImport(){emailImportWindow=null}function showPlaxoPopup(c,a){if(functionCalled){return}try{showPlaxoABChooser(c,a);tcLink(this,"Plaxo Email Import - Start");functionCalled=true}catch(b){setTimeout("showPlaxoPopup('"+c+"','"+a+"')",100)}}function onABCommComplete(){tcLink(this,"Plaxo Email Import - Finish")}function loadScript(b){var f=document;var a;try{a=f.standardCreateElement("script")}catch(c){}if(typeof(a)!="object"){a=f.createElement("script")}a.type="text/javascript";a.src=b;f.getElementsByTagName("head")[0].appendChild(a)};
function formSubmit(c,b){if(b){for(var a in b){if(b[a]!=null){document.getElementById(a).value=b[a]}}}frm=document.getElementById(c);frm.submit()}function InPlaceEdit_Show(o,l,d,a,g){if(a==null){return}var q="hid_txt_"+a;if(document.getElementById(q)){return}var h=document.getElementById(o);if(h==null){return}var p=h.innerHTML;var n=p;var f=document.getElementById(g);if(f!=null){n=f.innerHTML}var e="";var c=document.getElementById(l);if(c!=null){e=c.innerHTML}if(d!=null){d["#the content#"]=n;for(var b in d){var m=d[b];if(m!=null){e=e.replace(new RegExp(b,"g"),m)}}}e=e.concat('<input type="hidden" id="'+q+'" value="'+escape(p)+'" />');e=e.concat('<input type="hidden" id="hid_inplaceid_'+a+'" value="'+o+'" />');h.innerHTML=e;return}function InPlaceEdit_Cancel(d){if(d==null){return}var a=document.getElementById("hid_txt_"+d);if(a==null){return}var b=document.getElementById("hid_inplaceid_"+d);if(b==null){return}var c=document.getElementById(b.value);if(c==null){return}c.innerHTML=unescape(a.value)}function showElement(c,a){var b=document.getElementById(c);if(a==null){a="block"}b.style.display=a}function showElementInline(c,a){var b=document.getElementById(c);if(a==null){a="inline"}b.style.display=a}function hideElement(b){var a=document.getElementById(b);a.style.display="none"}function clearInput(b){var a=document.getElementById(b);a.value=""}function setInput(c,b){var a=document.getElementById(c);a.value=b}function setInputFocus(b){var a=document.getElementById(b);a.focus()}function addEvtListener(obj,evt,fn,cap){if(obj.addEventListener){obj.addEventListener(evt,fn,cap)}else{if(obj.attachEvent){obj.attachEvent("on"+evt,fn)}else{eval("obj.on"+evt+"="+fn)}}}function trim(a){return a.replace(/^\s*|\s*$/g,"")}function loadPage(a){window.location.href=a}var pubPriHelpWin;function showPubPriHelp(b){try{pubPriHelpWin.focus()}catch(a){pubPriHelpWin=window.open(b,"","top=100,left=200,height=300,width=500,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")}}function pubPriHelpWinClosed(){pubPriHelpWin=null}var itemVotingHelpWin;function showItemVotingHelp(){try{itemVotingHelpWin.focus()}catch(a){itemVotingHelpWin=window.open("/ht/html/itemVotingHelp.html","","top=100,left=200,height=300,width=500,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")}}function itemVotingHelpWinClosed(){itemVotingHelpWin=null}var pagePurposeHelpWin;function pagePurposeHelpWinClosed(){pagePurposeHelpWin=null}var htmlTagsHelpWin;function showHtmlTagsHelp(){try{htmlTagsHelpWin.focus()}catch(a){htmlTagsHelpWin=window.open("/ht/html/htmlTagSupportGuide.html","","top=100,left=200,height=500,width=500,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")}}function htmlTagsHelpWinClosed(){htmlTagsHelpWin=null}function scale_to_fit(b,a){var c=a*1;if(b.classname=="processed"){return}if(b.height>b.width&&b.height>c){b.width=parseInt(b.width*c/b.height);b.classname="processed"}else{if(b.width>=b.height&&b.width>c){b.width=c;b.classname="processed"}else{}}b.style.visibility="visible"}function onLoadForScaling(c,a){var b=document.getElementById(c);if(b==null){return}if(b.height==0&&b.width==0){setTimeout("scale_to_fit(document.getElementById('"+c+"'), "+a+")",500)}else{scale_to_fit(document.getElementById(c),a)}}function findPosX(a){var b=0;if(a.offsetParent){while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}}else{if(a.x){b+=a.x}}return b}function findPosY(b){var a=0;if(b.offsetParent){while(b.offsetParent){a+=b.offsetTop;b=b.offsetParent}}else{if(b.y){a+=b.y}}return a}var _correctPng=true;function correctPNG(){if(navigator.appVersion.indexOf("MSIE")>=0&&_correctPng){var f=navigator.appVersion.split("MSIE");var g=parseFloat(f[1]);if((g>=5.5&&g<7)&&(document.body.filters)){for(var c=0;c<document.images.length;c++){var d=document.images[c];var l=d.src.toUpperCase();if(l.substring(l.length-3,l.length)=="PNG"){var e=(d.id)?"id='"+d.id+"' ":"";var m=(d.className)?"class='"+d.className+"' ":"";var b=(d.title)?"title='"+d.title+"' ":"title='"+d.alt+"' ";var h="display:inline-block;"+d.style.cssText;if(d.align=="left"){h="float:left;"+h}if(d.align=="right"){h="float:right;"+h}if(d.parentElement.href){h="cursor:hand;"+h}var a="<span "+e+m+b+' style="width:'+d.width+"px; height:"+d.height+"px;"+h+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d.src+"', sizingMethod='scale');\"></span>";d.outerHTML=a;c=c-1}}}}}function URLEncode(e){var g="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*'()";var b="0123456789ABCDEF";var f="";for(var c=0;c<e.length;c++){var d=e.charAt(c);if(d==" "){f+="+"}else{if(g.indexOf(d)!=-1){f+=d}else{var a=d.charCodeAt(0);if(a>255){alert("Unicode Character '"+d+"' cannot be encoded using standard URL encoding.\n(URL encoding only supports 8-bit characters.)\nA space (+) will be substituted.");f+="+"}else{f+="%";f+=b.charAt((a>>4)&15);f+=b.charAt(a&15)}}}}return f}function URLDecode(){var a="0123456789ABCDEFabcdef";var e=document.URLForm.F2.value;var d="";var b=0;while(b<e.length){var c=e.charAt(b);if(c=="+"){d+=" ";b++}else{if(c=="%"){if(b<(e.length-2)&&a.indexOf(e.charAt(b+1))!=-1&&a.indexOf(e.charAt(b+2))!=-1){d+=unescape(e.substr(b,3));b+=3}else{alert("Bad escape combination near ..."+e.substr(b));d+="%[ERROR]";b++}}else{d+=c;b++}}}document.URLForm.F1.value=d;return false}function stripTags(a){return a.replace(/<\/?[^>]+>/gi,"")}function escapeHTML(a){var c=document.createElement("div");var b=document.createTextNode(a);c.appendChild(b);return c.innerHTML}function unescapeHTML(b){var a=document.createElement("div");a.innerHTML=stripTags(b);return a.childNodes[0].nodeValue}addEvtListener(window,"load",correctPNG,false);function limitCharacters(c,b){var a=c.value.length;if(a>b){c.value=c.value.substring(0,b)}}function isI18N(b){if(b==null){return false}for(var a=0;a<b.length;a++){if(b.charCodeAt(a)>255){return true}}return false}function addBookmark(a,b){if(window.sidebar){window.sidebar.addPanel(b,a,"")}else{if(document.all){window.external.AddFavorite(a,b)}else{alert("Sorry, your browser doesn't support bookmarks")}}}function validateImageFile(a,b,n,e,h){if(typeof b=="undefined"){b=true}if(typeof h=="undefined"){h="Invalid image. Please upload a file ending with JPG, JPEG, GIF, or PNG."}var m=document.getElementById(a).value;if(m==""){if(b){document.getElementById(e).innerHTML=h;setInputFocus(a)}return(!b)}var f=true;if(navigator.appVersion.indexOf("MSIE")>=0){var g=navigator.appVersion.split("MSIE");var l=parseFloat(g[1]);if(l<7){f=(m.indexOf(":")==1)}}if(!f){document.getElementById(e).innerHTML="Please specify a valid path";setInputFocus(a);return false}if(!(m=="")&&f){var c=m;var o=c.lastIndexOf(".");if(o!=-1){c=c.substr(o+1).toLowerCase()}else{c=""}if((c=="jpeg")||(c=="jpg")||(c=="gif")||(c=="png")){if(typeof n!="undefined"&&n!=null){var d=document.getElementById(n);d.value=m}if(typeof e!="undefined"&&e!=null){document.getElementById(e).innerHTML=""}return true}if(typeof e!="undefined"&&e!=null){document.getElementById(e).innerHTML=h}setInputFocus(a);return false}}function showUserPagesCall(d,c){var b=document.getElementById("myPagesLink");var a=document.getElementById("myPagesDefContainer").innerHTML;showPopupAboveRight(b,300,160,a,true,-35,158,"popUpMyPagesDiv","popUpMyPagesContent");formSubmitAJAX("/za/userPages",null,"showUserPagesCallback")}function showUserPagesCallback(f,d){if(f.firstChild){var c="";for(var e=0;e<f.childNodes.length;e++){c+=f.childNodes[e].nodeValue}var b=document.getElementById("myPagesLink");var a=showAndReturnPopupAboveRight(b,320,400,c,true,-60,374,"popUpMyPagesDiv","popUpMyPagesContent");onMouseMovedPopup(a.popupIndex)}}function getHTTPRequestObject(){var xmlHttpRequest;
/*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (exception1) {
      try {
        xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (exception2) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttpRequest = false;
  @end @*/
if(!xmlHttpRequest&&typeof XMLHttpRequest!="undefined"){try{xmlHttpRequest=new XMLHttpRequest()}catch(exception){xmlHttpRequest=false}}return xmlHttpRequest}var requestsArray=new Array();var MAX_REQUEST_SIZE=5;function processResponse(index){var request=requestsArray[index];if(request.httpRequester.readyState==4){if(request.httpRequester.status==200){try{request.complete=true;var xmlResponse=request.httpRequester.responseXML;var resultStatus=xmlResponse.getElementsByTagName("result")[0].firstChild.nodeValue;if(resultStatus==0){var results=xmlResponse.getElementsByTagName("results")[0];eval(request.callbackMethod)(results,request.callbackParams);try{var trackNodes=xmlResponse.getElementsByTagName("track");if(trackNodes!=null&&trackNodes.length>0){var track=trackNodes[0].firstChild.nodeValue;if(typeof popv!="undefined"&&track!=null&&track.length>0){setTimeout("popv(eval("+track+"))",5)}}var operation=xmlResponse.getElementsByTagName("operation")[0].firstChild.nodeValue;if(typeof tcLink!="undefined"&&operation!=null&&operation!=""){setTimeout("tcLink(true,'"+operation+"')",5)}}catch(trackError){}}else{if(resultStatus==3){if(!request.ignoreError){document.location.href="/za/activity-limited"}else{eval(request.callbackMethod)(null,request.callbackParams)}}else{if(resultStatus==2){if(!request.ignoreError){alert("Oops!  You need to be logged in to do this. The page will refresh after you click ok");document.location.reload()}else{eval(request.callbackMethod)(null,request.callbackParams)}}else{if(!request.ignoreError){alert("Oops! Something went wrong. Error code: CL-1. The page will refresh after you click ok");document.location.reload()}else{eval(request.callbackMethod)(null,request.callbackParams)}}}}}catch(error){if(!request.ignoreError){alert("Oops! Something went wrong. Error code: CL-2. The page will refresh after you click ok");document.location.reload()}else{eval(request.callbackMethod)(null,request.callbackParams)}}}else{if(request.httpRequester.status!=0){if(!request.ignoreError){alert("Oops! Something went wrong. Error code: CL-3. The page will refresh after you click ok");document.location.reload()}else{eval(request.callbackMethod)(null,request.callbackParams)}}}}}function initialize(b){var c=requestsArray[b];if(c.varMap){for(var a in c.varMap){if(c.varMap[a]!=null){if(c.postValueStr==""){c.postValueStr=a+"="+encodeURIComponent(c.varMap[a])}else{c.postValueStr+="&"+a+"="+encodeURIComponent(c.varMap[a])}}}}}function initializeForm(a){var d=requestsArray[a];if(d.formid){var c=document.getElementById(d.formid);for(var b=0;b<c.elements.length;b++){if(d.postValueStr==""){d.postValueStr=c.elements[b].name+"="+encodeURIComponent(c.elements[b].value)}else{d.postValueStr+="&"+c.elements[b].name+"="+encodeURIComponent(c.elements[b].value)}}}}function makeServerCall(a,c){var b=requestsArray[a];if(!c){c="POST"}b.httpRequester.open(c,b.url,b.asyncCall);b.httpRequester.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(b.asyncCall){b.httpRequester.onreadystatechange=new Function("","processResponse("+b.index+");")}b.httpRequester.send(b.postValueStr);if(!b.asyncCall){processResponse(b.index)}}function initRequestObject(f,e,b){var d=null;var c=false;for(var a=0;a<requestsArray.length;a++){if(requestsArray[a].complete==true){d=requestsArray[a];c=true;break}}if(!c){if(requestsArray.length==MAX_REQUEST_SIZE&&b==false){alert("Oops! Something went wrong. Error code: CL04.");return}d=new Object();d.httpRequester=getHTTPRequestObject();d.index=requestsArray.length;requestsArray[d.index]=d}d.complete=false;return d}function abortAJAXCalls(){for(var a=0;a<requestsArray.length;a++){if(requestsArray[a].httpRequester&&!requestsArray[a].complete){requestsArray[a].httpRequester.abort();requestsArray[a].httpRequester.send(null)}}}function htmlFormSubmitAJAX(b,d,c,a,e){request=initRequestObject();request.url=b;request.formid=d;request.callbackMethod=c;request.callbackParams=a;request.postValueStr="";request.ignoreError=(typeof ignoreError=="undefined"||ignoreError==null)?false:ignoreError;request.asyncCall=(typeof asyncCall=="undefined"||ignoreError==null)?true:asyncCall;initializeForm(request.index);makeServerCall(request.index,e)}function formSubmitAJAX(b,f,d,a,g,e,c,h){request=initRequestObject(g,e,c);request.url=b;request.varMap=f;request.callbackMethod=d;request.callbackParams=a;request.postValueStr="";request.ignoreError=(typeof g=="undefined"||g==null)?false:g;request.asyncCall=(typeof e=="undefined"||g==null)?true:e;initialize(request.index);makeServerCall(request.index,h)}var popupArray=new Array();function KaboodlePopup(l,c,n,e,b,h,o,d,m,a,g){this.srcEle=l;if(!a){this.xPosition=calcXCoordinates(l,c,b,m);this.yPosition=calcYCoordinates(l,n,h)}this.width=c;this.height=n;this.nonsticky=e;this.popUpDivId=o;this.popUpContentId=d;this.blanktimeout=0;this.popupIndex=-1;this.center=a;this.mouseOutTime=g;for(var f=0;f<popupArray.length;f++){if(popupArray[f].popUpDivId==o){this.popupIndex=f;break}}if(this.popupIndex==-1){this.popupIndex=popupArray.length;popupArray[popupArray.length]=this}this.populateHtml=function(p){document.getElementById(this.popUpContentId).innerHTML=p};this.showPopup=function(){hideElement(this.popUpDivId);var s=document.getElementById(this.popUpDivId);if(this.nonsticky){s.onmouseout=new Function("","onMouseOutPopup("+this.popupIndex+");");s.onmousemove=new Function("","onMouseMovedPopup("+this.popupIndex+");");this.srcEle.onmouseout=new Function("","onMouseOutPopup("+this.popupIndex+");");this.srcEle.onmousemove=new Function("","onMouseMovedPopup("+this.popupIndex+");")}else{s.onmouseout="";s.onmousemove=""}if(this.center){var r;var q;if(navigator.appVersion.indexOf("MSIE")>=0){if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){r=parseInt(document.documentElement.clientWidth);q=parseInt(document.documentElement.clientHeight)}else{r=parseInt(document.getElementsByTagName("body")[0].clientWidth);q=parseInt(document.getElementsByTagName("body")[0].clientHeight)}q=(q-h)/2}else{r=parseInt(window.innerWidth);q=(parseInt(window.innerHeight)-h)/2}if(r<940){r=180}else{r=(r-b)/2}s.style.position="absolute";s.style.left=r+"px";if(navigator.userAgent.indexOf("Safari")>=0){s.style.top=(q+parseInt(document.body.scrollTop))+"px"}else{s.style.top=(q+parseInt(document.documentElement.scrollTop))+"px"}}else{var p=document.getElementById(this.popUpContentId);if(this.height>0){p.style.height=this.height+"px"}if(this.width>0){p.style.width=this.width+"px";s.style.width=(this.width+9)+"px"}s.style.position="absolute";if(this.yPosition){s.style.top=(this.yPosition)+"px"}if(this.xPosition){s.style.left=(this.xPosition)+"px"}}s.style.display="block"};this.closePopup=function(){hideElement(this.popUpDivId)}}function onMouseMovedPopup(b){var a=popupArray[b];clearTimeout(a.blanktimeout)}function onMouseOutPopup(b){var a=popupArray[b];if(a.mouseOutTime==undefined){a.blanktimeout=setTimeout("hideElement('"+a.popUpDivId+"')",500)}else{a.blanktimeout=setTimeout("hideElement('"+a.popUpDivId+"')",a.mouseOutTime)}a.srcEle.onmouseout="";a.srcEle.onmousemove=""}function calcXCoordinates(c,e,d,b){var a=findPosX(c);if(!b){a+=c.offsetWidth}if(typeof d!="undefined"){a+=d}if(a<0){a=0}return a}function calcYCoordinates(b,a,c){var d;if(a>0){d=findPosY(b)+b.offsetHeight-a}else{d=findPosY(b)+b.offsetHeight}if(typeof c!="undefined"){d+=c}if(d<0){d=0}return d}function showPopupAboveRight(g,c,h,e,d,a,f,l,b){showAndReturnPopupAboveRight(g,c,h,e,d,a,f,l,b)}function showAndReturnPopupAboveRight(l,d,n,f,e,b,h,o,c,a,g){if(typeof o=="undefined"||o==null){o="popUpDiv"}if(typeof c=="undefined"||c==null){c="popUpContent"}hideSelectBoxes();var m=new KaboodlePopup(l,d,n,e,b,h,o,c,false,a,g);m.populateHtml(f);m.showPopup();return m}function showAndReturnPopupAboveLeft(h,c,m,e,d,a,g,n,b,f){if(typeof n=="undefined"||n==null){n="popUpDiv"}if(typeof b=="undefined"||b==null){b="popUpContent"}hideSelectBoxes();var l=new KaboodlePopup(h,c,m,d,a,g,n,b,true,false,f);l.populateHtml(e);l.showPopup();return l}function hideSelectBoxes(){if(navigator.appVersion.indexOf("MSIE")>=0){var d=navigator.appVersion.split("MSIE");var a=parseFloat(d[1]);if(a<7&&document.body.filters){var c=document.getElementsByTagName("SELECT");if(c!=null){for(var b=0;b<c.length;b++){if(c[b]!=null){c[b].style.display="none"}}}}}}function showSelectBoxes(){if(navigator.appVersion.indexOf("MSIE")>=0){var c=navigator.appVersion.split("MSIE");var a=parseFloat(c[1]);if(a<7&&document.body.filters){var b=document.getElementsByTagName("SELECT");if(b!=null){for(k=0;k<b.length;k++){b[k].style.display="block"}}}}}function hidePopupAndShow(b){if(navigator.appVersion.indexOf("MSIE")>=0){var d=navigator.appVersion.split("MSIE");var a=parseFloat(d[1]);if(a<7&&document.body.filters){for(i=0;i<document.forms.length;i++){for(j=0;j<document.forms[i].elements.length;j++){if(document.forms[i].elements[j].options!=null){var c=document.forms[i].elements[j].className;document.forms[i].elements[j].className=c.replace("hidePopup","")}}}}}showSelectBoxes();hideElement(b)}function searchTopNav(b,c){if(!b&&trim(document.getElementById("searchBox").value)==""){alert("Please enter your search query in the search box");return}var a=document.getElementById("searchBox").value;if(a=="Search for Sales"||a=="Search for Products"||a=="Search for Lists"||a=="Search for Styleboards"||a=="Search for People"||a=="Search for Stores"){alert("Please enter your search query in the search box");return}document.getElementById("searchBox").style.fontStyle="normal";if(document.getElementById("section")){document.getElementById("section").value=""}if(document.getElementById("st").value=="group"){document.getElementById("search").action="/groups";document.getElementById("search").submit()}else{if(c&&document.getElementById("st").value=="collage"){document.getElementById("search").action="/styleboards";document.getElementById("search").submit()}else{document.getElementById("search").submit()}}}function callOnEnterKey(event,callBack){if(event.keyCode==13){eval(callBack)}}function getCookie_c(c){var b=document.cookie;var e=c+"=";var d=b.indexOf("; "+e);if(d==-1){d=b.indexOf(e);if(d!=0){return null}}else{d+=2}var a=document.cookie.indexOf(";",d);if(a==-1){a=b.length}return unescape(b.substring(d+e.length,a))}function setCookie_c(b,d,a,f,c,e){document.cookie=b+"="+escape(d)+((a)?"; expires="+a.toGMTString():"")+((f)?"; path="+f:"")+((c)?"; domain="+c:"")+((e)?"; secure":"")}function deleteCookie_c(a,c,b){if(getCookie_c(a)){document.cookie=a+"="+((c)?"; path="+c:"")+((b)?"; domain="+b:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}function checkIfBrowserSupportCookies(){if(document.cookie!=null&&document.cookie!=""){return true}else{setCookie_c("hp","0");if(getCookie_c("hp")){deleteCookie_c("hp");return true}else{return false}}}function clearActionText(){if(document.getElementById("actionDivId")){document.getElementById("actionDivId").style.display="none"}}function generateAJAXResponseHTML(b){var a="";for(var c=0;c<b.length;c++){a+=b[c].nodeValue}return a}var inlineEditTimers=new Array();function editTextMouseOver(a){clearTimeout(inlineEditTimers[a]);document.getElementById("editMOSection_"+a).className="inline-edit-mo"}function editTextMouseOut(a){inlineEditTimers[a]=setTimeout("editTextMouseOutTimerFunc('"+a+"')",500)}function editTextMouseOutTimerFunc(a){document.getElementById("editMOSection_"+a).className=""}function inlineEditStart(a){document.getElementById("editTextbox_"+a).value=document.getElementById("orignalText_"+a).innerHTML;showElement("editSection_"+a,"inline");hideElement("editText_"+a)}function inlineEditAbort(a){hideElement("editSection_"+a);showElement("editText_"+a,"inline");document.getElementById("editMOSection_"+a).className="";document.getElementById("editError_"+a).innerHTML="";hideElement("editError_"+a)
}function inlineEditSubmit(e,b,d,c){d.inlineEditedText=document.getElementById("editTextbox_"+e).value;var a=new Object();a.uniqueID=e;a.inlineEditedText=d.inlineEditedText;a.callbackMethod=c;formSubmitAJAX(b,d,"inlineEditSubmitCallback",a)}function inlineEditSubmitCallback(results,callbackParams){var validationError=results.getElementsByTagName("validationError");if(validationError.length==0){var inlineEditedNode=results.getElementsByTagName("inlineEditedText")[0];var inlineEditedText="";if(inlineEditedNode.firstChild){inlineEditedText=inlineEditedNode.firstChild.nodeValue}document.getElementById("editText_"+callbackParams.uniqueID).innerHTML=inlineEditedText;document.getElementById("orignalText_"+callbackParams.uniqueID).innerHTML=callbackParams.inlineEditedText;inlineEditAbort(callbackParams.uniqueID);if(callbackParams.callbackMethod!=""){eval(callbackParams.callbackMethod)(inlineEditedText)}}else{document.getElementById("editError_"+callbackParams.uniqueID).innerHTML=validationError[0].firstChild.nodeValue;showElement("editError_"+callbackParams.uniqueID)}}var snTimeout=0;var firstRollover=true;var snArray;function snOver(a){if(firstRollover){snTimeout=setTimeout("showSn('"+a+"')",300);firstRollover=false}else{showSn(a);snTimeout=0}}function snOut(){if(snTimeout!=0){clearTimeout(snTimeout);snTimeout=0;firstRollover=true}}function showProfileLinks(){var a=document.getElementById("my-profile");var c=document.getElementById("popNavDiv");var b=document.getElementById("profile-links").innerHTML;showAndReturnPopupAboveLeft(a,-1,-1,b,true,-18,-7,"popNavDiv","popNavContent",0)}function showSearchLinks(){var a=document.getElementById("searchBox");var d=document.getElementById("popNavDiv");var b=document.getElementById("search-links").innerHTML;var c=33;if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1){c=23}showAndReturnPopupAboveLeft(a,150,0,b,true,c,-4,"popNavDiv","popNavContent",0)}function hideSearchLinks(a){document.getElementById("st").value=a;if(searchTextBlur(true)){searchTopNav(true,false)}document.getElementById("popNavDiv").innerHtml="";hideElement("popNavDiv")}function showSn(c){var a=document.getElementById("n"+c);var d=document.getElementById("popNavDiv");if(document.getElementById("sn"+c)){var b=document.getElementById("sn"+c).innerHTML;showAndReturnPopupAboveLeft(a,-1,-1,b,true,0,-5,"popNavDiv","popNavContent",0)}else{var b='<div class="cb-loading loadingSn"></div>';showAndReturnPopupAboveLeft(a,-1,-1,b,true,0,-5,"popNavDiv","popNavContent",0)}}function fbs_click(a,b){window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(a)+"&t="+encodeURIComponent(b),"sharer","toolbar=0,status=0,width=626,height=436")}function msp_click(c,d,b,a){var e="http://www.myspace.com/Modules/PostTo/Pages/?t="+encodeURIComponent(c)+"&c="+encodeURIComponent(d)+"&u="+encodeURIComponent(b)+"&l="+a;window.open(e)}function twit_click(a,b,c){if(c=="slideshow"){var d="http://twitter.com/home?status="+encodeURIComponent("Check out this rockin' slideshow: ")+encodeURIComponent(b)+encodeURIComponent(" at Kaboodle ")+encodeURIComponent(a)}else{var d="http://twitter.com/home?status="+encodeURIComponent("Check out this rockin' list on Kaboodle: ")+encodeURIComponent(b)+encodeURIComponent(" ")+encodeURIComponent(a)}window.open(d)}function validateFormField(e,a,c){if(e!=null&&trim(e)!=""){var d=new Object();d.fieldValue=e;d.fieldType=a;var b=new Object();b.errorId=c;formSubmitAJAX("/za/validate-field",d,"validateFormFieldCallback",b,true)}}function validateFormFieldCallback(d,b){var a=d.getElementsByTagName("fieldError");try{if(a.length>0){var e=a[0].firstChild.nodeValue;document.getElementById(b.errorId).innerHTML=e;document.getElementById(b.errorId).style.display=""}else{document.getElementById(b.errorId).innerHTML="";document.getElementById(b.errorId).style.display="none"}}catch(c){}}function showNFPopuup(d){var c=document.getElementById("NFPopUp_"+d);var b=document.getElementById("NFImg_"+d);var a=calcXCoordinates(b,0,-130);var e=calcYCoordinates(b,0,10);c.style.position="absolute";c.style.top=e+"px";c.style.left=a+"px";c.style.display=""}function closeNFPopuup(a){hideElement("NFPopUp_"+a)}var userMiniProfilePopup;function showMiniProfilePopup(a,c,b){hideMiniProfilePopup();document.getElementById("umppscreenName").innerHTML=c;document.getElementById("umppuserLists").href="/member/"+c+"/lists";document.getElementById("umppuserFriends").href="/member/"+c+"/friends";document.getElementById("umppuserGroups").href="/member/"+c+"/groups";document.getElementById("umppuserPolls").href="/member/"+c+"/polls";document.getElementById("umppuserPhotos").href="/member/"+c+"/photos";document.getElementById("umppuserBrands").href="/member/"+c+"/stores";document.getElementById("umppuserBlogazine").href="/member/"+c+"/blogs";document.getElementById("umppuserStyleboards").href="/member/"+c+"/styleboards";if(document.getElementById("umppminiPopupAddFriendImg")!=null){document.getElementById("umppminiPopupAddFriendImg").href="javascript:checkForFriendAJAX('"+b+"','"+c+"','addFriend');";document.getElementById("umppminiPopupAddFriendLnk").href="javascript:checkForFriendAJAX('"+b+"','"+c+"','addFriend');";document.getElementById("umppcomposeMessagePopupImg").href="javascript:checkForFriendAJAX('"+b+"','"+c+"','sendMessage');";document.getElementById("umppcomposeMessagePopupLnk").href="javascript:checkForFriendAJAX('"+b+"','"+c+"','sendMessage');"}userMiniProfilePopup=new KaboodlePopup(a,141,220,false,-110,170,"umppuserMiniProfilePopup","umppuserMiniProfilePopup",false,false);userMiniProfilePopup.showPopup()}function hideMiniProfilePopup(){document.getElementById("umppscreenName").innerHTML="#";document.getElementById("umppuserLists").href="#";document.getElementById("umppuserFriends").href="#";document.getElementById("umppuserGroups").href="#";document.getElementById("umppuserPolls").href="#";document.getElementById("umppuserPhotos").href="#";document.getElementById("umppuserBrands").href="#";document.getElementById("umppuserBlogazine").href="#";document.getElementById("umppuserStyleboards").href="#";if(document.getElementById("umppminiPopupAddFriendImg")!=null){document.getElementById("umppminiPopupAddFriendImg").href="#";document.getElementById("umppminiPopupAddFriendLnk").innerHTML="Add as a Friend";document.getElementById("umppcomposeMessagePopupLnk").innerHTML="Send Message";document.getElementById("umppminiPopupAddFriendLnk").href="#";document.getElementById("umppcomposeMessagePopupImg").href="#";document.getElementById("umppcomposeMessagePopupLnk").href="#"}if(userMiniProfilePopup!=null){userMiniProfilePopup.closePopup()}}function checkForFriendAJAX(c,e,b){var d=new Object();d.userUid=c;d.action="userFriendCheck";var a=new Object();a.friendUid=c;a.next=b;a.friendScreenName=e;formSubmitAJAX("/za/userProfile",d,"addFriendMiniProfileCallback",a)}function addFriendMiniProfileCallback(d,c){var a=d.getElementsByTagName("isFriend");if(a.length>0){var b=generateAJAXResponseHTML(a[0].childNodes);if(b=="false"){if(c.next=="addFriend"){var e=new Object();e.friendUid=c.friendUid;e.ajax="true";formSubmitAJAX("/za/inviteInSystemFriend",e,"userFriendCallback")}else{if(c.next=="sendMessage"){document.getElementById("umppcomposeMessagePopupLnk").innerHTML="User is not your friend."}}}else{if(c.next=="addFriend"){document.getElementById("umppminiPopupAddFriendLnk").innerHTML="User is already your friend."}else{if(c.next=="sendMessage"){showComposeMessagePopup(null,null,c.friendScreenName)}}}}}function userFriendCallback(b,a){document.getElementById("umppminiPopupAddFriendLnk").innerHTML="Request Pending"}var sendButtonClicked=false;function showComposeMessagePopup(f,d,e,b,c,l){if(!loggedIn){window.location.href="/za/login?p_ret= "+onMsgPageUrl;return}else{if(emailNotVerified){window.location.href="/za/activity-limited?p_ret= "+onMsgPageUrl;return}}var a=new Object();a.action="getPopupView";a.contentTheme=c;if(l!=null&&typeof l!="undefined"){a.currentUrl=l}if(f!=null&&typeof f!="undefined"){a.replyTo=f.to;a.subject=f.subject;a.retailerName=f.retailerName}populateEntityMapInfo(a,d);if(e!=null&&typeof e!="undefined"){a.toSN=e;a.to=e}if(b!=null&&typeof b!="undefined"){a.allowNonFriend=b}var h=new Object();var g=document.getElementById("messageSpinner").innerHTML;showAndReturnPopupAboveRight(null,-1,-1,g,false,850,500,"messagePopup","messagePopupContent",true);formSubmitAJAX("/za/compose-message",a,"getComposeMessageCallback",h)}function getComposeMessageCallback(results,callbackParams){var evalScript=results.getElementsByTagName("evalScript");if(evalScript.length>0){var evalString=generateAJAXResponseHTML(evalScript[0].childNodes);eval(evalString)}var view=results.getElementsByTagName("view");if(view.length>0){var htmlValue=generateAJAXResponseHTML(view[0].childNodes);document.getElementById("messagePopupContent").innerHTML=htmlValue}registerSmartInputListeners()}function hideComposeMessagePopup(){hideSmartInputFloater();document.getElementById("messagePopupContent").innerHTML="";hideElement("messagePopup")}function sendNewMessage(d,b,f,c,l,g,e){var a=new Object();a.action=d;a.subject=document.getElementById("msgSubjectID").value;a.description=document.getElementById("msgDescriptionID").value;if(l!=null&&typeof l!="undefined"){a.currentUrl=l}if(b!=null&&typeof b!="undefined"&&b!=""){a.replyTo=b;a.to=b;if(e!=null&&typeof e!="undefined"&&e!=""){a.retailerName=e}}else{if(document.getElementById("msgToID")){a.to=document.getElementById("msgToID").value}}populateEntityMapInfo(a,f);if(g!=null&&typeof g!="undefined"&&g!=""){a.to=g;a.toSN=g}if(c!=null&&typeof c!="undefined"){a.allowNonFriend=c}var h=new Object();hideElement("msgSendBtns");showElement("msgSendSpinner");if(d!=null&&typeof d!="undefined"&&d=="sendUserMsg"){sendButtonClicked=true}formSubmitAJAX("/za/compose-message",a,"sendNewMessageCallback",h)}function sendNewMessageCallback(d,c){var a=d.getElementsByTagName("view");if(a.length>0){var b=generateAJAXResponseHTML(a[0].childNodes);document.getElementById("messagePopupContent").innerHTML=b}else{hideComposeMessagePopup()}}function populateEntityMapInfo(b,a){if(a!=null&&typeof a!="undefined"){if(typeof a.entityId!="undefined"&&a.entityId!=""){b.entityId=a.entityId}if(typeof a.entityType!="undefined"&&a.entityType!=""){b.entityType=a.entityType}if(typeof a.storeDomain!="undefined"&&a.storeDomain!=""){b.storeDomain=a.storeDomain}if(typeof a.allFans!="undefined"&&a.allFans!=""){b.allFans=a.allFans;if(b.allFans){b.to="All Fans"}}}}function removeDefaultText(a){hideElement("inputTextBox");showElement("inputTextArea");if(document.getElementById("msgToID")){document.getElementById("msgToID").focus()}}function addDefaultTextIfEmpty(b){if(document.getElementById("msgToID")){var a=document.getElementById("msgToID").value;if(a.length==0){hideElement("inputTextArea");showElement("inputTextBox")}}}function closeClicked(){hideElement("showfriendscreen");showElement("sharescreen")}function selectAll(b){var a=document.getElementById("friendsData");var d=a.getElementsByTagName("input");if(d!=null){for(var c=0;c<d.length;c++){if(d[c].type=="checkbox"){d[c].checked=b}}}}function showFriendsScreen(){var b=document.getElementById("msgToID").value;var a=document.getElementById("friendsData");if(a!=null){var d=a.getElementsByTagName("input");if(d!=null){for(var c=0;c<d.length;c++){if(d[c].type=="checkbox"){if(b==""){d[c].checked=false}else{if(b==d[c].value){d[c].checked=true}else{if(b.indexOf(" "+d[c].value+",")!=-1){d[c].checked=true}else{if(b.length>d[c].value.length&&b.substring(0,b.indexOf(","))==d[c].value){d[c].checked=true}else{if(b.substring(b.lastIndexOf(",")+2)==d[c].value){d[c].checked=true}else{d[c].checked=false}}}}}}}}}hideElement("sharescreen");showElement("showfriendscreen")}function doneChoosing(c,b){if(c==document.getElementById("msgToID").value){document.getElementById("msgToID").value=""}if(b==document.getElementById("msgToID").value){document.getElementById("msgToID").value=""}var d=document.getElementById("msgToID").value;var a=document.getElementById("friendsData");var f=a.getElementsByTagName("input");if(d.indexOf(",")!=-1){if(trim(d.substring(d.lastIndexOf(",")+1))==""){d=d.substring(0,d.lastIndexOf(","))}}if(f!=null){for(var e=0;e<f.length;e++){if(f[e].type=="checkbox"){if(!f[e].checked){if(d==""||d==f[e].value){d=""}else{if(d.indexOf(" "+f[e].value+",")!=-1){d=d.replace((" "+f[e].value+","),"")}else{if(d.length>f[e].value.length&&d.substring(0,d.indexOf(","))==f[e].value){d=d.substring(d.indexOf(",")+2)}else{if(d.substring(d.lastIndexOf(",")+2)==f[e].value){d=d.substring(0,d.lastIndexOf(","))}}}}}else{if(d.length==0){d=f[e].value}else{if(d.indexOf(f[e].value)==-1){d+=", "+f[e].value}else{if(f[e].value==d||d.indexOf(",")!=-1&&((d.length>f[e].value.length&&d.substring(0,f[e].value.length+1)==(f[e].value+","))||(d.substring(d.lastIndexOf(",")+2)==f[e].value)||(d.indexOf(", "+f[e].value+",")!=-1))){continue}else{d+=", "+f[e].value}}}}}}document.getElementById("msgToID").value=d;if(d!=""&&document.getElementById("errorToField")!=null){hideElement("errorToField")}}hideElement("showfriendscreen");showElement("sharescreen");if(document.getElementById("msgToID").value.length==0){hideElement("inputTextArea");showElement("inputTextBox")}else{hideElement("inputTextBox");showElement("inputTextArea")}}function getMatch(a,b){var d=document.getElementById("fb_form").action;var c='<img src="http://cn3.kaboodle.com/ht/img/page/spinning.gif?v=r0_56_0_128"/>';if(b=="n"){if(document.getElementById("next-btn")){document.getElementById("next-btn").innerHTML=c}}else{if(document.getElementById("prev-btn")){document.getElementById("prev-btn").innerHTML=c}}d+="&startIndex="+a;document.getElementById("fb_form").action=d;document.location.href=d}function getItem(c,b){var a="";if(typeof b!="undefined"&&(b==true||b=="true")){a+="/store"}a+="/"+document.getElementById("userName").value;a+="/"+document.getElementById("listName").value;if(c!=""){a+="?"+c}window.location.href=a}function getPreviousNextFB(b,c){var a="/"+document.getElementById("userName").value;a+="/"+b;if(c!=""){a+=c}window.location.href=a}function searchTextFocus(a){var c=document.getElementById("st").value;var b="Search for ";if(c=="item"||c=="Items"){b+="Products"}else{if(c=="page"){b+="Lists"}else{if(c=="collage"){b+="Styleboards"}else{if(c=="user"){b+="People"}else{if(c=="deal"){b+="Sales"}else{if(c=="retailer"){b+="Stores"}}}}}}if(document.getElementById("searchBox").value==b){document.getElementById("searchBox").value=""}document.getElementById("searchBox").style.fontStyle="normal";onFocusTopSearchbox(a)}function searchTextBlur(c){var g=document.getElementById("st").value;var h="Search for ";var l="Products";var d="Lists";var e="Styleboards";var f="People";var b="Sales";var a="Stores";var m;if(g=="item"||g=="Items"){m=l}else{if(g=="page"){m=d}else{if(g=="collage"){m=e}else{if(g=="user"){m=f}else{if(g=="deal"){m=b}else{if(g=="retailer"){m=a}}}}}}if((c&&(document.getElementById("searchBox").value==h+l||document.getElementById("searchBox").value==h+d||document.getElementById("searchBox").value==h+e||document.getElementById("searchBox").value==h+b||document.getElementById("searchBox").value==h+a||document.getElementById("searchBox").value==h+f))||document.getElementById("searchBox").value==""||document.getElementById("searchBox").value.length<=0){document.getElementById("searchBox").value=h+m;document.getElementById("searchBox").style.fontStyle="italic";return false}document.getElementById("searchBox").style.fontStyle="normal";return true}function onFocusTopSearchbox(a){if(typeof YAHOO=="undefined"||typeof YAHOO.widget.AutoComplete=="undefined"){var m;var l;var h;var g;var f;var d;var c;try{m=document.standardCreateElement("script");l=document.standardCreateElement("script");h=document.standardCreateElement("script");g=document.standardCreateElement("script");f=document.standardCreateElement("script");d=document.standardCreateElement("script");c=document.standardCreateElement("script")}catch(b){m=document.createElement("script");l=document.createElement("script");h=document.createElement("script");g=document.createElement("script");f=document.createElement("script");d=document.createElement("script");c=document.createElement("script")}m.type="text/javascript";m.src="http://cn2.kaboodle.com/ht/scripts/searchAutoCompleteList.js?v="+a;document.getElementsByTagName("head")[0].appendChild(m);l.type="text/javascript";l.src="http://cn2.kaboodle.com/ht/scripts/yui/yahoo-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(l);h.type="text/javascript";h.src="http://cn2.kaboodle.com/ht/scripts/yui/dom/dom-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(h);g.type="text/javascript";g.src="http://cn2.kaboodle.com/ht/scripts/yui/event/event-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(g);f.type="text/javascript";f.src="http://cn2.kaboodle.com/ht/scripts/yui/animation/animation-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(f);d.type="text/javascript";d.src="http://cn2.kaboodle.com/ht/scripts/yui/datasource/datasource-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(d);c.type="text/javascript";c.src="http://cn2.kaboodle.com/ht/scripts/yui/autocomplete/autocomplete-min.js?v="+a;document.getElementsByTagName("head")[0].appendChild(c)}pollAndLoadSearchAutoComplete()}var topSearchAC=null;function pollAndLoadSearchAutoComplete(){if(typeof YAHOO=="undefined"||typeof YAHOO.widget.AutoComplete=="undefined"){window.setTimeout("pollAndLoadSearchAutoComplete()",200)}else{if(topSearchAC==null){topSearchAC=new YAHOO.widget.AutoComplete("searchBox","topSearchACSection",new YAHOO.util.LocalDataSource(topSearchACOptions));topSearchAC.minQueryLength=0;topSearchAC.allowBrowserAutocomplete=false;topSearchAC.autoHighlight=false;topSearchAC.maxResultsDisplayed=15;topSearchAC.queryMatchContains=true}}}String.prototype.replaceAll=function(c,d){var a=this;var b=a.indexOf(c);while(b!=-1){a=a.replace(c,d);b=a.indexOf(c)}return a};
var ratingObjects=new Array();var ratingsTextArray=["No way","Maybe Ok","Jusk Ok","Liked it","Oh yeah!",];var MAX_RATING=5;function ratingsStarsObj_onmouseover(c,b){var a=ratingObjects[c];a.changeDisplay(b)}function ratingsStarsObj_onclick(c,b){var a=ratingObjects[c];if(!a.showLoginScreen){a.setRateIndex(b);a.showForm()}else{loadPage(a.pageToLoad)}}function ratingsStarsObj_onmouseout(b){var a=ratingObjects[b];a.changeDisplay(a.rating)}function ratingsObj(a,c,j,b,d,i,e,h,g,f,k){this.changeDisplay=function(m){for(var n=MAX_RATING;n>=1;n--){var o;if(n<=m){if(this.starImageColor=="yellow"){o="star_yellow1.gif"}else{if(this.starImageColor=="wishlist"){o="wishlist_rating_full.gif"}else{o="star_orange1.gif"}}}else{if(n<=this.originalRating){if(this.starImageColor=="yellow"){o="star_yellow2.gif"}else{if(this.starImageColor=="wishlist"){o="wishlist_rating_empty.gif"}else{o="star_orange2.gif"}}}else{if(this.starImageColor=="yellow"){o="star_yellow3.gif"}else{if(this.starImageColor=="wishlist"){o="wishlist_rating_empty.gif"}else{o="star_orange3.gif"}}}}var l=document.getElementById("item"+this.index+"_rateImg"+n);l.src="http://cn3.kaboodle.com/ht/img/rate/"+o}};this.setRateIndex=function(l){this.rating=l;this.changeDisplay(this.rating)};this.showForm=function(){if(document.getElementById(this.formElemId)){showElement(this.formElemId)}else{this.submitRating(null,this.index,this.callbackFunction)}};this.revertRating=function(){this.rating=this.originalRating;this.changeDisplay(this.rating);hideElement(this.formElemId)};this.submitRating=function(l,o,n){if(l!=null){l.disabled=true}var p=new Object();p.action="postItemRating";p.pid=this.pid;p.itemId=this.itemId;p[escape("itemRating_"+this.itemId)]=this.rating;p[escape("itemRatingOriginal_"+this.itemId)]=this.originalRating;p[escape("itemRatingId_"+this.itemId)]=this.userRatingId;var m=new Object();m.itemIndex=o;formSubmitAJAX("/za/itemRating",p,n,m)};this.reinitialize=function(l,m){this.originalRating=l;this.rating=l;this.userRatingId=m;this.changeDisplay(this.rating);if(document.getElementById(this.formElemId)){hideElement(this.formElemId)}};this.parentId=c;this.formElemId=j;this.originalRating=b;this.rating=b;this.pid=d;this.itemId=i;this.userRatingId=e;this.index=a;this.rateTextElem=new Object();this.rateElems=new Array();this.showLoginScreen=h;this.pageToLoad=g;this.isPrintVersion=f;this.starImageColor=k;this.callbackFunction=null;ratingObjects[a]=this}function groupRatingsObj(g,c,f,e,b,a,d){this.initialize=function(){var h=document.getElementById(this.parentId);for(var j=0;j<MAX_RATING;j++){var k=document.createElement("img");h.appendChild(k);this.imgElements[this.imgElements.length]=k}this.display()};this.display=function(){var h=document.getElementById(this.parentId);if(this.dontShowBlankStar&&this.totalRating==0){h.style.display="none"}else{h.style.display=""}for(var j=MAX_RATING;j>=1;j--){var k="";if(j<=this.groupRating){if(typeof this.coloredStarImage!="undefined"&&this.coloredStarImage!=null){k=this.coloredStarImage}else{k="http://cn3.kaboodle.com/ht/img/rate/star_blue1.gif?v=r0_56_0_128"}}else{if(typeof this.blankStarImage!="undefined"&&this.blankStarImage!=null){k=this.blankStarImage}else{k="http://cn3.kaboodle.com/ht/img/rate/star_blue2.gif?v=r0_56_0_128"}}this.imgElements[j-1].src=k}};this.reinitialize=function(j,i){this.groupRating=j;this.totalRating=i;if(this.totalRating>0){var h=document.getElementById(this.voteLinkId);if(h){h.innerHTML="after "+this.totalRating+(this.totalRating>1?" ratings":" rating")}}this.display()};this.parentId=g;this.groupRating=f;this.totalRating=e;this.voteLinkId=c;this.blankStarImage=b;this.coloredStarImage=a;this.dontShowBlankStar=(typeof d=="undefined"||d==null)?false:true;this.imgElements=new Array();this.initialize()};
var ratingObjects=new Array();var userLoggedIn=false;var signinupflow=false;function EntityRating(l,j,d,g,f,b,c,m,h,a,e,k){userLoggedIn=c;this.parentId=j;this.originalRating=d;this.rating=d;this.entityId=g;this.entityType=f;this.uniqueId=l;this.callbackFunction=b;this.ratingId=m;this.pid=h;this.blogId=e;this.imageSize=k;this.loadPageForNLI=(a==""?null:a);ratingObjects[l]=this;this.changeDisplay=function(n){if(n==1){var q=document.getElementById("item"+this.uniqueId+"_rateImg1");q.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/like-voted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-1-pressed.gif?v=r0_56_0_128";var p=document.getElementById("item"+this.uniqueId+"_rateImg2");p.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-2.gif?v=r0_56_0_128";var o=document.getElementById("item"+this.uniqueId+"_rateImg3");o.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-3.gif?v=r0_56_0_128"}else{if(n==2){var q=document.getElementById("item"+this.uniqueId+"_rateImg1");q.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-1.gif?v=r0_56_0_128";var p=document.getElementById("item"+this.uniqueId+"_rateImg2");p.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/love-voted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-2-pressed.gif?v=r0_56_0_128";var o=document.getElementById("item"+this.uniqueId+"_rateImg3");o.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-3.gif?v=r0_56_0_128"}else{if(n==3){var q=document.getElementById("item"+this.uniqueId+"_rateImg1");q.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-1.gif?v=r0_56_0_128";var p=document.getElementById("item"+this.uniqueId+"_rateImg2");p.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-2.gif?v=r0_56_0_128";var o=document.getElementById("item"+this.uniqueId+"_rateImg3");o.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/adore-voted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-3-pressed.gif?v=r0_56_0_128"}else{var q=document.getElementById("item"+this.uniqueId+"_rateImg1");q.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-1.gif?v=r0_56_0_128";var p=document.getElementById("item"+this.uniqueId+"_rateImg2");p.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-2.gif?v=r0_56_0_128";var o=document.getElementById("item"+this.uniqueId+"_rateImg3");o.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-3.gif?v=r0_56_0_128"}}}};this.changeDisplayOnMouseOver=function(n){if(n==1){var q=document.getElementById("item"+this.uniqueId+"_rateImg1");q.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/like-hover.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-1-pressed.gif?v=r0_56_0_128"}else{if(n==2){var p=document.getElementById("item"+this.uniqueId+"_rateImg2");p.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/love-hover.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-2-pressed.gif?v=r0_56_0_128"}else{if(n==3){var o=document.getElementById("item"+this.uniqueId+"_rateImg3");o.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/adore-hover.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-3-pressed.gif?v=r0_56_0_128"}}}};this.setRateIndex=function(n){this.rating=n;this.changeDisplay(this.rating)};this.submitRating=function(){var o=new Object();o.entityId=this.entityId;o.entityType=this.entityType;o.userRating=this.rating;o.ratingId=this.ratingId;o.pid=this.pid;o.blogId=this.blogId;o.oldRating=this.originalRating;var n=new Object();n.uniqueId=this.uniqueId;n.callbackFn=this.callbackFn;n.rating=this.rating;n.entityId=o.entityId;formSubmitAJAX("/za/entityRating",o,"entityRatingCB",n)};this.reinitialize=function(n){this.originalRating=n;this.rating=n;this.changeDisplay(this.rating)}}function ratingsObj_onmouseover(c,b){var a=ratingObjects[c];if(a){a.changeDisplayOnMouseOver(b)}}function ratingsObj_onmouseout(c,b){var a=ratingObjects[c];a.changeDisplay(a.rating)}function ratingsObj_onclick(c,b){var a=ratingObjects[c];if(userLoggedIn){a.setRateIndex(b);a.submitRating()}else{if(a.loadPageForNLI!=null){location.href=a.loadPageForNLI}}}function entityRatingCB(results,callbackParams){if(signinupflow){location.reload()}var loginStatus=results.getElementsByTagName("isUserLoggedIn")[0].firstChild.nodeValue;var rObj=ratingObjects[callbackParams.uniqueId];if(loginStatus=="false"||!loginStatus){userLoggedIn=false;rObj.reinitialize(0);rObj.ratingId="";ratingsObj_onclick(callbackParams.uniqueId,callbackParams.rating)}else{var rating=results.getElementsByTagName("rating")[0].firstChild.nodeValue;var totalRating=results.getElementsByTagName("totalRating")[0].firstChild.nodeValue;var totalAggregate=results.getElementsByTagName("totalAggregate")[0].firstChild;if(totalAggregate){totalAggregate=totalAggregate.nodeValue}else{totalAggregate=null}if(results.getElementsByTagName("ratingId")[0].firstChild){rObj.ratingId=results.getElementsByTagName("ratingId")[0].firstChild.nodeValue}rObj.reinitialize(rating);if(document.getElementById("heart_"+callbackParams.uniqueId)){document.getElementById("heart_"+callbackParams.uniqueId).innerHTML=totalRating}if(document.getElementById("bts_heart_"+callbackParams.uniqueId)){document.getElementById("bts_heart_"+callbackParams.uniqueId).innerHTML=totalRating}var ratingText=document.getElementById("ratingText");if(ratingText){ratingText.innerHTML="Thanks!"}if(rObj.callbackFunction){eval(rObj.callbackFunction)(rating,totalRating,totalAggregate,callbackParams.entityId,callbackParams.uniqueId)}}}function initEntityRater(l,j,d,g,f,b,c,m,h,a,e,k){var n=ratingObjects[l];if(!n){new EntityRating(l,j,d,g,f,b,c,m,h,a,e,k)}}function changeNonAjaxDisplay(a,e){if(a==1){var d=document.getElementById("item"+e+"_rateImg1");d.src="http://cn3.kaboodle.com/ht/img/contest/like-voted.gif?v=r0_56_0_128";var c=document.getElementById("item"+e+"_rateImg2");c.src="http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif?v=r0_56_0_128";var b=document.getElementById("item"+e+"_rateImg3");b.src="http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif?v=r0_56_0_128"}else{if(a==2){var d=document.getElementById("item"+e+"_rateImg1");d.src="http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif?v=r0_56_0_128";var c=document.getElementById("item"+e+"_rateImg2");c.src="http://cn3.kaboodle.com/ht/img/contest/love-voted.gif?v=r0_56_0_128";var b=document.getElementById("item"+e+"_rateImg3");b.src="http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif?v=r0_56_0_128"}else{if(a==3){var d=document.getElementById("item"+e+"_rateImg1");d.src="http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif?v=r0_56_0_128";var c=document.getElementById("item"+e+"_rateImg2");c.src="http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif?v=r0_56_0_128";var b=document.getElementById("item"+e+"_rateImg3");b.src="http://cn3.kaboodle.com/ht/img/contest/adore-voted.gif?v=r0_56_0_128"}else{var d=document.getElementById("item"+e+"_rateImg1");d.src="http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif?v=r0_56_0_128";var c=document.getElementById("item"+e+"_rateImg2");c.src="http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif?v=r0_56_0_128";var b=document.getElementById("item"+e+"_rateImg3");b.src="http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif?v=r0_56_0_128"}}}}function changeNonAjaxDisplayOnMouseOver(a,e){if(a==1){var d=document.getElementById("item"+e+"_rateImg1");d.src="http://cn3.kaboodle.com/ht/img/contest/like-hover.gif?v=r0_56_0_128"}else{if(a==2){var c=document.getElementById("item"+e+"_rateImg2");c.src="http://cn3.kaboodle.com/ht/img/contest/love-hover.gif?v=r0_56_0_128"}else{if(a==3){var b=document.getElementById("item"+e+"_rateImg3");b.src="http://cn3.kaboodle.com/ht/img/contest/adore-hover.gif?v=r0_56_0_128"}}}}function rateItem(b,d){changeNonAjaxDisplay(b,d);for(i=1;i<=3;i++){var a=document.getElementById("item"+d+"_rateImg"+i);a.onmouseout=function(){changeNonAjaxDisplay(b,d)}}var c=document.getElementById("userHearts");c.value=b};
function loveImageClick(c,e,b){var d=new Object();d.itemId=e;d.pid=b;var a=new Object();a.itemIndex=c;formSubmitAJAX("/za/loveit",d,"submitLoveItCallback",a)}function submitLoveItCallback(c,b){var a=c.getElementsByTagName("totalPopularityCount")[0].firstChild.nodeValue;var e=document.getElementById("lovedNumber_"+b.itemIndex);var d=document.getElementById("lovedStateSpan_"+b.itemIndex);d.innerHTML="I Love it!";d.className="statusILoveIt";e.innerHTML=a};
function deleteComment(e,b,h,c){var f="delete_"+h;document.getElementById(f).href="javascript:;";var d=h.split("_");var g=new Object();g.commentId=e;g.pid=b;g.action="deleteItemComment";var a=new Object();a.uniqueId=h;a.callbackMethod=c;if(d.length>1){a.itemIndex=d[1]}formSubmitAJAX("/za/comment",g,"submitDeleteCommentCallback",a)}function submitDeleteCommentCallback(results,callbackParams){var commentEle=document.getElementById(callbackParams.uniqueId);commentEle.style.display="none";if(callbackParams.callbackMethod!=""){eval(callbackParams.callbackMethod)((typeof callbackParams.itemIndex!="undefined"&&callbackParams.itemIndex!=null)?callbackParams.itemIndex:"")}}function addComment(l,d,k,i,h,o,j,c,m,b,g){g=g=="undefined"?false:g;document.getElementById("addCommentBtn"+c).disabled=true;if(typeof o=="undefined"){o=false}var a="itemCommentText";if(typeof m!="undefined"){a=m}var f="";if(!b){f=document.getElementById("commentedItemId"+c).value.split("-_-")}var e=new Object();e.pid=l;e.action="postItemComment";e.itemId=f[0];e.itemIndex=f[1];e.comment=document.getElementById(a+c).value;e.deleteCallback=h;e.noProfileLink=o;e.addReload=j;var n=new Object();n.parentEleId=d;n.callbackMethod=k;if(f.length>1){n.itemIndex=f[1]}else{n.itemIndex=""}n.commentTextArea=a;n.fromRatingPopup=g;formSubmitAJAX("/za/comment",e,"submitAddCommentCallback",n)}function submitAddCommentCallback(results,callbackParams){try{document.getElementById("addCommentBtn").disabled=false}catch(e){}try{document.getElementById("addCommentBtn"+callbackParams.itemIndex).disabled=false}catch(e){}var validationError=results.getElementsByTagName("validationError");if(callbackParams.fromRatingPopup&&validationError.length>0){resetPopupDiv();return}var errorMsgEleId="itemCommentError"+((typeof callbackParams.itemIndex!="undefined"&&callbackParams.itemIndex!=null)?callbackParams.itemIndex:"");if(validationError.length>0&&document.getElementById(errorMsgEleId)){document.getElementById(errorMsgEleId).innerHTML=generateAJAXResponseHTML(validationError[0].childNodes);showElement(errorMsgEleId);return}if(validationError.length>0&&document.getElementById("itemCommentError")){document.getElementById("itemCommentError").innerHTML=generateAJAXResponseHTML(validationError[0].childNodes);showElement("itemCommentError");return}if(document.getElementById(errorMsgEleId)){hideElement(errorMsgEleId)}if(document.getElementById("itemCommentError")){hideElement("itemCommentError")}var reload=false;try{reload=results.getElementsByTagName("reload")[0].firstChild.nodeValue}catch(exception){}try{document.getElementById(callbackParams.commentTextArea).value=""}catch(e){}try{document.getElementById(callbackParams.commentTextArea+callbackParams.itemIndex).value=""}catch(e){}if(reload==true||reload=="true"){location.reload()}else{var comments=results.getElementsByTagName("comment");if(comments.length>0){if(document.getElementById(callbackParams.parentEleId)){document.getElementById(callbackParams.parentEleId).innerHTML=document.getElementById(callbackParams.parentEleId).innerHTML+generateAJAXResponseHTML(comments[0].childNodes)}if(callbackParams.callbackMethod!=""){eval(callbackParams.callbackMethod)((typeof callbackParams.itemIndex!="undefined"&&callbackParams.itemIndex!=null)?callbackParams.itemIndex:"")}}else{if(callbackParams.callbackMethod!=""&&callbackParams.callbackMethod=="kpagePopupCommentAdded"){resetPopupDiv()}}}}function kpageCommentAdded(c){var b=document.getElementById("numCommentsID");if(b!=null){var a=parseInt(b.innerHTML)+1;b.innerHTML=a;if(a==1){document.getElementById("commentActionLink").style.display="";document.getElementById("noCommentActionLink").style.display="none"}}try{if(c!=""){var g=document.getElementById("commentCount_"+c);if(g){var d=parseInt(g.innerHTML)+1;g.innerHTML=d;document.getElementById("itemComments"+c).style.display="block"}if(document.getElementById("itemCommentText_"+c)){hideElement("itemCommentText_"+c)}}else{document.getElementById("numPageCommentsId").value=parseInt(document.getElementById("numPageCommentsId").value)+1;showElement("commentViewID")}}catch(f){}}function kpagePopupCommentAdded(a){resetPopupDiv();kpageCommentAdded(a)}function bp_ratingCallback(f,b,i,g,h){var c=document.getElementById("bp_add_cmt_lnk");var a=document.getElementById("slideshowView");if(c){if(a){c.href="javascript:addComment('"+g+"', 'commentParentID', 'kpagePopupCommentAdded', 'true', 'kpageCommentDeleted',false, false, '','commentTextPopup','"+a+"', true);"}else{c.href="javascript:addComment('"+g+"', 'commentParentID', 'kpagePopupCommentAdded', 'true', 'kpageCommentDeleted',false, false, '','commentTextPopup', true);"}}if(document.getElementById("commentTextPopup")){document.getElementById("commentTextPopup").value=""}var d=document.getElementById("addCommentPopupCon");var e=document.getElementById("listrater");if(d){showAndReturnPopupAboveRight(e,450,230,d.innerHTML,false,-350,125);d.innerHTML=""}}function resetPopupDiv(){hideElement("popUpDiv");document.getElementById("addCommentPopupCon").innerHTML=document.getElementById("popUpContent").innerHTML;document.getElementById("popUpContent").innerHTML=""}function kpageCommentDeleted(d){var b=document.getElementById("numCommentsID");if(b!=null){var a=parseInt(b.innerHTML)-1;b.innerHTML=a;if(a==0){document.getElementById("commentActionLink").style.display="none";document.getElementById("noCommentActionLink").style.display=""}}try{if(d!=""){var h=document.getElementById("commentCount_"+d);if(h){var f=parseInt(h.innerHTML)-1;if(f<=0){document.getElementById("itemComments"+d).style.display="none"}h.innerHTML=f}}else{document.getElementById("numPageCommentsId").value=parseInt(document.getElementById("numPageCommentsId").value)-1;var c=document.getElementById("numPageCommentsId").value;if(c<=0){hideElement("commentViewID")}}}catch(g){}}function detailsShoppingPageCommentAdded(){showElement("commentViewID");var c=document.getElementById("numCommentsID");var b=document.getElementById("numCommentsID2");if(c!=null){var a=parseInt(c.innerHTML)+1;c.innerHTML=a;b.innerHTML=a;if(a==1){document.getElementById("commentActionLink").style.display="";document.getElementById("noCommentActionLink").style.display="none";document.getElementById("commentActionLink2").style.display="";document.getElementById("noCommentActionLink2").style.display="none"}}}function detailsShoppingPageCommentDeleted(){var c=document.getElementById("numCommentsID");var b=document.getElementById("numCommentsID2");if(c!=null){var a=parseInt(c.innerHTML)-1;c.innerHTML=a;b.innerHTML=a}if(a==0){document.getElementById("commentActionLink").style.display="none";document.getElementById("noCommentActionLink").style.display="";document.getElementById("commentActionLink2").style.display="none";document.getElementById("noCommentActionLink2").style.display="";hideElement("commentViewID")}}function detailsPageCommentAdded(){showElement("commentViewID");var b=document.getElementById("commentCounterID");if(b!=null){var a=parseInt(b.innerHTML)+1;b.innerHTML=a}}function detailsPageCommentDeleted(){var b=document.getElementById("commentCounterID");if(b!=null){var a=parseInt(b.innerHTML)-1;b.innerHTML=a;if(a==0){hideElement("commentViewID")}}}function fullItemViewCommentAdded(){showElement("commentViewID");var b=document.getElementById("numCommentsID");if(b!=null){var a=parseInt(b.innerHTML)+1;b.innerHTML=a;if(a==1){document.getElementById("commentActionLink").style.display="";document.getElementById("noCommentActionLink").style.display="none"}}}function fullItemViewCommentDeleted(){var b=document.getElementById("numCommentsID");if(b!=null){var a=parseInt(b.innerHTML)-1;b.innerHTML=a}if(a==0){document.getElementById("commentActionLink").style.display="none";document.getElementById("noCommentActionLink").style.display="";hideElement("commentViewID")}};
var HIDE_MY_PAGES=1;var HIDE_MY_WATCHLIST=2;var HIDE_EVERYONES_PAGES=4;var HIDE_NEW_TO_KABOODLE=8;var HIDE_EDIT_PROFILE_WISHLIST=16;var HIDE_WISHLIST_INVITE=32;var HIDE_STICKY_INVITE=64;var HIDE_SCT_PROMO=128;var HIDE_AMAZON_WL=256;var HIDE_CONTEST=1024;var HIDE_BRAND_TOS=2048;var HIDE_OLD_REQUEST=4096;var HIDE_NEXTSTEPS_OVERLAY=8192;function setPreference(f,a,c,e){var d=new Object();d.preferenceMask=f;d.preferenceValue=a;var b=new Object();b.preferenceMask=f;b.preferenceValue=a;b.callbackMethod=c;b.sectionIndex=(e=="undefined"||e==null)?-1:e;formSubmitAJAX("/za/userpreference",d,"setPreferenceCallback",b)}function setPreferenceCallback(results,callbackParams){var preferenceMask=callbackParams.preferenceMask;var preferenceValue=callbackParams.preferenceValue;var domElementID=null;var showLinkID=null;var hideLinkID=null;if(preferenceMask==HIDE_MY_PAGES){domElementID="MyPagesTableID";showLinkID="MyPagesShowLinkID";hideLinkID="MyPagesHideLinkID"}else{if(preferenceMask==HIDE_MY_WATCHLIST){if(callbackParams.sectionIndex==-1){domElementID="WatchedPagesTableID";showLinkID="WatchedPagesShowLinkID";hideLinkID="WatchedPagesHideLinkID"}else{showNextDismissSection(callbackParams);return}}else{if(preferenceMask==HIDE_EVERYONES_PAGES){domElementID="EveryonesPagesTableID";showLinkID="EveryonesPagesShowLinkID";hideLinkID="EveryonesPagesHideLinkID"}else{if(preferenceMask==HIDE_NEW_TO_KABOODLE){if(callbackParams.sectionIndex==-1){domElementID="NewToKaboodleTableID"}else{showNextDismissSection(callbackParams);return}}else{if(preferenceMask==HIDE_EDIT_PROFILE_WISHLIST){document.getElementById("editProfileLinkID").style.display="none";return}else{if(preferenceMask==HIDE_WISHLIST_INVITE){document.getElementById("wishlistInviteLinkID").style.display="none";return}else{if(preferenceMask==HIDE_STICKY_INVITE){document.getElementById("stickyInviteLinkID").style.display="none";return}else{if(preferenceMask==HIDE_SCT_PROMO||preferenceMask==HIDE_AMAZON_WL||preferenceMask==HIDE_CONTEST||preferenceMask==HIDE_BRAND_TOS){showNextDismissSection(callbackParams);return}}}}}}}}var domElement=document.getElementById(domElementID);var showLink=document.getElementById(showLinkID);var hideLink=document.getElementById(hideLinkID);if(preferenceValue){if(domElement){domElement.style.display="none"}if(showLink!=null&&hideLink!=null){showLink.style.display="";hideLink.style.display="none"}}else{if(domElement){domElement.style.display=""}if(showLink!=null&&hideLink!=null){showLink.style.display="none";hideLink.style.display=""}}if(typeof callbackParams.callbackMethod!="undefined"&&callbackParams.callbackMethod!=null){eval(callbackParams.callbackMethod)()}}function showNextDismissSection(a){document.getElementById("dismissSection_"+a.sectionIndex).style.display="none";var c="dismissSection_"+(a.sectionIndex+1);var b=document.getElementById(c);if(b){b.style.display=""}}function showMyChooseTab(a){for(var b=0;b<3;b++){if(b!=a){hideElement("tab"+b+"data");var c=document.getElementById("tab"+b);if(c!=null){c.className=""}}}var c=document.getElementById("tab"+a);c.className="selected";showElement("tab"+a+"data")}function hideNews(){var b=getSDValue("hn");if(!b){setSDValue("hn","1")}hideElement("promoMessageDiv");hideElement("nextPrevDiv");var a=document.getElementById("newsDiv");a.className="news-header-hidden";var c=document.getElementById("hideShowDiv");c.innerHTML="<a href='javascript:showNews();'><img src='http://cn3.kaboodle.com/ht/img/home/khome/icon-maximize-promo-player.gif?v=r0_56_0_128'/></a><a href='javascript:showNews();'>Show</a>"}function showNews(){var b=getSDValue("hn");if(b){clearSDValue("hn")}var a=document.getElementById("newsDiv");a.className="news-header";var c=document.getElementById("hideShowDiv");c.innerHTML="<a href='javascript:hideNews();'><img src='http://cn3.kaboodle.com/ht/img/home/khome/icon-hide-promo-player.gif?v=r0_56_0_128'/></a><a href='javascript:hideNews();'>Hide</a>";showElement("promoMessageDiv");showElement("nextPrevDiv")}function getPromoMessage(b,d){var c=new Object();c.messageId=b;c.action=d;var a=new Object();a.messageId=b;formSubmitAJAX("/za/promoMessageView",c,"promoMessageCB",a,true)}function getFirstPromoMessage(c){var b=new Object();b.action=c;var a=new Object();formSubmitAJAX("/za/promoMessageView",b,"promoMessageCB",a,true)}function promoMessageCB(f,d){var a="";if(f.getElementsByTagName("newUser")[0]){a=f.getElementsByTagName("newUser")[0].firstChild.nodeValue}var c=document.getElementById("news_div");var b="";if(f.firstChild){for(var e=0;e<f.childNodes.length;e++){if(f.childNodes[e]&&f.childNodes[e].nodeValue){b+=f.childNodes[e].nodeValue}}}if(b==""&&a=="true"){if(document.getElementById("knews_link")){showElement("knews_link")}}else{if(document.getElementById("knews_link")){hideElement("knews_link")}}c.innerHTML=b}function getUserStyleboards(){showMyChooseTab(1);var b=new Object();var a=new Object();formSubmitAJAX("/za/userCollages",b,"userStyleboardsCB",a,true)}function userStyleboardsCB(e,b){var d=document.getElementById("userStyleboards");if(e.firstChild){var a="";for(var c=0;c<e.childNodes.length;c++){a+=e.childNodes[c].nodeValue}}d.innerHTML=a}function moreActions(a){location.href=a.value};
function getRelatedPageOrKeywords(a,b,c,e){var d=new Object();d.pid=a;d.num=b;d.message=c;d.viewName=e;formSubmitAJAX("/za/relatedPageOrKeywords",d,"getRelatedPageOrKeywordsCallback",null,true)}function getRelatedPageOrKeywordsCallback(d,b){var e=document.getElementById("relatedPages");e.setAttribute("id","relatedPagesNoSize");if(d!=null){var a="";for(var c=0;c<d.childNodes.length;c++){a+=d.childNodes[c].nodeValue}e.innerHTML=a}else{e.innerHTML=""}}function processEbayImport(c,a){var d=new Object();d.ebaytkn=c;d.ruparams=a;var b=new Object();b.ruparams=a;d.action="processEbayImport";formSubmitAJAX("/za/ebaySuccess",d,"processEbayImportCallback",b,true)}function processEbayImportCallback(b,a){document.location="http://"+document.getElementById("serverName").value+"/za/ebayImport?sessionIdentifier="+b.firstChild.nodeValue+"&ruparams="+a.ruparams}function similarThingsObj(a){this.objKey=a;this.sToId="";this.sToKeywords="";this.sToType="Item";this.maxCount=1;this.restrictToPID="";this.subTheme="";this.nav="";this.ciRe=new similarThingsResultsObj("catalogItems");this.itRe=new similarThingsResultsObj("items");this.pgRe=new similarThingsResultsObj("pages");this.meRe=new similarThingsResultsObj("members");this.fetch=function(b){var d=new Object();if(b==null){b=""}d.similarToId=this.sToId;d.similarToKeywords=this.sToKeywords;d.similarToType=this.sToType;d.fetchCatalogItems=this.itRe.needsFetching()&&(b.search(/catalogitem/i,b)>-1);d.fetchItems=!d.fetchCatalogItems&&this.itRe.needsFetching()&&(b.search(/item/i,b)>-1);d.fetchPages=this.itRe.needsFetching()&&(b.search(/page/i,b)>-1);d.fetchMembers=this.itRe.needsFetching()&&(b.search(/member/i,b)>-1);d.maxCount=this.maxCount;d.restrictToPID=this.restrictToPID;d.subTheme=this.subTheme;d.nav=this.nav;d.cacheSearch=this.cacheSearch;d.action="fetchSimilar";var c=new Object();c.objKey=this.objKey;formSubmitAJAX("/za/fetchSimilar",d,"ajSTCallBack",c,true)};this.callback=function(c,b){this.ciRe.paintResults(c);this.itRe.paintResults(c);this.pgRe.paintResults(c);this.meRe.paintResults(c)};this.isResultType=function(c,b){return b.contains(c)}}function similarThingsResultsObj(a){this.type=a;this.loaded=false;this.resultDiv="";this.needsFetching=function(){return this.loaded==false&&this.resultDiv!=""};this.paintResults=function(d){if(this.needsFetching()){if(d==null){this.clearResultDiv();return}var f=d.getElementsByTagName(this.type+"Result");if(f==null){return}if(f.length<=0){return}var e=document.getElementById(this.resultDiv);if(e==null){return}var b="";for(var c=0;c<f[0].childNodes.length;c++){b+=f[0].childNodes[c].nodeValue}e.innerHTML=b}};this.clearResultDiv=function(){var b=document.getElementById(this.resultDiv);if(b==null){return}b.innerHTML="."}}var ajSTArr=new Array();function initSimilarThings(a){ajSTArr[a]=new similarThingsObj(a);return ajSTArr[a]}function ajSTCallBack(c,a){if(a!=null){var b=ajSTArr[a.objKey];b.callback(c,a)}else{}};
var orignalDesc=null;var originalCom=null;var _g_showResStatus=false;var orderedIndex=new Array();function editDescInline(a){showElement("edt_pgdesc");orignalDesc=document.getElementById("pageDescription").value;setInputFocus("pageDescription")}function cancelEditDesc(){hideElement("edt_pgdesc");document.getElementById("pageDescription").value=orignalDesc;orignalDesc=null}function editComment(a){showElement("edt_"+a);originalCom=document.getElementById("editComment_"+a).value;setInputFocus("editComment_"+a)}function cancelEditComment(a){hideElement("edt_"+a);document.getElementById("editComment_"+a).value=originalCom;originalCom=null}function showPageShare(){showElement("pgShareForm");setInputFocus("emailForm.to")}function cancelPageShare(a){clearInput("emailForm.to");if(document.getElementById("emailForm.toFieldError")){hideElement("emailForm.toFieldError")}if(!a){clearInput("emailForm.fromEmail");if(document.getElementById("emailForm.fromFieldError")){hideElement("emailForm.fromFieldError")}}if(typeof hideSmartInputFloater!="undefined"&&hideSmartInputFloater){hideSmartInputFloater()}hideElement("pgShareForm");document.getElementById("emailForm.userMessage").value=document.getElementById("shareDefEmailMessage").value}function submitRatingCallback(results,callbackParams){var rating=results.getElementsByTagName("rating")[0].firstChild.nodeValue;var userRatingId=results.getElementsByTagName("userRatingId")[0].firstChild.nodeValue;var gtpRating=results.getElementsByTagName("gtpRating")[0].firstChild.nodeValue;var totalRating=results.getElementsByTagName("totalRating")[0].firstChild.nodeValue;eval("itemratingobj_"+callbackParams.itemIndex).reinitialize(rating,userRatingId);eval("itemGroupRatingobj_"+callbackParams.itemIndex).reinitialize(gtpRating,totalRating);document.getElementById("itemRatingSubBtn_"+callbackParams.itemIndex).disabled=false}function submitPriorityCallback(results,callbackParams){var rating=results.getElementsByTagName("rating")[0].firstChild.nodeValue;var userRatingId=results.getElementsByTagName("userRatingId")[0].firstChild.nodeValue;eval("itemratingobj_"+callbackParams.itemIndex).reinitialize(rating,userRatingId);clearActionText()}function onClickAddItemCheckbox(a){if(a.checked){document.getElementById("inviteeRole").value="c"}else{document.getElementById("inviteeRole").value="i"}}function openPrintVersion(a){window.open(a+"&showResStatus="+_g_showResStatus,"_blank","width=800,height=600,scrollbars=yes")}function initPrintVersion(d){var c=function(){return false};var a=document.getElementsByTagName("a");for(var b=4;b<a.length;b++){a[b].onclick=c;a[b].style.cursor="text"}document.getElementById("printPageLink").href="javascript:window.print()";document.getElementById("closeWindowLink").href="javascript:window.close()";if(d){showHideResStat(d)}}function showHiddenComments(a){var b="viewItemCommentSection_"+a;document.getElementById(b).style.display=""}function goToAddComments(a){document.getElementById("commentedItemId").value=a;setInputFocus("itemCommentText")}function validateAndSubmit(e,c,b){if(b&&!validateSectionName()){return}var a=document.getElementsByName("item_image");if(typeof pageType!="undefined"&&pageType=="TRAVEL"){init_scheduleValues(indexGlobalVar,document.getElementById("category").value)}if(a!="undefined"&&a.length>0&&a[a.length-2].checked){var d=trim(document.getElementById("attr_image_value").value);if(d==""){document.getElementById("manualImageError").innerHTML="Please specify an image url."}else{if(d.indexOf(" ")!=-1){document.getElementById("manualImageError").innerHTML="Image url cannot contain spaces."}else{formSubmit(e,c)}}}else{if(a!="undefined"&&a.length>0&&a[a.length-1].checked){var d=trim(document.getElementById("attr_image_value").value);if(d==""){document.getElementById("uploadImageError").innerHTML="Please specify an image url."}else{if((validateImageFile("uploadImageUrl",false,"uploadImageFileName","uploadImageError"))){document.getElementById("uploadImageFileName").value=d;formSubmit(e,c)}}}else{formSubmit(e,c)}}}function hideKPageSelectBoxes(a){var b=document.getElementById("commentedItemId");if(b!=""&&a){b.style.display="none";return}if(b!=""&&!a){b.style.display=""}}function updateWishlistItemQuantity(d,e,b,a,c){if(e<a){document.getElementById(c).style.display="block";return}formSubmit("pg_form",{frm_action:"updateItemQuantity",frm_id:"",frm_objId:d,frm_itemQuantity:e})}function showHideComments(l,h,j,b){var d="hideComments";var g="showComments";var a="itemComments";try{if(l){showElement(d);hideElement(g);if(b>0){showElement("commentViewID");showElement("commentsID","")}}else{hideElement(d);showElement(g);if(b>0){hideElement("commentViewID");hideElement("commentsID","")}}if(j!="GRID"){if(orderedIndex.length!=0){for(var c=0;c<orderedIndex.length;c++){var k=orderedIndex[c];if(document.getElementById(a+k)!=null){l&&parseInt(document.getElementById("commentCount_"+k).innerHTML)>0?showElement(a+k):hideElement(a+k)}}}else{for(var c=0;c<h;c++){if(document.getElementById(a+c)!=null){l&&parseInt(document.getElementById("commentCount_"+c).innerHTML)>0?showElement(a+c):hideElement(a+c)}}}}}catch(f){}}function showSectionFilterView(a,b){var c="";if(b=="GRID"){c="&v=GRID"}if(document.getElementById("sectionToFilter").value!=""){document.location=a+"?section="+document.getElementById("sectionToFilter").value+c}};
function pageRatingSubmitRating(a){var b=new Object();b.action="postPageRating";b.pid=a;formSubmitAJAX("/pg",b,"submitPageRatingCallback")}function submitPageRatingCallback(a){document.getElementById("likedCount").innerHTML=a.getElementsByTagName("likedCount")[0].firstChild.nodeValue;document.getElementById("likedWidget").innerHTML=a.getElementsByTagName("likedWidget")[0].firstChild.nodeValue};
if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(n,b,o,e,j,l,g,f,d,m,k){if(!document.getElementById){return}this.DETECT_KEY=k?k:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(n){this.setAttribute("swf",n)}if(b){this.setAttribute("id",b)}if(o){this.setAttribute("width",o)}if(e){this.setAttribute("height",e)}if(j){this.setAttribute("version",new deconcept.PlayerVersion(j.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(l){this.addParam("bgcolor",l)}var a=f?f:"high";this.addParam("quality",a);this.setAttribute("useExpressInstall",g);this.setAttribute("doExpressInstall",false);var i=(d)?d:window.location;this.setAttribute("xiRedirectUrl",i);this.setAttribute("redirectUrl","");if(m){this.setAttribute("redirectUrl",m)}};deconcept.SWFObject.prototype={setAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addParam:function(b,a){this.params[b]=a},getParams:function(){return this.params},addVariable:function(b,a){this.variables[b]=a},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},getVariablePairs:function(){var c=new Array();var b;var a=this.getVariables();for(b in a){c.push(b+"="+a[b])}return c},getSWFHTML:function(){var b="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn")}b='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'"';b+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var f=this.getParams();for(var e in f){b+=e+'="'+f[e]+'" '}var d=this.getVariablePairs().join("&");if(d.length>0){b+='flashvars="'+d+'"'}b+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX")}b='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'">';b+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var c=this.getParams();for(var e in c){b+='<param name="'+e+'" value="'+c[e]+'" />'}var a=this.getVariablePairs().join("&");if(a.length>0){b+='<param name="flashvars" value="'+a+'" />'}b+="</object>"}return b},write:function(b){if(this.getAttribute("useExpressInstall")){var a=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(a)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var c=(typeof b=="string")?document.getElementById(b):b;c.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var d=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description){d=new deconcept.PlayerVersion(a.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(c){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");d=new deconcept.PlayerVersion([6,0,21]);b.AllowScriptAccess="always"}catch(c){if(d.major==6){return d}}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(c){}}if(b!=null){d=new deconcept.PlayerVersion(b.GetVariable("$version").split(" ")[1].split(","))}}return d};deconcept.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major){return false}if(this.major>a.major){return true}if(this.minor<a.minor){return false}if(this.minor>a.minor){return true}if(this.rev<a.rev){return false}return true};deconcept.util={getRequestParameter:function(a){var d=document.location.search||document.location.hash;if(d){var c=d.substring(1).split("&");for(var b=0;b<c.length;b++){if(c[b].substring(0,c[b].indexOf("="))==a){return c[b].substring((c[b].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var c=document.getElementsByTagName("OBJECT");for(var b=0;b<c.length;b++){c[b].style.display="none";for(var a in c[b]){if(typeof c[b][a]=="function"){c[b][a]=null}}}};if(typeof window.onunload=="function"){var oldunload=window.onunload;window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();oldunload()}}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs}if(Array.prototype.push==null){Array.prototype.push=function(a){this[this.length]=a;return this.length}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
function showAndHideDIVInLeftNAV(b,a){document.getElementById(a).style.display="none";document.getElementById(b).style.display=""}function showDIVInLeftNAV(a){document.getElementById(a).style.display=""}function hideDIVInLeftNAV(a){document.getElementById(a).style.display="none"};
function hideSchedulePopup(){clear_scheduleValues(indexGlobalVar);if(callbackMethod!=""){eval(callbackMethod)(false)}hideElement("schedulePopUpDiv")}function showTripItemPlan(index,callback,yAdjust,xAdjust){var srcEle=document.getElementById("scheduleItem"+index);var width=425;var height=230;var x;if(xAdjust==null){x=200}else{x=calcXCoordinates(srcEle,width,xAdjust)}var y=calcYCoordinates(srcEle,height,yAdjust);var category=document.getElementById("category"+index).value;indexGlobalVar=index;var isCategoryEditable=document.getElementById("isCategoryEditable"+index).value;populateScheduleData(index,category,isCategoryEditable);callbackMethod=callback;if(callback!=""){eval(callback)(true)}showSchedulePopup(srcEle,x,y,width,height)}function showSchedulePopup(d,b,g,e,a){hideElement("schedulePopUpDiv");var f=document.getElementById("schedulePopUpDiv");var c=document.getElementById("schedulePopUpContent");c.style.height=a+"px";c.style.width=e+"px";f.style.width=(e+9)+"px";f.style.top=(g)+"px";f.style.left=(b)+"px";f.style.display="block"}function populateScheduleData(a,b,c){init_scheduleValues(a,b);changeTripDateLabels(b,c)}function init_scheduleValues(j,b){var c=document.getElementById("startDate"+j).value;var i=document.getElementById("startTimeHour"+j).value;var a=document.getElementById("startTimePhase"+j).value;var l=document.getElementById("startTimeMinute"+j).value;var f=document.getElementById("startTimeAMPM"+j).value;var g=document.getElementById("endDate"+j).value;var e=document.getElementById("endTimeHour"+j).value;var k=document.getElementById("endTimePhase"+j).value;var h=document.getElementById("endTimeMinute"+j).value;var d=document.getElementById("endTimeAMPM"+j).value;document.getElementById("fromDate").value=c;document.getElementById("fromTimeHour").value=init_timeHour(a,i);document.getElementById("fromTimeMinute").value=init_timeMinute(l);document.getElementById("fromTimeAMPM").value=init_timeAMPM(f);document.getElementById("toDate").value=g;document.getElementById("toTimeHour").value=init_timeHour(k,e);document.getElementById("toTimeMinute").value=init_timeMinute(h);document.getElementById("toTimeAMPM").value=init_timeAMPM(d)}function clear_scheduleValues(i){var b=document.getElementById("startDate"+i).value;var h=document.getElementById("startTimeHour"+i).value;var a=document.getElementById("startTimePhase"+i).value;var k=document.getElementById("startTimeMinute"+i).value;var e=document.getElementById("startTimeAMPM"+i).value;var f=document.getElementById("endDate"+i).value;var d=document.getElementById("endTimeHour"+i).value;var j=document.getElementById("endTimePhase"+i).value;var g=document.getElementById("endTimeMinute"+i).value;var c=document.getElementById("endTimeAMPM"+i).value;document.getElementById("fromDate").value=b;document.getElementById("fromTimeHour").value=init_timeHour(a,h);document.getElementById("fromTimeMinute").value=init_timeMinute(k);document.getElementById("fromTimeAMPM").value=init_timeAMPM(e);document.getElementById("toDate").value=f;document.getElementById("toTimeHour").value=init_timeHour(j,d);document.getElementById("toTimeMinute").value=init_timeMinute(g);document.getElementById("toTimeAMPM").value=init_timeAMPM(c)}function init_timeHour(b,a){if(b==""&&a==""){return"None"}else{if(b!=""){return b}else{if(a!=""){return a}}}return""}function init_timeMinute(a){if(a!=""){return a}else{return"0"}}function init_timeAMPM(a){if(a=="PM"){return"PM"}else{return"AM"}};
var _dynarch_popupCalendar=null;var timePhases=new Array();var categoryLabelsMap=new Array();var hideCategoryDropDown;var indexGlobalVar;var pageType;var callbackMethod;function selected(b,a){b.sel.value=a;if(b.dateClicked){b.callCloseHandler()}}function closeHandler(a){a.hide();_dynarch_popupCalendar=null}function showCalendar(d,a){var b=document.getElementById(d);if(_dynarch_popupCalendar!=null){_dynarch_popupCalendar.hide()}else{var c=new Calendar(1,null,selected,closeHandler);_dynarch_popupCalendar=c;c.setRange(2001,2070);c.create()}_dynarch_popupCalendar.setDateFormat("%m/%d/%Y");_dynarch_popupCalendar.parseDate(b.value);_dynarch_popupCalendar.sel=b;_dynarch_popupCalendar.showAtElement(document.getElementById(a),"Br")}function scheduleItem(j,o,b,c,k,n,q,i,f,m,d,l,h,p,g){var a=new Object();a.pid=j;a.validateOnly=p;a["itemSchedule.itemId"]=o;a["itemSchedule.category"]=b;a["itemSchedule.startDate"]=c;a["itemSchedule.startTimeHour"]=n;a["itemSchedule.startTimeMinute"]=q;a["itemSchedule.startTimeAMPM"]=i;a["itemSchedule.endDate"]=k;a["itemSchedule.endTimeHour"]=f;a["itemSchedule.endTimeMinute"]=m;a["itemSchedule.endTimeAMPM"]=d;var e=new Object();e.index=l;e.startDate=c;e.endDate=k;e.startTimeHour=n;e.startTimeMinute=q;e.startTimeAMPM=i;e.endTimeHour=f;e.endTimeMinute=m;e.endTimeAMPM=d;e.tripCategory=b;e.refreshView=h;e.isCategoryEditable=g;formSubmitAJAX("/za/tripItem",a,"scheduleItemCallback",e)}function scheduleItemCallback(results,callbackParam){var validationError=results.getElementsByTagName("validationError");if(validationError.length==0){var flag=callbackParam.refreshView;if(flag=="true"){window.location.reload(true)}document.getElementById("schedulePopUpDiv").style.display="none";if(callbackMethod!=""){eval(callbackMethod)(false)}document.getElementById("category"+callbackParam.index).value=callbackParam.tripCategory;document.getElementById("startDate"+callbackParam.index).value=callbackParam.startDate;document.getElementById("startTimeHour"+callbackParam.index).value=callbackParam.startTimeHour;document.getElementById("startTimeMinute"+callbackParam.index).value=callbackParam.startTimeMinute;document.getElementById("startTimePhase"+callbackParam.index).value="";document.getElementById("startTimeAMPM"+callbackParam.index).value=callbackParam.startTimeAMPM;document.getElementById("endDate"+callbackParam.index).value=callbackParam.endDate;document.getElementById("endTimeHour"+callbackParam.index).value=callbackParam.endTimeHour;document.getElementById("endTimePhase"+callbackParam.index).value="";document.getElementById("endTimeMinute"+callbackParam.index).value=callbackParam.endTimeMinute;document.getElementById("endTimeAMPM"+callbackParam.index).value=callbackParam.endTimeAMPM;var itemScheduleText=document.getElementById("itemTripCategory"+callbackParam.index);if(itemScheduleText!=null){itemScheduleText.innerHTML=callbackParam.tripCategory}}else{document.getElementById("itemErrorMessage").innerHTML=validationError[0].firstChild.nodeValue}}function validateAndPostAJAX(g,m,l,h,n){var a=document.getElementById("category").value;var b=document.getElementById("fromDate").value;var k=document.getElementById("fromTimeHour").value;var o=document.getElementById("fromTimeMinute").value;var f=document.getElementById("fromTimeAMPM").value;var i=document.getElementById("toDate").value;var d=document.getElementById("toTimeHour").value;var j=document.getElementById("toTimeMinute").value;var c=document.getElementById("toTimeAMPM").value;var e=document.getElementById("isCategoryEditable"+l).value;scheduleItem(g,m,a,b,i,k,o,f,d,j,c,l,h,n,e)}function changeTripDateLabels(e,f){showSelectedOptionAndClearErrorMessage(e,f);var h=document.getElementById("tripLabel1");var g=document.getElementById("tripLabel2");var d=document.getElementById("tripRow1");var c=document.getElementById("tripRow2");d.style.display="";c.style.display="";var b=categoryLabelsMap[e].label1;var a=categoryLabelsMap[e].label2;if(trim(b)==""){d.style.display="none"}else{h.innerHTML="<b>"+b+"</b>"}if(a==""){c.style.display="none"}else{if(trim(a)==""){c.style.display="none"}else{if(true){g.innerHTML="<b>"+a+"</b>"}}}showHideHourAMPMDropDown("start",document.getElementById("fromTimeHour").value);showHideHourAMPMDropDown("end",document.getElementById("toTimeHour").value)}function showSelectedOptionAndClearErrorMessage(c,e){if(hideCategoryDropDown=="true"||e=="false"){document.getElementById("categoryValue").style.display="";document.getElementById("categoryValue").innerHTML="<b>"+c+"</b>";document.getElementById("category").style.display="none"}else{document.getElementById("categoryValue").style.display="none";document.getElementById("category").style.display=""}var a=document.getElementById("category").options;for(var b=0;b<a.length;b++){if(a[b].value==c){a[b].selected=true}else{a[b].selected=false}}var d=document.getElementById("itemErrorMessage");d.innerHTML=""}function showHideHourAMPMDropDown(d,b){var a=document.getElementById("startHourAMPM");var e=document.getElementById("endHourAMPM");for(var c=0;c<timePhases.length;c++){if(b==timePhases[c]){switch(d){case"start":a.style.display="none";break;case"end":e.style.display="none";break}return}}switch(d){case"start":a.style.display="";break;case"end":e.style.display="";break}return}function showHideScheduleItemLink(g,f,b){hideElement("schedulePopUpDiv");var e=document.getElementById(g);if(f!=""){e.style.display="";document.getElementById("category"+b).value=f;var d=document.getElementById("itemTripCategory"+b);if(d!=null){d.innerHTML=f}var a=document.getElementById("category").options;for(var c=0;c<a.length;c++){if(a[c].value==f){a[c].selected=true}else{a[c].selected=false}}return}e.style.display="none"}function tripItemAJAXAction(b,a,c){var d=document.getElementById("itemId"+indexGlobalVar).value;validateAndPostAJAX(b,d,indexGlobalVar,a,c)};
Calendar=function(d,c,f,a){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=f||null;this.onClose=a||null;this.dragging=false;this.hidden=false;this.minYear=2001;this.maxYear=2050;this.dateFormat=Calendar._TT.DEF_DATE_FORMAT;this.ttDateFormat=Calendar._TT.TT_DATE_FORMAT;this.isPopup=true;this.weekNumbers=false;this.firstDayOfWeek=typeof d=="number"?d:Calendar._FD;this.showsOtherMonths=true;this.dateStr=c;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined"){Calendar._SDN_len=3}var b=new Array();for(var e=8;e>0;){b[--e]=Calendar._DN[e].substr(0,Calendar._SDN_len)}Calendar._SDN=b;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}b=new Array();for(var e=12;e>0;){b[--e]=Calendar._MN[e].substr(0,Calendar._SMN_len)}Calendar._SMN=b}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(e){var a=0,d=0;var c=/^div$/i.test(e.tagName);if(c&&e.scrollLeft){a=e.scrollLeft}if(c&&e.scrollTop){d=e.scrollTop}var f={x:e.offsetLeft-a,y:e.offsetTop-d};if(e.offsetParent){var b=this.getAbsolutePos(e.offsetParent);f.x+=b.x;f.y+=b.y}return f};Calendar.isRelated=function(c,a){var d=a.relatedTarget;if(!d){var b=a.type;if(b=="mouseover"){d=a.fromElement}else{if(b=="mouseout"){d=a.toElement}}}while(d){if(d==c){return true}d=d.parentNode}return false};Calendar.removeClass=function(e,d){if(!(e&&e.className)){return}var a=e.className.split(" ");var b=new Array();for(var c=a.length;c>0;){if(a[--c]!=d){b[b.length]=a[c]}}e.className=b.join(" ")};Calendar.addClass=function(b,a){Calendar.removeClass(b,a);b.className+=" "+a};Calendar.getElement=function(a){var b=Calendar.is_ie?window.event.srcElement:a.currentTarget;while(b.nodeType!=1||/^div$/i.test(b.tagName)){b=b.parentNode}return b};Calendar.getTargetElement=function(a){var b=Calendar.is_ie?window.event.srcElement:a.target;while(b.nodeType!=1){b=b.parentNode}return b};Calendar.stopEvent=function(a){a||(a=window.event);if(Calendar.is_ie){a.cancelBubble=true;a.returnValue=false}else{a.preventDefault();a.stopPropagation()}return false};Calendar.addEvent=function(a,c,b){if(a.attachEvent){a.attachEvent("on"+c,b)}else{if(a.addEventListener){a.addEventListener(c,b,true)}else{a["on"+c]=b}}};Calendar.removeEvent=function(a,c,b){if(a.detachEvent){a.detachEvent("on"+c,b)}else{if(a.removeEventListener){a.removeEventListener(c,b,true)}else{a["on"+c]=null}}};Calendar.createElement=function(c,b){var a=null;if(document.createElementNS){a=document.createElementNS("http://www.w3.org/1999/xhtml",c)}else{a=document.createElement(c)}if(typeof b!="undefined"){b.appendChild(a)}return a};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true)}}};Calendar.findMonth=function(a){if(typeof a.month!="undefined"){return a}else{if(typeof a.parentNode.month!="undefined"){return a.parentNode}}return null};Calendar.findYear=function(a){if(typeof a.year!="undefined"){return a}else{if(typeof a.parentNode.year!="undefined"){return a.parentNode}}return null};Calendar.showMonthsCombo=function(){var e=Calendar._C;if(!e){return false}var e=e;var f=e.activeDiv;var d=e.monthsCombo;if(e.hilitedMonth){Calendar.removeClass(e.hilitedMonth,"hilite")}if(e.activeMonth){Calendar.removeClass(e.activeMonth,"active")}var c=e.monthsCombo.getElementsByTagName("div")[e.date.getMonth()];Calendar.addClass(c,"active");e.activeMonth=c;var b=d.style;b.display="block";if(f.navtype<0){b.left=f.offsetLeft+"px"}else{var a=d.offsetWidth;if(typeof a=="undefined"){a=50}b.left=(f.offsetLeft+f.offsetWidth-a)+"px"}b.top=(f.offsetTop+f.offsetHeight)+"px"};Calendar.showYearsCombo=function(d){var a=Calendar._C;if(!a){return false}var a=a;var c=a.activeDiv;var f=a.yearsCombo;if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}if(a.activeYear){Calendar.removeClass(a.activeYear,"active")}a.activeYear=null;var b=a.date.getFullYear()+(d?1:-1);var j=f.firstChild;var h=false;for(var e=12;e>0;--e){if(b>=a.minYear&&b<=a.maxYear){j.innerHTML=b;j.year=b;j.style.display="block";h=true}else{j.style.display="none"}j=j.nextSibling;b+=d?a.yearStep:-a.yearStep}if(h){var k=f.style;k.display="block";if(c.navtype<0){k.left=c.offsetLeft+"px"}else{var g=f.offsetWidth;if(typeof g=="undefined"){g=50}k.left=(c.offsetLeft+c.offsetWidth-g)+"px"}k.top=(c.offsetTop+c.offsetHeight)+"px"}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false}if(cal.timeout){clearTimeout(cal.timeout)}var el=cal.activeDiv;if(!el){return false}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev)}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev)}};Calendar.tableMouseOver=function(n){var a=Calendar._C;if(!a){return}var c=a.activeDiv;var j=Calendar.getTargetElement(n);if(j==c||j.parentNode==c){Calendar.addClass(c,"hilite active");Calendar.addClass(c.parentNode,"rowhilite")}else{if(typeof c.navtype=="undefined"||(c.navtype!=50&&(c.navtype==0||Math.abs(c.navtype)>2))){Calendar.removeClass(c,"active")}Calendar.removeClass(c,"hilite");Calendar.removeClass(c.parentNode,"rowhilite")}n||(n=window.event);if(c.navtype==50&&j!=c){var m=Calendar.getAbsolutePos(c);var p=c.offsetWidth;var o=n.clientX;var q;var l=true;if(o>m.x+p){q=o-m.x-p;l=false}else{q=m.x-o}if(q<0){q=0}var f=c._range;var h=c._current;var g=Math.floor(q/10)%f.length;for(var e=f.length;--e>=0;){if(f[e]==h){break}}while(g-->0){if(l){if(--e<0){e=f.length-1}}else{if(++e>=f.length){e=0}}}var b=f[e];c.innerHTML=b;a.onUpdateTime()}var d=Calendar.findMonth(j);if(d){if(d.month!=a.date.getMonth()){if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}Calendar.addClass(d,"hilite");a.hilitedMonth=d}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}}}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}var k=Calendar.findYear(j);if(k){if(k.year!=a.date.getFullYear()){if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}Calendar.addClass(k,"hilite");a.hilitedYear=k}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}return Calendar.stopEvent(n)};Calendar.tableMouseDown=function(a){if(Calendar.getTargetElement(a)==Calendar.getElement(a)){return Calendar.stopEvent(a)}};Calendar.calDragIt=function(b){var c=Calendar._C;if(!(c&&c.dragging)){return false}var e;var d;if(Calendar.is_ie){d=window.event.clientY+document.body.scrollTop;e=window.event.clientX+document.body.scrollLeft}else{e=b.pageX;d=b.pageY}c.hideShowCovered();var a=c.element.style;a.left=(e-c.xOffs)+"px";a.top=(d-c.yOffs)+"px";return Calendar.stopEvent(b)};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev)}cal.hideShowCovered()};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300){with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver)}else{addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver)}addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp)}}else{if(cal.isPopup){cal._dragStart(ev)}}if(el.navtype==-1||el.navtype==1){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout("Calendar.showMonthsCombo()",250)}else{if(el.navtype==-2||el.navtype==2){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250)}else{cal.timeout=null}}return Calendar.stopEvent(ev)};Calendar.dayMouseDblClick=function(a){Calendar.cellClick(Calendar.getElement(a),a||window.event);if(Calendar.is_ie){document.selection.empty()}};Calendar.dayMouseOver=function(b){var a=Calendar.getElement(b);if(Calendar.isRelated(a,b)||Calendar._C||a.disabled){return false}if(a.ttip){if(a.ttip.substr(0,1)=="_"){a.ttip=a.caldate.print(a.calendar.ttDateFormat)+a.ttip.substr(1)}a.calendar.tooltips.innerHTML=a.ttip}if(a.navtype!=300){Calendar.addClass(a,"hilite");if(a.caldate){Calendar.addClass(a.parentNode,"rowhilite")}}return Calendar.stopEvent(b)};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite")}if(el.calendar){el.calendar.tooltips.innerHTML=_TT.SEL_DATE}return stopEvent(ev)}};Calendar.cellClick=function(e,o){var c=e.calendar;var h=false;var l=false;var f=null;if(typeof e.navtype=="undefined"){if(c.currentDateEl){Calendar.removeClass(c.currentDateEl,"selected");Calendar.addClass(e,"selected");h=(c.currentDateEl==e);if(!h){c.currentDateEl=e}}c.date.setDateOnly(e.caldate);f=c.date;var b=!(c.dateClicked=!e.otherMonth);if(!b&&!c.currentDateEl){c._toggleMultipleDate(new Date(f))}else{l=!e.disabled}if(b){c._init(c.firstDayOfWeek,f)}}else{if(e.navtype==200){Calendar.removeClass(e,"hilite");c.callCloseHandler();return}f=new Date(c.date);if(e.navtype==0){f.setDateOnly(new Date())}c.dateClicked=false;var n=f.getFullYear();var g=f.getMonth();function a(q){var r=f.getDate();var i=f.getMonthDays(q);if(r>i){f.setDate(i)}f.setMonth(q)}switch(e.navtype){case 400:Calendar.removeClass(e,"hilite");var p=Calendar._TT.ABOUT;if(typeof p!="undefined"){p+=c.showsTime?Calendar._TT.ABOUT_TIME:""}else{p='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\nThank you!\nhttp://dynarch.com/mishoo/calendar.epl\n'}alert(p);return;case -2:if(n>c.minYear){f.setFullYear(n-1)}break;case -1:if(g>0){a(g-1)}else{if(n-->c.minYear){f.setFullYear(n);a(11)}}break;case 1:if(g<11){a(g+1)}else{if(n<c.maxYear){f.setFullYear(n+1);a(0)}}break;case 2:if(n<c.maxYear){f.setFullYear(n+1)}break;case 100:c.setFirstDayOfWeek(e.fdow);return;case 50:var k=e._range;var m=e.innerHTML;for(var j=k.length;--j>=0;){if(k[j]==m){break}}if(o&&o.shiftKey){if(--j<0){j=k.length-1}}else{if(++j>=k.length){j=0}}var d=k[j];e.innerHTML=d;c.onUpdateTime();return;case 0:if((typeof c.getDateStatus=="function")&&c.getDateStatus(f,f.getFullYear(),f.getMonth(),f.getDate())){return false}break}if(!f.equalsTo(c.date)){c.setDate(f);l=true}else{if(e.navtype==0){l=h=true}}}if(l){o&&c.callHandler()}if(h){Calendar.removeClass(e,"hilite");o&&c.callCloseHandler()}};Calendar.prototype.create=function(n){var m=null;if(!n){m=document.getElementsByTagName("body")[0];this.isPopup=true}else{m=n;this.isPopup=false}this.date=this.dateStr?new Date(this.dateStr):new Date();var q=Calendar.createElement("table");this.table=q;q.cellSpacing=0;q.cellPadding=0;q.calendar=this;Calendar.addEvent(q,"mousedown",Calendar.tableMouseDown);var a=Calendar.createElement("div");this.element=a;a.className="calendar";if(this.isPopup){a.style.position="absolute";a.style.zIndex="1000";a.style.display="none"}a.appendChild(q);var k=Calendar.createElement("thead",q);var o=null;var r=null;var b=this;var e=function(s,j,i){o=Calendar.createElement("td",r);o.colSpan=j;o.className="button";if(i!=0&&Math.abs(i)<=2){o.className+=" nav"}Calendar._add_evs(o);o.calendar=b;o.navtype=i;o.innerHTML="<div unselectable='on'>"+s+"</div>";return o};r=Calendar.createElement("tr",k);var c=6;(this.isPopup)&&--c;(this.weekNumbers)&&++c;e("?",1,400).ttip=Calendar._TT.INFO;this.title=e("",c,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT.DRAG_TO_MOVE;this.title.style.cursor="move";e("&#x00d7;",1,200).ttip=Calendar._TT.CLOSE}r=Calendar.createElement("tr",k);r.className="headrow";this._nav_py=e("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT.PREV_YEAR;this._nav_pm=e("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT.PREV_MONTH;this._nav_now=e(Calendar._TT.TODAY,this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT.GO_TODAY;this._nav_nm=e("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT.NEXT_MONTH;this._nav_ny=e("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT.NEXT_YEAR;r=Calendar.createElement("tr",k);r.className="daynames";if(this.weekNumbers){o=Calendar.createElement("td",r);o.className="name wn";o.innerHTML=Calendar._TT.WK}for(var h=7;h>0;--h){o=Calendar.createElement("td",r);if(!h){o.navtype=100;o.calendar=this;Calendar._add_evs(o)}}this.firstdayname=(this.weekNumbers)?r.firstChild.nextSibling:r.firstChild;this._displayWeekdays();var g=Calendar.createElement("tbody",q);this.tbody=g;for(h=6;h>0;--h){r=Calendar.createElement("tr",g);if(this.weekNumbers){o=Calendar.createElement("td",r)}for(var f=7;f>0;--f){o=Calendar.createElement("td",r);o.calendar=this;Calendar._add_evs(o)}}if(this.showsTime){r=Calendar.createElement("tr",g);r.className="time";o=Calendar.createElement("td",r);o.className="time";o.colSpan=2;o.innerHTML=Calendar._TT.TIME||"&nbsp;";o=Calendar.createElement("td",r);o.className="time";o.colSpan=this.weekNumbers?4:3;(function(){function t(C,E,D,F){var A=Calendar.createElement("span",o);A.className=C;A.innerHTML=E;A.calendar=b;A.ttip=Calendar._TT.TIME_PART;A.navtype=50;A._range=[];if(typeof D!="number"){A._range=D}else{for(var B=D;B<=F;++B){var z;if(B<10&&F>=10){z="0"+B}else{z=""+B}A._range[A._range.length]=z}}Calendar._add_evs(A);return A}var x=b.date.getHours();var i=b.date.getMinutes();var y=!b.time24;var j=(x>12);if(y&&j){x-=12}var v=t("hour",x,y?1:0,y?12:23);var u=Calendar.createElement("span",o);u.innerHTML=":";u.className="colon";var s=t("minute",i,0,59);var w=null;o=Calendar.createElement("td",r);o.className="time";o.colSpan=2;if(y){w=t("ampm",j?"pm":"am",["am","pm"])}else{o.innerHTML="&nbsp;"}b.onSetTime=function(){var A,z=this.date.getHours(),B=this.date.getMinutes();if(y){A=(z>=12);if(A){z-=12}if(z==0){z=12}w.innerHTML=A?"pm":"am"}v.innerHTML=(z<10)?("0"+z):z;s.innerHTML=(B<10)?("0"+B):B};b.onUpdateTime=function(){var A=this.date;var B=parseInt(v.innerHTML,10);if(y){if(/pm/i.test(w.innerHTML)&&B<12){B+=12}else{if(/am/i.test(w.innerHTML)&&B==12){B=0}}}var C=A.getDate();var z=A.getMonth();var D=A.getFullYear();A.setHours(B);A.setMinutes(parseInt(s.innerHTML,10));A.setFullYear(D);A.setMonth(z);A.setDate(C);this.dateClicked=false;this.callHandler()}})()}else{this.onSetTime=this.onUpdateTime=function(){}}var l=Calendar.createElement("tfoot",q);r=Calendar.createElement("tr",l);r.className="footrow";o=e(Calendar._TT.SEL_DATE,this.weekNumbers?8:7,300);o.className="ttip";if(this.isPopup){o.ttip=Calendar._TT.DRAG_TO_MOVE;o.style.cursor="move"}this.tooltips=o;a=Calendar.createElement("div",this.element);this.monthsCombo=a;a.className="combo";for(h=0;h<Calendar._MN.length;++h){var d=Calendar.createElement("div");d.className=Calendar.is_ie?"label-IEfix":"label";d.month=h;d.innerHTML=Calendar._SMN[h];a.appendChild(d)}a=Calendar.createElement("div",this.element);this.yearsCombo=a;a.className="combo";for(h=12;h>0;--h){var p=Calendar.createElement("div");p.className=Calendar.is_ie?"label-IEfix":"label";a.appendChild(p)}this._init(this.firstDayOfWeek,this.date);m.appendChild(this.element)};Calendar._keyEvent=function(k){var a=window._dynarch_popupCalendar;if(!a||a.multiple){return false}(Calendar.is_ie)&&(k=window.event);var i=(Calendar.is_ie||k.type=="keypress"),l=k.keyCode;if(k.ctrlKey){switch(l){case 37:i&&Calendar.cellClick(a._nav_pm);break;case 38:i&&Calendar.cellClick(a._nav_py);break;case 39:i&&Calendar.cellClick(a._nav_nm);break;case 40:i&&Calendar.cellClick(a._nav_ny);break;default:return false}}else{switch(l){case 32:Calendar.cellClick(a._nav_now);break;case 27:i&&a.callCloseHandler();break;case 37:case 38:case 39:case 40:if(i){var e,m,j,g,c,d;e=l==37||l==38;d=(l==37||l==39)?1:7;function b(){c=a.currentDateEl;var n=c.pos;m=n&15;j=n>>4;g=a.ar_days[j][m]}b();function f(){var n=new Date(a.date);n.setDate(n.getDate()-d);a.setDate(n)}function h(){var n=new Date(a.date);n.setDate(n.getDate()+d);a.setDate(n)}while(1){switch(l){case 37:if(--m>=0){g=a.ar_days[j][m]}else{m=6;l=38;continue}break;case 38:if(--j>=0){g=a.ar_days[j][m]}else{f();b()}break;case 39:if(++m<7){g=a.ar_days[j][m]}else{m=0;l=40;continue}break;case 40:if(++j<a.ar_days.length){g=a.ar_days[j][m]}else{h();b()}break}break}if(g){if(!g.disabled){Calendar.cellClick(g)}else{if(e){f()}else{h()}}}}break;case 13:if(i){Calendar.cellClick(a.currentDateEl,k)}break;default:return false}}return Calendar.stopEvent(k)};Calendar.prototype._init=function(n,x){var w=new Date(),r=w.getFullYear(),z=w.getMonth(),b=w.getDate();this.table.style.visibility="hidden";var h=x.getFullYear();if(h<this.minYear){h=this.minYear;x.setFullYear(h)}else{if(h>this.maxYear){h=this.maxYear;x.setFullYear(h)}}this.firstDayOfWeek=n;this.date=new Date(x);var y=x.getMonth();var B=x.getDate();var A=x.getMonthDays();x.setDate(1);var s=(x.getDay()-this.firstDayOfWeek)%7;if(s<0){s+=7}x.setDate(-s);x.setDate(x.getDate()+1);var e=this.tbody.firstChild;var l=Calendar._SMN[y];var p=this.ar_days=new Array();var o=Calendar._TT.WEEKEND;var d=this.multiple?(this.datesCells={}):null;for(var u=0;u<6;++u,e=e.nextSibling){var a=e.firstChild;if(this.weekNumbers){a.className="day wn";a.innerHTML=x.getWeekNumber();a=a.nextSibling}e.className="daysrow";var v=false,f,c=p[u]=[];for(var t=0;t<7;++t,a=a.nextSibling,x.setDate(f+1)){f=x.getDate();var g=x.getDay();a.className="day";a.pos=u<<4|t;c[t]=a;var m=(x.getMonth()==y);if(!m){if(this.showsOtherMonths){a.className+=" othermonth";a.otherMonth=true}else{a.className="emptycell";a.innerHTML="&nbsp;";a.disabled=true;continue}}else{a.otherMonth=false;v=true}a.disabled=false;a.innerHTML=this.getDateText?this.getDateText(x,f):f;if(d){d[x.print("%Y%m%d")]=a}if(this.getDateStatus){var q=this.getDateStatus(x,h,y,f);if(this.getDateToolTip){var k=this.getDateToolTip(x,h,y,f);if(k){a.title=k}}if(q===true){a.className+=" disabled";a.disabled=true}else{if(/disabled/i.test(q)){a.disabled=true}a.className+=" "+q}}if(!a.disabled){a.caldate=new Date(x);a.ttip="_";if(!this.multiple&&m&&f==B&&this.hiliteToday){a.className+=" selected";this.currentDateEl=a}if(x.getFullYear()==r&&x.getMonth()==z&&f==b){a.className+=" today";a.ttip+=Calendar._TT.PART_TODAY}if(o.indexOf(g.toString())!=-1){a.className+=a.otherMonth?" oweekend":" weekend"}}}if(!(v||this.showsOtherMonths)){e.className="emptyrow"}}this.title.innerHTML=Calendar._MN[y]+", "+h;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates()};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var b in this.multiple){var a=this.datesCells[b];
var c=this.multiple[b];if(!c){continue}if(a){a.className+=" selected"}}}};Calendar.prototype._toggleMultipleDate=function(b){if(this.multiple){var c=b.print("%Y%m%d");var a=this.datesCells[c];if(a){var e=this.multiple[c];if(!e){Calendar.addClass(a,"selected");this.multiple[c]=b}else{Calendar.removeClass(a,"selected");delete this.multiple[c]}}}};Calendar.prototype.setDateToolTipHandler=function(a){this.getDateToolTip=a};Calendar.prototype.setDate=function(a){if(!a.equalsTo(this.date)){this._init(this.firstDayOfWeek,a)}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date)};Calendar.prototype.setFirstDayOfWeek=function(a){this._init(a,this.date);this._displayWeekdays()};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(a){this.getDateStatus=a};Calendar.prototype.setRange=function(b,c){this.minYear=b;this.maxYear=c};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat))}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this)}this.hideShowCovered()};Calendar.prototype.destroy=function(){var a=this.element.parentNode;a.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null};Calendar.prototype.reparent=function(b){var a=this.element;a.parentNode.removeChild(a);b.appendChild(a)};Calendar._checkCalendar=function(b){var c=window._dynarch_popupCalendar;if(!c){return false}var a=Calendar.is_ie?Calendar.getElement(b):Calendar.getTargetElement(b);for(;a!=null&&a!=c.element;a=a.parentNode){}if(a==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(b)}};Calendar.prototype.show=function(){var e=this.table.getElementsByTagName("tr");for(var d=e.length;d>0;){var f=e[--d];Calendar.removeClass(f,"rowhilite");var c=f.getElementsByTagName("td");for(var b=c.length;b>0;){var a=c[--b];Calendar.removeClass(a,"hilite");Calendar.removeClass(a,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar)}this.hideShowCovered()};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar)}this.element.style.display="none";this.hidden=true;this.hideShowCovered()};Calendar.prototype.showAt=function(a,c){var b=this.element.style;b.left=a+"px";b.top=c+"px";this.show()};Calendar.prototype.showAtElement=function(c,d){var a=this;var e=Calendar.getAbsolutePos(c);if(!d||typeof d!="string"){this.showAt(e.x,e.y+c.offsetHeight);return true}function b(i){if(i.x<0){i.x=0}if(i.y<0){i.y=0}var j=document.createElement("div");var h=j.style;h.position="absolute";h.right=h.bottom=h.width=h.height="0px";document.body.appendChild(j);var g=Calendar.getAbsolutePos(j);document.body.removeChild(j);if(Calendar.is_ie){g.y+=document.body.scrollTop;g.x+=document.body.scrollLeft}else{g.y+=window.scrollY;g.x+=window.scrollX}var f=i.x+i.width-g.x;if(f>0){i.x-=f}f=i.y+i.height-g.y;if(f>0){i.y-=f}}this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var f=a.element.offsetWidth;var i=a.element.offsetHeight;a.element.style.display="none";var g=d.substr(0,1);var j="l";if(d.length>1){j=d.substr(1,1)}switch(g){case"T":e.y-=i;break;case"B":e.y+=c.offsetHeight;break;case"C":e.y+=(c.offsetHeight-i)/2;break;case"t":e.y+=c.offsetHeight-i;break;case"b":break}switch(j){case"L":e.x-=f;break;case"R":e.x+=c.offsetWidth;break;case"C":e.x+=(c.offsetWidth-f)/2;break;case"l":e.x+=c.offsetWidth-f;break;case"r":break}e.width=f;e.height=i+40;a.monthsCombo.style.display="none";a.showAt(e.x,e.y)};if(Calendar.is_khtml){setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10)}else{Calendar.continuation_for_the_fucking_khtml_browser()}};Calendar.prototype.setDateFormat=function(a){this.dateFormat=a};Calendar.prototype.setTtDateFormat=function(a){this.ttDateFormat=a};Calendar.prototype.parseDate=function(b,a){if(!a){a=this.dateFormat}this.setDate(Date.parseDate(b,a))};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera){return}function b(k){var i=k.style.visibility;if(!i){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml){i=document.defaultView.getComputedStyle(k,"").getPropertyValue("visibility")}else{i=""}}else{if(k.currentStyle){i=k.currentStyle.visibility}else{i=""}}}return i}var s=new Array("applet","iframe","select");var c=this.element;var a=Calendar.getAbsolutePos(c);var f=a.x;var d=c.offsetWidth+f;var r=a.y;var q=c.offsetHeight+r;for(var h=s.length;h>0;){var g=document.getElementsByTagName(s[--h]);var e=null;for(var l=g.length;l>0;){e=g[--l];a=Calendar.getAbsolutePos(e);var o=a.x;var n=e.offsetWidth+o;var m=a.y;var j=e.offsetHeight+m;if(this.hidden||(o>d)||(n<f)||(m>q)||(j<r)){if(!e.__msh_save_visibility){e.__msh_save_visibility=b(e)}e.style.visibility=e.__msh_save_visibility}else{if(!e.__msh_save_visibility){e.__msh_save_visibility=b(e)}e.style.visibility="hidden"}}}};Calendar.prototype._displayWeekdays=function(){var b=this.firstDayOfWeek;var a=this.firstdayname;var d=Calendar._TT.WEEKEND;for(var c=0;c<7;++c){a.className="day name";var e=(c+b)%7;if(c){a.ttip=Calendar._TT.DAY_FIRST.replace("%s",Calendar._DN[e]);a.navtype=100;a.calendar=this;a.fdow=e;Calendar._add_evs(a)}if(d.indexOf(e.toString())!=-1){Calendar.addClass(a,"weekend")}a.innerHTML=Calendar._SDN[(c+b)%7];a=a.nextSibling}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none"};Calendar.prototype._dragStart=function(ev){if(this.dragging){return}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd)}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(l,c){var n=new Date();var o=0;var e=-1;var k=0;var q=l.split(/\W+/);var p=c.match(/%./g);var h=0,g=0;var r=0;var f=0;for(h=0;h<q.length;++h){if(!q[h]){continue}switch(p[h]){case"%d":case"%e":k=parseInt(q[h],10);break;case"%m":e=parseInt(q[h],10)-1;break;case"%Y":case"%y":o=parseInt(q[h],10);(o<100)&&(o+=(o>29)?1900:2000);break;case"%b":case"%B":for(g=0;g<12;++g){if(Calendar._MN[g].substr(0,q[h].length).toLowerCase()==q[h].toLowerCase()){e=g;break}}break;case"%H":case"%I":case"%k":case"%l":r=parseInt(q[h],10);break;case"%P":case"%p":if(/pm/i.test(q[h])&&r<12){r+=12}else{if(/am/i.test(q[h])&&r>=12){r-=12}}break;case"%M":f=parseInt(q[h],10);break}}if(isNaN(o)){o=n.getFullYear()}if(isNaN(e)){e=n.getMonth()}if(isNaN(k)){k=n.getDate()}if(isNaN(r)){r=n.getHours()}if(isNaN(f)){f=n.getMinutes()}if(o!=0&&e!=-1&&k!=0){return new Date(o,e,k,r,f,0)}o=0;e=-1;k=0;for(h=0;h<q.length;++h){if(q[h].search(/[a-zA-Z]+/)!=-1){var s=-1;for(g=0;g<12;++g){if(Calendar._MN[g].substr(0,q[h].length).toLowerCase()==q[h].toLowerCase()){s=g;break}}if(s!=-1){if(e!=-1){k=e+1}e=s}}else{if(parseInt(q[h],10)<=12&&e==-1){e=q[h]-1}else{if(parseInt(q[h],10)>31&&o==0){o=parseInt(q[h],10);(o<100)&&(o+=(o>29)?1900:2000)}else{if(k==0){k=q[h]}}}}}if(o==0){o=n.getFullYear()}if(e!=-1&&k!=0){return new Date(o,e,k,r,f,0)}return n};Date.prototype.getMonthDays=function(b){var a=this.getFullYear();if(typeof b=="undefined"){b=this.getMonth()}if(((0==(a%4))&&((0!=(a%100))||(0==(a%400))))&&b==1){return 29}else{return Date._MD[b]}};Date.prototype.getDayOfYear=function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var c=new Date(this.getFullYear(),0,0,0,0,0);var b=a-c;return Math.floor(b/Date.DAY)};Date.prototype.getWeekNumber=function(){var c=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var b=c.getDay();c.setDate(c.getDate()-(b+6)%7+3);var a=c.valueOf();c.setMonth(0);c.setDate(4);return Math.round((a-c.valueOf())/(7*86400000))+1};Date.prototype.equalsTo=function(a){return((this.getFullYear()==a.getFullYear())&&(this.getMonth()==a.getMonth())&&(this.getDate()==a.getDate())&&(this.getHours()==a.getHours())&&(this.getMinutes()==a.getMinutes()))};Date.prototype.setDateOnly=function(a){var b=new Date(a);this.setDate(1);this.setFullYear(b.getFullYear());this.setMonth(b.getMonth());this.setDate(b.getDate())};Date.prototype.print=function(l){var b=this.getMonth();var k=this.getDate();var n=this.getFullYear();var p=this.getWeekNumber();var q=this.getDay();var v={};var r=this.getHours();var c=(r>=12);var h=(c)?(r-12):r;var u=this.getDayOfYear();if(h==0){h=12}var e=this.getMinutes();var j=this.getSeconds();v["%a"]=Calendar._SDN[q];v["%A"]=Calendar._DN[q];v["%b"]=Calendar._SMN[b];v["%B"]=Calendar._MN[b];v["%C"]=1+Math.floor(n/100);v["%d"]=(k<10)?("0"+k):k;v["%e"]=k;v["%H"]=(r<10)?("0"+r):r;v["%I"]=(h<10)?("0"+h):h;v["%j"]=(u<100)?((u<10)?("00"+u):("0"+u)):u;v["%k"]=r;v["%l"]=h;v["%m"]=(b<9)?("0"+(1+b)):(1+b);v["%M"]=(e<10)?("0"+e):e;v["%n"]="\n";v["%p"]=c?"PM":"AM";v["%P"]=c?"pm":"am";v["%s"]=Math.floor(this.getTime()/1000);v["%S"]=(j<10)?("0"+j):j;v["%t"]="\t";v["%U"]=v["%W"]=v["%V"]=(p<10)?("0"+p):p;v["%u"]=q+1;v["%w"]=q;v["%y"]=(""+n).substr(2,2);v["%Y"]=n;v["%%"]="%";var t=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml){return l.replace(t,function(a){return v[a]||a})}var o=l.match(t);for(var g=0;g<o.length;g++){var f=v[o[g]];if(f){t=new RegExp(o[g],"g");l=l.replace(t,f)}}return l};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(b){var a=new Date(this);a.__msh_oldSetFullYear(b);if(a.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(b)};window._dynarch_popupCalendar=null;
Calendar.setup=function(g){function f(h,i){if(typeof g[h]=="undefined"){g[h]=i}}f("inputField",null);f("displayArea",null);f("button",null);f("eventName","click");f("ifFormat","%d %b %Y %H:%M");f("daFormat","%d %b %Y %H:%M");f("singleClick",true);f("disableFunc",null);f("dateStatusFunc",g.disableFunc);f("dateText",null);f("firstDay",null);f("align","Br");f("range",[2001,2070]);f("weekNumbers",true);f("flat",null);f("flatCallback",null);f("onSelect",null);f("onClose",null);f("onUpdate",null);f("date",null);f("showsTime",false);f("timeFormat","24");f("electric",true);f("step",2);f("position",null);f("cache",false);f("showOthers",false);f("multiple",null);var c=["inputField","displayArea","button"];for(var b in c){if(typeof g[c[b]]=="string"){g[c[b]]=document.getElementById(g[c[b]])}}if(!(g.flat||g.multiple||g.inputField||g.displayArea||g.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false}function a(i){var h=i.params;var j=(i.dateClicked||h.electric);if(j&&h.inputField){h.inputField.value=i.date.print(h.ifFormat);if(typeof h.inputField.onchange=="function"){h.inputField.onchange()}}if(j&&h.displayArea){h.displayArea.innerHTML=i.date.print(h.daFormat)}if(j&&typeof h.onUpdate=="function"){h.onUpdate(i)}if(j&&h.flat){if(typeof h.flatCallback=="function"){h.flatCallback(i)}}if(j&&h.singleClick&&i.dateClicked){i.callCloseHandler()}}if(g.flat!=null){if(typeof g.flat=="string"){g.flat=document.getElementById(g.flat)}if(!g.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false}var e=new Calendar(g.firstDay,g.date,g.onSelect||a);e.showsOtherMonths=g.showOthers;e.showsTime=g.showsTime;e.time24=(g.timeFormat=="24");e.params=g;e.weekNumbers=g.weekNumbers;e.setRange(g.range[0],g.range[1]);e.setDateStatusHandler(g.dateStatusFunc);e.getDateText=g.dateText;if(g.ifFormat){e.setDateFormat(g.ifFormat)}if(g.inputField&&typeof g.inputField.value=="string"){e.parseDate(g.inputField.value)}e.create(g.flat);e.show();return false}var d=g.button||g.displayArea||g.inputField;d["on"+g.eventName]=function(){var h=g.inputField||g.displayArea;var k=g.inputField?g.ifFormat:g.daFormat;var o=false;var m=window.calendar;if(h){g.date=Date.parseDate(h.value||h.innerHTML,k)}if(!(m&&g.cache)){window.calendar=m=new Calendar(g.firstDay,g.date,g.onSelect||a,g.onClose||function(i){i.hide()});m.showsTime=g.showsTime;m.time24=(g.timeFormat=="24");m.weekNumbers=g.weekNumbers;o=true}else{if(g.date){m.setDate(g.date)}m.hide()}if(g.multiple){m.multiple={};for(var j=g.multiple.length;--j>=0;){var n=g.multiple[j];var l=n.print("%Y%m%d");m.multiple[l]=n}}m.showsOtherMonths=g.showOthers;m.yearStep=g.step;m.setRange(g.range[0],g.range[1]);m.params=g;m.setDateStatusHandler(g.dateStatusFunc);m.getDateText=g.dateText;m.setDateFormat(k);if(o){m.create()}m.refresh();if(!g.position){m.showAtElement(g.button||g.displayArea||g.inputField,g.align)}else{m.showAt(g.position[0],g.position[1])}return false};return e};
Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Calendar._FD=0;Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Calendar._TT={};Calendar._TT.INFO="About the calendar";Calendar._TT.ABOUT="DHTML Date/Time Selector\n(c) dynarch.com 2002-2005 / Author: Mihai Bazon\nFor latest version visit: http://www.dynarch.com/projects/calendar/\nDistributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details.\n\nDate selection:\n- Use the \xab, \xbb buttons to select year\n- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select month\n- Hold mouse button on any of the above buttons for faster selection.";Calendar._TT.ABOUT_TIME="\n\nTime selection:\n- Click on any of the time parts to increase it\n- or Shift-click to decrease it\n- or click and drag for faster selection.";Calendar._TT.PREV_YEAR="Prev. year (hold for menu)";Calendar._TT.PREV_MONTH="Prev. month (hold for menu)";Calendar._TT.GO_TODAY="Go Today";Calendar._TT.NEXT_MONTH="Next month (hold for menu)";Calendar._TT.NEXT_YEAR="Next year (hold for menu)";Calendar._TT.SEL_DATE="Select date";Calendar._TT.DRAG_TO_MOVE="Drag to move";Calendar._TT.PART_TODAY=" (today)";Calendar._TT.DAY_FIRST="Display %s first";Calendar._TT.WEEKEND="0,6";Calendar._TT.CLOSE="Close";Calendar._TT.TODAY="Today";Calendar._TT.TIME_PART="(Shift-)Click or drag to change value";Calendar._TT.DEF_DATE_FORMAT="%Y-%m-%d";Calendar._TT.TT_DATE_FORMAT="%a, %b %e";Calendar._TT.WK="wk";Calendar._TT.TIME="Time:";
var collection=new Array();var isCommaDelimiter=true;function freezeEvent(b){if(b.preventDefault){b.preventDefault()}b.returnValue=false;b.cancelBubble=true;if(b.stopPropagation){b.stopPropagation()}return false}function isWithinNode(g,d,h,b,f){answer=false;te=g;while(te&&!answer){if((te.id&&(te.id==d))||(te.className&&(te.className==d+"Class"))||(!b&&h&&te.className&&(te.className==h))||(!b&&h&&te.className&&(te.className.indexOf(h)!=-1))||(b&&te.tagName&&(te.tagName.toLowerCase()==b))||(f&&(te==f))){answer=te}else{te=te.parentNode}}return te}function getEvent(b){return(b?b:window.event)}function getEventElement(b){return(b.srcElement?b.srcElement:(b.target?b.target:b.currentTarget))}function findElementPosX(b){curleft=0;if(b.offsetParent){while(b.offsetParent){curleft+=b.offsetLeft;b=b.offsetParent}}else{if(b.x){curleft+=b.x}}if(b.offsetLeft!=undefined&&siw.isWinIE){curleft+=b.offsetLeft}return curleft}function findElementPosY(b){curtop=0;if(b.offsetParent){while(b.offsetParent){curtop+=b.offsetTop;b=b.offsetParent}}else{if(b.y){curtop+=b.y}}return curtop}function handleKeyPress(b){e=getEvent(b);eL=getEventElement(e);if(typeof handleKeyUpCustom!="undefined"){handleKeyUpCustom(eL)}upEl=isWithinNode(eL,null,"wickEnabled",null,null);kc=e.keyCode;if(siw&&((kc==13))){siw.selectingSomething=true;if(siw.isSafari){siw.inputBox.blur()}siw.inputBox.focus();siw.inputBox.value=siw.inputBox.value.replace(/[ \r\n\t\f\s]+$/gi," ");hideSmartInputFloater();freezeEvent(e)}else{if(upEl&&(kc!=38)&&(kc!=40)&&(kc!=37)&&(kc!=39)&&(kc!=13)&&(kc!=27)){if(!siw||(siw&&!siw.selectingSomething)){processSmartInput(upEl)}}else{if(siw&&siw.inputBox){siw.inputBox.focus()}}}}function handleKeyDown(b){e=getEvent(b);eL=getEventElement(e);if(siw&&(kc=e.keyCode)){if(kc==40){siw.selectingSomething=true;freezeEvent(e);if(siw.isGecko){siw.inputBox.blur()}selectNextSmartInputMatchItem()}else{if(kc==38){siw.selectingSomething=true;freezeEvent(e);if(siw.isGecko){siw.inputBox.blur()}selectPreviousSmartInputMatchItem()}else{if((kc==13)){siw.selectingSomething=true;activateCurrentSmartInputMatch();freezeEvent(e)}else{if(kc==27){hideSmartInputFloater();freezeEvent(e)}else{siw.selectingSomething=false}}}}}}function handleFocus(b){e=getEvent(b);eL=getEventElement(e);if(typeof handleFocusCustom!="undefined"){handleFocusCustom(eL)}if(focEl=isWithinNode(eL,null,"wickEnabled",null,null)){if(!siw||(siw&&!siw.selectingSomething)){processSmartInput(focEl)}}}function handleBlur(b){e=getEvent(b);eL=getEventElement(e);if(typeof handleBlurCustom!="undefined"){handleBlurCustom(eL)}if(blurEl=isWithinNode(eL,null,"wickEnabled",null,null)){if(siw&&!siw.selectingSomething){hideSmartInputFloater()}}}function handleClick(b){e2=getEvent(b);eL2=getEventElement(e2);if(siw&&siw.selectingSomething){selectFromMouseClick()}}function handleMouseOver(b){e=getEvent(b);eL=getEventElement(e);if(siw&&(mEl=isWithinNode(eL,null,"matchedSmartInputItem",null,null))){siw.selectingSomething=true;selectFromMouseOver(mEl)}else{if(isWithinNode(eL,null,"siwCredit",null,null)){siw.selectingSomething=true}else{if(siw){siw.selectingSomething=false}}}}function showSmartInputFloater(){if(!siw.floater.style.display||(siw.floater.style.display=="none")){if(!siw.customFloater){x=findElementPosX(siw.inputBox);y=findElementPosY(siw.inputBox)+siw.inputBox.offsetHeight;if(!siw.isGecko&&!siw.isWinIE){x+=8}if(!siw.isGecko&&!siw.isWinIE){y+=10}siw.floater.style.left=x+"px";siw.floater.style.top=y+"px"}else{}siw.floater.style.display="block";siw.floater.style.visibility="visible";if(typeof showFloaterCustom!="undefined"){showFloaterCustom()}}}function hideSmartInputFloater(){if(siw){siw.floater.style.display="none";siw.floater.style.visibility="hidden";siw=null;if(typeof hideFloaterCustom!="undefined"){hideFloaterCustom()}}}function processSmartInput(b){if(!siw){siw=new smartInputWindow()}siw.inputBox=b;siw.autoShow=b.accept;classData=b.className.split(" ");siwDirectives=null;for(i=0;(!siwDirectives&&classData[i]);i++){if(classData[i].indexOf("wickEnabled")!=-1){siwDirectives=classData[i]}}if(siwDirectives&&(siwDirectives.indexOf(":")!=-1)){siw.customFloater=true;newFloaterId=siwDirectives.split(":")[1];siw.floater=document.getElementById(newFloaterId);siw.floaterContent=siw.floater.getElementsByTagName("div")[0]}setSmartInputData();if(siw.matchCollection&&(siw.matchCollection.length>0)){selectSmartInputMatchItem(0)}content=getSmartInputBoxContent();if(content){modifySmartInputBoxContent(content);showSmartInputFloater()}else{hideSmartInputFloater()}}function smartInputMatch(b,d){this.cleanValue=b;this.value=d;this.isSelected=false}function simplify(b){return b.toLowerCase().replace(/^[ \s\f\t\n\r]+/,"").replace(/[ \s\f\t\n\r]+$/,"")}function getUserInputToMatch(b){a=b;if(isCommaDelimiter){fields=b.split(",");if(fields.length>0){a=fields[fields.length-1]}}return a}function getUserInputBase(){s=siw.inputBox.value;a=s;if((lastComma=s.lastIndexOf(","))!=-1){a=a.replace(/^(.*\,[ \r\n\t\f\s]*).*$/i,"$1")}else{a=""}return a}function runMatchingLogic(d,b){d=simplify(d);uifc=d.charAt(0).toLowerCase();if(uifc=='"'){uifc=(n=d.charAt(1))?n.toLowerCase():"z"}if(b){d=uifc}if(siw){siw.matchCollection=new Array()}pointerToCollectionToUse=collection;if(siw&&siw.revisedCollection&&(siw.revisedCollection.length>0)&&siw.lastUserInput&&(d.indexOf(siw.lastUserInput)==0)){pointerToCollectionToUse=siw.revisedCollection}else{if(collectionIndex[d]&&(collectionIndex[d].length>0)){pointerToCollectionToUse=collectionIndex[d]}else{if(collectionIndex[uifc]&&(collectionIndex[uifc].length>0)){pointerToCollectionToUse=collectionIndex[uifc]}else{if(siw&&(d.length==1)&&(!collectionIndex[uifc])){siw.buildIndex=true}else{if(siw){siw.buildIndex=false}}}}}pointerToCollectionToUse=collection;tempCollection=new Array();re1m=new RegExp('^([ "><-]*)('+d+")","i");re2m=new RegExp('([ "><-]+)('+d+")","i");re1=new RegExp('^([ "}{-]*)('+d+")","gi");re2=new RegExp('([ "}{-]+)('+d+")","gi");for(i=0,j=0;(i<pointerToCollectionToUse.length);i++){displayMatches=((!b)&&(j<siw.MAX_MATCHES));entry=pointerToCollectionToUse[i];mEntry=simplify(entry);if(!b&&(mEntry.indexOf(d)==0)){d=d.replace(/\>/gi,"\\}").replace(/\< ?/gi,"\\{");re=new RegExp("("+d+")","i");if(displayMatches){siw.matchCollection[j]=new smartInputMatch(entry,mEntry.replace(/\>/gi,"}").replace(/\< ?/gi,"{").replace(re,"<b>$1</b>"))}tempCollection[j]=entry;j++}else{if(mEntry.match(re1m)||mEntry.match(re2m)){if(!b&&displayMatches){siw.matchCollection[j]=new smartInputMatch(entry,mEntry.replace(/\>/gi,"}").replace(/\</gi,"{").replace(re1,"$1<b>$2</b>").replace(re2,"$1<b>$2</b>"))}tempCollection[j]=entry;j++}}}if(siw){siw.lastUserInput=d;siw.revisedCollection=tempCollection.join(",").split(",");collectionIndex[d]=tempCollection.join(",").split(",")}if(b||siw.buildIndex){collectionIndex[uifc]=tempCollection.join(",").split(",");if(siw){siw.buildIndex=false}}}function setSmartInputData(){if(siw){orgUserInput=siw.inputBox.value;orgUserInput=getUserInputToMatch(orgUserInput);userInput=orgUserInput.toLowerCase().replace(/[\r\n\t\f\s]+/gi," ").replace(/^ +/gi,"").replace(/ +$/gi,"").replace(/ +/gi," ").replace(/\\/gi,"").replace(/\[/gi,"").replace(/\(/gi,"").replace(/\./gi,".").replace(/\?/gi,"");if((siw.autoShow||userInput&&(userInput!=""))&&(userInput!='"')){runMatchingLogic(userInput)}else{siw.matchCollection=null}}}function getSmartInputBoxContent(){a=null;if(siw&&siw.matchCollection&&(siw.matchCollection.length>0)){a="";for(i=0;i<siw.matchCollection.length;i++){selectedString=siw.matchCollection[i].isSelected?" selectedSmartInputItem":"";a+='<p class="matchedSmartInputItem'+selectedString+'">'+siw.matchCollection[i].value.replace(/\{ */gi,"&lt;").replace(/\} */gi,"&gt;")+"</p>"}}return a}function modifySmartInputBoxContent(b){siw.floaterContent.innerHTML='<div id="smartInputResults">'+b+(siw.showCredit?('<p class="siwCredit">Powered By: <a target="PhrawgBlog" href="http://chrisholland.blogspot.com/?from=smartinput&ref='+escape(location.href)+'">Chris Holland</a></p>'):"")+"</div>";siw.matchListDisplay=document.getElementById("smartInputResults")}function selectFromMouseOver(b){currentIndex=getCurrentlySelectedSmartInputItem();if(currentIndex!=null){deSelectSmartInputMatchItem(currentIndex)}newIndex=getIndexFromElement(b);selectSmartInputMatchItem(newIndex);modifySmartInputBoxContent(getSmartInputBoxContent())}function selectFromMouseClick(){siw.inputBox.focus();activateCurrentSmartInputMatch();hideSmartInputFloater()}function getIndexFromElement(b){index=0;while(b=b.previousSibling){index++}return index}function getCurrentlySelectedSmartInputItem(){answer=null;for(i=0;((i<siw.matchCollection.length)&&!answer);i++){if(siw.matchCollection[i].isSelected){answer=i}}return answer}function selectSmartInputMatchItem(b){siw.matchCollection[b].isSelected=true}function deSelectSmartInputMatchItem(b){siw.matchCollection[b].isSelected=false}function selectNextSmartInputMatchItem(){currentIndex=getCurrentlySelectedSmartInputItem();if(currentIndex!=null){deSelectSmartInputMatchItem(currentIndex);if((currentIndex+1)<siw.matchCollection.length){selectSmartInputMatchItem(currentIndex+1)}else{selectSmartInputMatchItem(0)}}else{selectSmartInputMatchItem(0)}modifySmartInputBoxContent(getSmartInputBoxContent())}function selectPreviousSmartInputMatchItem(){currentIndex=getCurrentlySelectedSmartInputItem();if(currentIndex!=null){deSelectSmartInputMatchItem(currentIndex);if((currentIndex-1)>=0){selectSmartInputMatchItem(currentIndex-1)}else{selectSmartInputMatchItem(siw.matchCollection.length-1)}}else{selectSmartInputMatchItem(siw.matchCollection.length-1)}modifySmartInputBoxContent(getSmartInputBoxContent())}function activateCurrentSmartInputMatch(){baseValue=getUserInputBase();if((selIndex=getCurrentlySelectedSmartInputItem())!=null){addedValue=siw.matchCollection[selIndex].cleanValue;theString=(baseValue?baseValue:"")+addedValue;if(isCommaDelimiter){theString=theString+", "}siw.inputBox.value=theString;runMatchingLogic(addedValue,true)}}function smartInputWindow(){this.customFloater=false;this.floater=document.getElementById("smartInputFloater");this.floaterContent=document.getElementById("smartInputFloaterContent");this.selectedSmartInputItem=null;this.MAX_MATCHES=15;this.isGecko=(navigator.userAgent.indexOf("Gecko/200")!=-1);this.isSafari=(navigator.userAgent.indexOf("Safari")!=-1);this.isWinIE=((navigator.userAgent.indexOf("Win")!=-1)&&(navigator.userAgent.indexOf("MSIE")!=-1));this.showCredit=false}function registerSmartInputListeners(){inputs=document.getElementsByTagName("input");texts=document.getElementsByTagName("textarea");allinputs=new Array();z=0;y=0;while(inputs[z]){allinputs[z]=inputs[z];z++}while(texts[y]){allinputs[z]=texts[y];z++;y++}for(i=0;i<allinputs.length;i++){if((c=allinputs[i].className)&&(c=="wickEnabled")){allinputs[i].setAttribute("autocomplete","OFF");allinputs[i].onfocus=handleFocus;allinputs[i].onblur=handleBlur;allinputs[i].onkeydown=handleKeyDown;allinputs[i].onkeyup=handleKeyPress}}}siw=null;if(document.addEventListener){document.addEventListener("keydown",handleKeyDown,false);document.addEventListener("keyup",handleKeyPress,false);document.addEventListener("mouseup",handleClick,false);document.addEventListener("mouseover",handleMouseOver,false)}else{document.onkeydown=handleKeyDown;document.onkeyup=handleKeyPress;document.onmouseup=handleClick;document.onmouseover=handleMouseOver}window.addEventListener?window.addEventListener("load",registerSmartInputListeners,false):window.attachEvent("onload",registerSmartInputListeners);document.write('<table id="smartInputFloater" class="floater" cellpadding="0" cellspacing="0"><tr><td id="smartInputFloaterContent" nowrap="nowrap"></td></tr></table>');for(x=0;x<collection.length;x++){collection[x]=collection[x].replace(/\,/gi,"")}collectionIndex=new Array();ds="";function debug(b){ds+=(b+"\n")};
function google_ad_request_done(b){var c="";var a;if(typeof adl=="undefined"){adl="multiline"}if(b.length==0){return}if(b[0].type=="flash"){}else{if(b[0].type=="image"){}else{if(b.length>=1){c+='<div class="ad-holder"><div class="title"><a href="'+google_info.feedback_url+'">Ads by Google</a></div><div class="ads">';for(a=0;a<b.length;++a){c+='<div class="ad-item"><a href="'+b[a].url+'" onClick="cpcExit(this);" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+b[a].visible_url+"';return true\">"+b[a].line1+"</a>";c+=layout(adl,b[a].line2,b[a].line3);c+='<a class="site" href="'+b[a].url+'" onClick="cpcExit(this);" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+b[a].visible_url+"';return true\">"+b[a].visible_url+"</a></div>"}c+="</div></div>"}}}document.write(c);return}function GetParam(b){var a=new RegExp(b+"=(.+)[&]","i").exec(location.search);if(a==null){a=new RegExp(b+"=(.+)","i").exec(location.search)}if(a==null){return null}a=a+"";result=a.split(",");return result[1]}function google_afs_request_done(c){var e=c.length;if(e<=0){return}if(typeof adl=="undefined"){adl="multiline"}var b="";var a="";if(c.length>=1){var d="";d+='<div class="ad-holder"><div class="title"><a href="http://services.google.com/feedback/online_hws_feedback">Ads by Google</a></div><div class="ads">';for(i=0;i<c.length;++i){if(c[i].type=="text/wide"){d+='<div class="ad-item"><a href="'+c[i].url+'" onClick="cpcExit(this);" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+c[i].visible_url+"';return true\">"+c[i].line1+"</a>";if(c[i].line2){d+=layout(adl,c[i].line2)}if(c[i].line3){d+=c[i].line3}d+='</p><a class="site" href="'+c[i].url+'" onClick="cpcExit(this);" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+c[i].visible_url+"';return true\">"+c[i].visible_url+"</a></div>"}}d+="</div></div>"}document.write(d)}function inlineLayout(b,a){nextLine=" - "+b;if(a){nextLine+=" "+a}nextLine="<span class='site'>"+nextLine+"</span><p/>";return nextLine}function multilineLayout(b,a){nextLine=b;if(a){nextLine+=" "+a}nextLine="<p>"+nextLine+"</p>";return nextLine}function layout(c,b,a){if(c=="inline"){return inlineLayout(b,a)}else{return multilineLayout(b,a)}};


