var ClientContext={};var newwindow=null;function popitup(c,b,e,d,a){var g=0;var f=0;if(e==null){e="resizable=1,scrollbars=1"}if(d!=null){g=(screen.width)?(screen.width-d)/2:0;e+=(",width="+d+",left="+g)}if(a!=null){f=(screen.height)?(screen.height-a)/2:0;e+=(",height="+a+",top="+f)}newwindow=window.open(c,b,e);if(window.focus){newwindow.focus()}return false}function ideaxInfo(){alert("ideax.js version 1.0")}function clearForms(){var a;for(a=0;(a<document.forms.length);a++){document.forms[a].reset()}}function showDiv(b,c,a){if(!$defined(a)){a="block"}if(document.getElementById(b)){document.getElementById(b).style.display=a}if(document.getElementById(c)){document.getElementById(c).style.display="none"}}function hideDiv(b){if(document.getElementById(b)){document.getElementById(b).style.display="none"}else{if($defined($(b))){try{$(b).setStyle("display","none")}catch(a){}}}}function showDivs(a){$$(a).each(function(b){b.setStyle("display","");return true})}function hideDivs(a){$$(a).each(function(b){b.setStyle("display","none");return true})}function hideDialogue(){hideDiv("dialogue_bg");hideDiv("dialogue")}function showDialogue(a,b){if(document.getElementById("dialogue_content")){if(a){updateDocument("dialogue_content",a)}document.getElementById("dialogue_bg").style.display="block";document.getElementById("dialogue").style.display="block";if(b){setTimeout("hideDialogue()",b)}}}function showPageMessage(c,b,d){var a=$("page_message");if($defined(d)){a=$(d)}if(!($defined(a)&&$defined(c))){return}a.innerHTML=c;if(b=="error"){a.set("class","error_message")}else{if(b=="warn"){a.set("class","warn_message")}else{a.set("class","info_message")}}a.setStyle("display","block");document.location.href="#page_message"}function hidePageMessage(b){var a=$("page_message");if($defined(b)){a=$(b)}if($defined(a)){a.erase("class");a.setStyle("display","none")}else{}}function showPageInfo(a){showPageMessage(a,"info")}function showPageError(a){showPageMessage(a,"error")}function showPageWarning(a){showPageMessage(a,"warn")}function newWindow(e,d,b,c,a){LeftPosition=(screen.width)?(screen.width-b)/2:0;TopPosition=(screen.height)?(screen.height-c)/2:0;settings="height="+c+",width="+b+",top="+TopPosition+",left="+LeftPosition+",scrollbars="+a+",resizable";newwindow=window.open(e,d,settings)}function validateForm(e,b,d){var c=getMyForm(e,b);var a="<!--error-->.*";var f=new RegExp(a,"g");if(b.getElementById(d)){b.getElementById(d).innerHTML=""}if(c.match(f)){if(b.getElementById(d)!=null){b.getElementById(d).innerHTML=c;b.getElementById(d).style.display="block"}if(b.getElementById(d+"_a")){b.getElementById(d+"_a").focus()}Busy.hide();return false}}function getMyForm(k,g){var f="";var e="";var d="";var b="";var h="";var l="";var a="";var j="";for(var c=0;c<k.elements.length;c++){a=k.elements[c];d=a.title;b=a.value;h=a.name;l=a.id;if($defined(g)&&g.getElementById(l+"_label")){j=g.getElementById(l+"_label").title}else{j=l}switch(a.type){case"text":case"hidden":case"password":case"textarea":if(encodeURI(d)=="required"&&encodeURI(b).length<1){f+='<li><span class="errorMessage">"'+j+'" is a required field</span></li>';break}e+=h+"="+encodeURI(b)+"&";break;case"checkbox":case"radio":if(encodeURI(d)=="required"&&!a.checked){f+='<li><span class="errorMessage">"'+j+'" must be ticked to register</span></li>';break}if(a.checked){e+=h+"="+encodeURI(b)+"&"}break;case"select-one":e+=h+"="+a.options[a.selectedIndex].value+"&";break}}if(f.length>0){return"<!--error--><ul>"+f+"</ul>"}else{e=e.substr(0,(e.length-1));return e}}function buildFormQuery(c){var e="";for(var b=0;b<c.elements.length;b++){var a=c.elements[b].name;var d=getFormElementValue(c.elements[b]);if(a&&d){e+=a+"="+d+"&"}}return e}function getFormElementValue(c){if(c.length!=null){var b=c[0].type}if((typeof(b)=="undefined")||(b==0)){var b=c.type}switch(b){case"undefined":return;case"radio":for(var a=0;a<c.length;a++){if(c[a].checked==true){return c[a].value}}case"select-multiple":var d=new Array();for(var a=0;a<c.length;a++){if(c[a].selected==true){d[d.length]=c[a].value}}return d;case"checkbox":return c.checked;default:return c.value}}function showComments(c,d){var b="comments_"+c;if(document.getElementById(b)){var a=new Request.HTML({url:d,onSuccess:function(g,e,h,f){if(h.match(new RegExp("<!--error-->","g"))){showPageError("Error: "+h)}else{updateDocument(b,h);document.getElementById(b).style.display="block";if(document.getElementById("iconShowComments"+c)!=null){document.getElementById("iconShowComments"+c).style.display="none"}if(document.getElementById("iconHideComments"+c)!=null){document.getElementById("iconHideComments"+c).style.display="inline"}}},onFailure:function(e){showPageError("Error: Failed to show comments.")}}).send()}}function hideComments(a){if(document.getElementById("comments_"+a)){document.getElementById("comments_"+a).innerHTML="";document.getElementById("comments_"+a).style.display="none";if(document.getElementById("iconShowComments"+a)){document.getElementById("iconShowComments"+a).style.display="inline"}if(document.getElementById("iconHideComments"+a)){document.getElementById("iconHideComments"+a).style.display="none"}}}function showDescription(a,c){if(document.getElementById(a)){var b=new Request.HTML({url:c,onSuccess:function(f,d,g,e){if(g.match(new RegExp("<!--error-->","g"))){showPageError("Error: "+g)}else{updateDocument(a,g);document.getElementById(a).scrollTop=0}},onFailure:function(d){showPageError("Error: Failed to show description.")}}).send()}}function updateDocument(b,a){if(b==null){return}if(document.getElementById(b)!=null){document.getElementById(b).innerHTML=a}else{if(b.innerHTML){b.innerHTML=a}}}function gotoURL(a){if(a){document.location=a}}function dumpProps(c,b){for(var a in c){if(b){var d=b+"."+a+"\n"+c[a]}else{var d=a+"\n"+c[a]}if(!confirm(d)){return}if(typeof c[a]=="object"){if(b){dumpProps(c[a],b+"."+a)}else{dumpProps(c[a],a)}}}}function rateIt(c,b,a){c=c+"&rating="+a;loadContent(c,b,"")}function loadContent(d,f,l,k,c,j){if(!(d&&targetExists(f))){return false}var a=Math.random();if(d.match(new RegExp("\\?","g"))){d=d+"&txid="+a}else{d=d+"?txid="+a}if(l==null){l="Loading..."}if(l!=""&&targetExists(f)){updateDocument(f,l)}try{hidePageMessage()}catch(g){}if(k==null){k=function(n,e,o,m){if(o.match(new RegExp("<!--error."+a+"-->","g"))){showPageError("Error: "+o)}else{if(targetExists(f)){updateDocument(f,o)}else{}}}}if(c==null){c=function(e){showPageError("Error: Failed to process request.")}}var i=function(n,e,o,m){Busy.hide();k(n,e,o,m);if($defined(j)){j()}};var b=function(e){Busy.hide();c(e);if($defined(j)){j()}};Busy.show();var h=new Request.HTML({url:d,onSuccess:i,onFailure:b}).send()}function doQuery(c,d){var a;var b=new Request.HTML({url:c,onSuccess:function(g,e,h,f){if(d!=null){d(h)}},onFailure:function(e){alert("status :"+e.status);showPageError("doQuery: Failed to send request.")}}).send()}function targetExists(a){if(document.getElementById(a)||a.innerHTML){return true}else{return false}}function processActionForm(a,e,g){if(!(e&&document.getElementById(g))){return false}var b=e+"_form";var d=e+".action?";var c=document.getElementById(b);var f=a+d+buildFormQuery(c);loadContent(f,g)}function loadSecureContent(f,e){var b={strUrl:f,target:e};var a={};var d=function(g){loadContent(g.strUrl,g.target)};chnge;var c=function(g){showPageError('You are currently not logged in. Please log in to view this content.<br>Click <a href="#" onclick="window.location.reload();return false;">here</a> to reload page and login.')};verifyLogin(d,b,c,a)}function refreshPageTitle(c){if(c&&actionConfig&&actionConfig.pageTitleRefreshUrl!=""){var b=actionConfig.pageTitleRefreshUrl+"&id="+c;var d=function(g,e,h,f){if(h.match(new RegExp("<!--error.*-->","g"))){showPageError("Error: "+h)}else{if(h.trim()!=""){document.title=h.trim()}}};var a=function(e){};loadContent(b,"dummy"," ",d,a)}}function TabMenu(a,b){this.activeTabId=a;this.loadOnce={};this.activateTab=function(f,e,c){var h=document.getElementById("menu-"+this.activeTabId);var d=document.getElementById(this.activeTabId);var g=document.getElementById("menu-"+f);var i=document.getElementById(f);if(g&&i){if(h){h.className=null;if(d){d.style.display="none"}}g.className="activetab";i.style.display="block";this.activeTabId=f;if(e!=null&&(!$defined(this.loadOnce[f])||this.loadOnce[f]!="true")){loadContent(e,f)}if($defined(c)){this.loadOnce[f]=c}}};this.activateTab(a,b)}function updateVoteAsync(a){var b=a.objectId;if(b){updateDocument("score_"+b+"_score",""+a.score);updateDocument("score_"+b+"_forIt",""+a.forIt);updateDocument("score_"+b+"_againstIt",""+a.againstIt)}}function capitalizeFirstOfWords(a){newVal="";val=a.split(" ");for(var b=0;b<val.length;b++){newVal+=val[b].substring(0,1).toUpperCase()+val[b].substring(1,val[b].length)+" "}return newVal.trim()}function realTypeOf(a){if(typeof(a)=="object"){if(a===null){return"null"}if(a.constructor==(new Array).constructor){return"array"}if(a.constructor==(new Date).constructor){return"date"}if(a.constructor==(new RegExp).constructor){return"regex"}return"object"}return typeof(a)}function linkMedia(a){var c=$(a);var b;if(c.rev!=null){b=JSON.decode(c.rev)}else{b={}}c.mediabox(b,null,function(e){var d=this.rel.replace(/[[]|]/gi," ");var f=d.split(" ");return(this==e)||((this.rel.length>8)&&e.rel.match(f[1]))})}Element.implement({getSelectedValue:function(){if(this.tagName.toLowerCase()!="select"){return null}return $splat(new Elements($A(this.options).filter(function(a){return a.selected})).map(function(a){return a.value.clean()}))},getSelectedIndex:function(){if(this.tagName.toLowerCase()!="select"){return null}return $splat(new Elements($A(this.options).filter(function(a){return a.selected})).map(function(a){return a.index}))},getSelectedFull:function(){if(this.tagName.toLowerCase()!="select"){return null}return $splat(new Elements($A(this.options).filter(function(a){return a.selected})).map(function(a){return{index:a.index,value:a.value.clean()}}))},setSelected:function(a,b){if(this.tagName.toLowerCase()!="select"){return null}if(!b){this.clearSelect()}var a=$splat(a);Array.each(this.options,function(d,c){if(a.contains(d.getProperty("value"))||a.contains(c)){$(d).set("selected","selected")}});return},clearSelect:function(b){if(this.tagName.toLowerCase()!="select"){return null}var a=this.getSelectedFull();Array.each(this.options,function(c){$(c).set("selected",(c.defaultSelected&&b)?"selected":"")});return a}});var Busy={el:null,getElement:function(){return Busy.el?Busy.el:Busy.el=new Asset.image((ServerConfig?ServerConfig.contextPath:"")+"/images/bigrotation2.gif").addClass("busy").inject(document.body).position().pin()},show:function(){var a;try{Busy.getElement().setStyles({opacity:0,display:"block"}).fade(1)}catch(a){}},hide:function(){var a;try{Busy.getElement().fade(0).get("tween").chain(function(){this.element.dispose();Busy.el=null})}catch(a){}}};function adjustMastTitle(){var b=$("mast_bg");var e=$("mastTitle");if($defined(b)&&$defined(e)){var d=b.getComputedSize().totalHeight;var a=e.getComputedSize().totalHeight;var c=Math.ceil((d/2)-(a/2));e.setStyles({display:"block",position:"absolute",top:c+"px"})}}function isIE6(){var b=false;try{b=($defined(ClientContext.ie6)&&ClientContext.ie6)}catch(a){}return b}function requiresAdjustFooter(){var b=true;try{b=(Browser.Engine.trident&&ServerConfig.context!="input"&&(ServerConfig.templateid=="legacy"||ServerConfig.templateid=="1"||isIE6()))}catch(a){}return b}function adjustFooter(){if(document.getElementById("footer")){var d=$("footer").getComputedSize().totalHeight;var f=document.body.getComputedSize().totalHeight;var b=document.body.getComputedSize().totalWidth;var a=getScrollXY();var c=f-d+a[1];var e=a[1];if(isIE6()){c=window.getHeight()-d+a[1]}$("footer").setStyle("display","none");$("footer").setStyles({position:"absolute",top:c+"px",bottom:e+"px",left:"0px"});$("footer").setStyle("display","block");$$("div[class^=dhtmlxToolbarPoly_]").each(function(h){h.setStyles({position:"absolute"});if(isIE6()){var g=h.getNext("iframe");if($defined(g)){g.dispose()}}})}}function setFooter(){if(document.getElementById("footer")){$("footer").setStyle("display","none");$("footer").setStyles({display:"block","z-index":"99","background-color":$(document.body).getStyle("background-color")});var b=$("footer").getComputedSize().totalHeight;$$(".padFooter").each(function(c){c.setStyles({display:"block","min-height":(b+30),height:(b+30),clear:"both"})});try{if(requiresAdjustFooter()){adjustFooter();window.addEvent("scroll",adjustFooter);window.addEvent("resize",adjustFooter)}}catch(a){}}}function waitForCond(c,b){var a=null;if($defined(b)&&$defined(b.poller)){a=b}else{a={timeout:30000,interval:1000,onsuccess:null,onfail:null,polltime:0,poller:null};$extend(a,b)}if(c()){if($defined(a.onsuccess)){a.onsuccess()}}else{a.polltime=a.polltime+a.interval;if(a.polltime>a.timeout){if($defined(a.poller)){clearTimeout(a.poller)}if($defined(a.onfail)){a.onfail()}}else{a.poller=setTimeout(function(){waitForCond(c,a)},a.interval)}}}function waitForElement(a,b){waitForCond(function(){return $defined($(a))},b)}function loadScripts(b,d){if($defined(b)&&$type(b=="array")){if(!$defined(d)){d={}}var a=($defined(d.index)?d.index:0);if(a<b.length){var c=b[a].script;var i=b[a].id;var h=b[a].onload;var f=($defined(b[a].type)?b[a].type:"js");if($defined(c)){if($defined($(i))){if($defined(h)&&$type(h)=="function"){h()}d.index=a+1;loadScripts(b,d)}else{if(f=="css"){new Asset.css(c,{id:i});waitForElement(i,{onsuccess:function(){if($defined(h)&&$type(h)=="function"){h()}d.index=a+1;loadScripts(b,d)}})}else{try{new Asset.javascript(c,{id:i,onload:function(){if($defined(h)&&$type(h)=="function"){h()}d.index=a+1;loadScripts(b,d)}})}catch(g){alert(g)}}}}}}}function loadMediaBoxEnv(b){var a=[{id:"mediaboxAdvBlack_css",type:"css",script:ServerConfig.contextPath+"/scripts/mediaboxadv/styles/black/css/mediaboxAdvBlack.css"},{id:"mediaboxAdv99b_js",script:ServerConfig.contextPath+"/scripts/mediaboxadv/mediaboxAdv99b.js",onload:b}];loadScripts(a)}function showInputOverlay(c,g,f,d,b,e){if(!$defined(b)){b=window.getHeight()-50}var a={closeOnClickOutside:false};$extend(a,e);showOverlay(c,g,f,d,b,a)}function showOverlay(c,g,f,d,b,e){if(!$defined(g)){g=""}if(!$defined(f)){f=""}if(!$defined(d)){d=window.getWidth()-150}if(!$defined(b)){b=window.getHeight()-150}var a={stopKey:false,shortcuts:false};$extend(a,e);loadMediaBoxEnv(function(){if($defined(Mediabox)){try{Mediabox.open([[c,g+"::"+f,d+" "+b]],0,a)}catch(h){alert(h)}}else{alert("Mediabox not defined")}})}var messages=[];var max_msgs=50;function handleMessages(a){if(messages.length>=max_msgs){messages.shift()}messages[messages.length]=a;showMessageAvailable()}var bottombar=null;function showBottombar(a){if(!a){new Request.HTML({url:ServerConfig.contextPath+"/site/setBottomBarVisible.action"}).get({bottomBarVisible:"true",tid:ServerConfig.tid,"category.id":ServerConfig.cid})}showDiv("bottombarWrapper");hideDiv("showBottombar");if(requiresAdjustFooter()){adjustFooter()}}function hideBottombar(a){if(!a){new Request.HTML({url:ServerConfig.contextPath+"/site/setBottomBarVisible.action"}).get({bottomBarVisible:"false",tid:ServerConfig.tid,"category.id":ServerConfig.cid})}hideDiv("bottombarWrapper");showDiv("showBottombar");if(requiresAdjustFooter()){adjustFooter()}}function showMessageAvailable(){if($defined(bottombar)){hideMessageAvailable();bottombar.addButton("viewMessages",9999,null,"message-blink.gif");bottombar.setItemToolTip("viewMessages","You have "+messages.length+" messages");showBottombar()}}function hideMessageAvailable(){if($defined(bottombar)){bottombar.removeItem("viewMessages")}}function handleHome(){window.location.href=ServerConfig.contextPath+"/"+ServerConfig.aid+".action"}function handleLogin(b){var a=ServerConfig.contextPath+"/"+ServerConfig.ns+"/loginStda.action?tid="+ServerConfig.tid+"&tab=login&callback=doHandleLoginCallback";if($defined(b)){a=a+"&actionContext="+b}showOverlay(a,"Sign In",null,640,500)}function handleChangePassword(b){var a=ServerConfig.contextPath+"/site/input_change_password.action?tid="+ServerConfig.tid+"&tab=login&callback=doHandleLoginCallback";if($defined(b)){a=a+"&actionContext="+b}showOverlay(a,"Change password",null,640,500)}function doHandleLoginCallback(){if($defined(parent)){parent.window.location.reload()}}function handleRegister(){showOverlay(ServerConfig.contextPath+"/"+ServerConfig.ns+"/loginStda.action?tid="+ServerConfig.tid+"&tab=register&callback=doHandleLoginCallback","Sign Up",null,640,500)}function doHandleRegisterCallback(){}function handleJoin(){showOverlay(ServerConfig.contextPath+"/join_community/join_community.action?tid="+ServerConfig.tid+"&communityId="+ServerConfig.comid+"&callback=doHandleLoginCallback","Join community",null,640,500)}function handleUnjoin(){showOverlay(ServerConfig.contextPath+"/join_community/unjoin_community.action?tid="+ServerConfig.tid+"&communityId="+ServerConfig.comid+"&callback=doHandleLoginCallback","Join community",null,640,500)}function handleLogout(){window.location.href=ServerConfig.contextPath+"/security/logout.action?tid="+ServerConfig.tid+"&category.id="+ServerConfig.cid}function handleNew(a,c){if(a=="10"){var b=ServerConfig.contextPath+"/"+c+"/new_community.action?tid="+ServerConfig.tid+"&category.id="+ServerConfig.cid;popitup(b,"Community","left=20,top=20,width=1024,height=800,toolbar=1,resizable=1,scrollbars=1");return false}else{var b=ServerConfig.contextPath+"/"+c+"/new_item.action?tid="+ServerConfig.tid+"&category.id="+ServerConfig.cid;showInputOverlay(b);return false}}function handleManageCommunityPrefs(){window.location.href=ServerConfig.contextPath+"/community/input_community.action?community.id="+ServerConfig.comid+"&tid="+ServerConfig.tid+"&category.id="+ServerConfig.cid}function handleManageCommunityMembers(){var a=ServerConfig.contextPath+"/security/manage_community_members.action?groupName="+ServerConfig.gn+"&ns="+ServerConfig.ns+"&tid="+ServerConfig.tid+"&category.id="+ServerConfig.cid;showOverlay(a,"Manage community members")}function handleManageProfile(){window.location.href=ServerConfig.contextPath+"/user/input_user_profile.action?tid="+ServerConfig.tid+"&category.id="+ServerConfig.cid+"&userId="+ServerConfig.username+"&nextAction=save_user_profile"}function handleManageCommunitySendMsg(){showOverlay(ServerConfig.contextPath+"/site/sendInstantMsgStda.action?tid="+ServerConfig.tid,"Instant message","Send an instant message to online users",640,500)}function handleModerateItems(){showOverlay(ServerConfig.contextPath+"/moderate/index.action?tid="+ServerConfig.tid,"Moderate notices","Item notices",(window.getWidth()-50),(window.getHeight()-50))}function handleSendNotices(){showOverlay(ServerConfig.contextPath+"/notification/input_send_notices.action?tid="+ServerConfig.tid+"&siteId="+ServerConfig.siteid,"Send group notification","Group notification",(window.getWidth()-100),(window.getHeight()-100))}function handleViewMessages(){if(messages.length>0){var a=null;while(messages.length>0){a=messages.shift();alert(a.eventDt+"\n"+a.message)}hideMessageAvailable()}}function handleHelpGettingStarted(){window.location.href=ServerConfig.contextPath+"/site/helpGettingStarted.action?tid="+ServerConfig.tid+"&category.id="+ServerConfig.cid}function handleSearch(){window.location.href=ServerConfig.contextPath+"/site/search.action?tid="+ServerConfig.tid}function handleMinimize(){hideBottombar()}function handleContact(){showOverlay(ServerConfig.contextPath+"/site/contact.action?tid="+ServerConfig.tid+"&community.id="+ServerConfig.comid+"&noheader=1","Contact us","Send us a message",640,550)}function handleToolbarClickEvent(b){var a=null;if(b=="login"){handleLogin()}else{if(b=="changePassword"){handleChangePassword()}else{if(b=="home"){handleHome()}else{if(b=="register"){handleRegister()}else{if(b=="join"){handleJoin()}else{if(b=="unjoin"){handleUnjoin()}else{if(b=="logout"){handleLogout()}else{if(a=b.match(new RegExp("^new.([0-9]+).([0-9]+)$","i"))){handleNew(a[1],a[2])}else{if(b=="manageCommunityPrefs"){handleManageCommunityPrefs()}else{if(b=="manageCommunityMembers"){handleManageCommunityMembers()}else{if(b=="manageProfile"){handleManageProfile()}else{if(b=="manageCommunitySendMsg"){handleManageCommunitySendMsg()}else{if(b=="moderateItems"){handleModerateItems()}else{if(b=="sendNotices"){handleSendNotices()}else{if(b=="viewMessages"){handleViewMessages()}else{if(b=="contact"){handleContact()}else{if(b=="helpGettingStarted"){handleHelpGettingStarted()}else{if(b=="search"){handleSearch()}else{if(b=="minimize"){handleMinimize()}}}}}}}}}}}}}}}}}}}}function checkAndWriteChangeNote(a){document.forms[a].elements.notify_changes.checked="true";writeChangeNote(a)}function updateChangeNote(a,b){populateElement(document.forms[a].elements.change_note,b);if($defined(document.getElementById("change_note_div"))){document.getElementById("change_note_div").innerHTML="<b>change note:</b> "+b}}function writeChangeNote(a){if(document.forms[a].elements.notify_changes.checked){document.forms.change_note_form.elements.hidden_change_note.value=document.forms[a].elements.change_note.value;document.forms.change_note_form.elements.hidden_change_note.defaultValue=document.forms[a].elements.change_note.value;Mediabox.open([["#mb_inline","Change Note",(450)+" "+(300)]],0,{stopKey:false,shortcuts:false});populateElement(document.forms[a].elements.change_note_presented,"true");if($defined(document.getElementById("change_note_div"))){document.getElementById("change_note_div").innerHTML="<b>change note:</b> "+document.forms.change_note_form.elements.hidden_change_note.value}}else{if($defined(document.getElementById("change_note_div"))){document.getElementById("change_note_div").innerHTML=""}}}function changeNoteOrSubmit(a,b){try{saveItem(a,b,"_self")}catch(c){alert(c)}return false}function populateElement(b,a){b.value=a}function subm(b,c,a){b.action=c;b.target=a}function addInputElement(b,c,e,a,d){new_element=document.createElement("input");new_element.setAttribute("type",c);new_element.setAttribute("name",a);new_element.setAttribute("id",e);new_element.setAttribute("value",d);document.forms[b].appendChild(new_element)}function saveItem(c,d,a,b){addInputElement(c,"hidden","save_context","saveContext","true");subm(document.forms[c],d,a);Busy.show();document.forms[c].submit();if($defined(b)){b.disabled=true}}function add_to_choice(b){var a=ServerConfig.contextPath+"/idea/add_to_editors_choice.action?tid="+ServerConfig.tid+"&item.id="+b;loadContent(a,"choice_"+b)}function remove_from_choice(b){var a=ServerConfig.contextPath+"/idea/remove_from_editors_choice.action?tid="+ServerConfig.tid+"&item.id="+b;loadContent(a,"choice_"+b)}function doBusy(a){Busy.show()}function getScrollXY(){var b=0,a=0;if(typeof(window.pageYOffset)=="number"){a=window.pageYOffset;b=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){a=document.body.scrollTop;b=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){a=document.documentElement.scrollTop;b=document.documentElement.scrollLeft}}}return[b,a]}function popupColourPicker(b,e,d){var c=e.value;if($defined(c)&&c.length>0){c=c.substitute({"#":""},"#")}if(!$defined(d)){d=""}var a=ServerConfig.contextPath+"/colourPicker.jsp?colourFunction="+b+"&colour="+c;showOverlay(a,d,"",393,313)}function getColourChooserPopulator(a){return function(f){try{var b=a;$(b).value=f;var e=a+"_prev";var c=$(e);if($defined(c)){c.setStyle("background-color",f)}}catch(d){alert(d)}}}function nvPairsToMap(b,a){var c={};if(!$defined(b)){return c}if(!$defined(a)){a=","}b=b.trim();if(b==""){return c}b.split(a).each(function(e){var d=e.indexOf("=");if(d>0){c[e.substring(0,d)]=(d<(e.length-1)?e.substring(d+1):"")}});return c}function mapToNvPairs(c,b){var a="";if(!$defined(c)){return a}if(!$defined(b)){b=","}new Hash(c).each(function(e,d){if(a.length>0){a=a+b}a=a+d+"="+e});return a}var elementClicked=null;function doClick(a){elementClicked=a;clickIt()}function clickIt(c,b){elementClicked=b;clickIt();if($defined(c)){try{c.disabled="true"}catch(a){alert(a)}}else{alert("element not defined")}}function clickIt(){try{Mediabox.close()}catch(a){}if($defined(elementClicked)){try{document.getElementById(elementClicked).click();try{if($defined(elementToDisable)){document.getElementById(elementToDisable).disabled="true"}}catch(a){}return true}catch(a){alert(a)}}else{alert("element not defined")}}function authenticateClicked(h,e,g,a){if(e!=null&&$defined(e)){elementClicked=e}var f="";if(g!=null&&$defined(g)){f="&"+g}var d=null;if(a!=null&&$defined(a)&&a!="false"){d="true"}var c=function(i){clickIt();if(d&&h!=null&&$defined(h)){$(h).disabled="true"}return true};var b=function(i){showOverlay(ServerConfig.contextPath+"/"+ServerConfig.ns+"/loginStda.action?tid="+ServerConfig.tid+"&callback=clickIt"+f,"Login",null,640,440);return false};verifyLogin(c,"success",b,"failed");return false}function SetOpacity(a,b){a.style.filter="alpha(opacity="+b+")";a.style.MozOpacity=b/100;a.style.opacity=b/100}function ChangeOpacity(h,g,b,f,e){var d=document.getElementById(h);var c=d.style.opacity*100;var a=(new Date()).getTime();c=f+(e-f)*(a-b)/g;if(c<0){SetOpacity(d,0)}else{if(c>100){SetOpacity(d,100)}else{SetOpacity(d,c);d.timer=window.setTimeout("ChangeOpacity('"+h+"',"+g+","+b+","+f+","+e+")",1)}}}function confirmDialog(g,h,c,a,e){var b=ServerConfig.contextPath+"/item/m_confirm.action?tid="+ServerConfig.tid+"&actionContext="+g;if($defined(c)){b=b+"&storeReferer="+c}if($defined(e)){b=b+"&argument="+e}var f="Confirm action";if($defined(a)){f="'"+a+"'"}try{showOverlay(b,f,null,600,400,{stopKey:false,shortcuts:false,closeCallback:h,cbOnClose:false})}catch(d){alert(d)}return false}function verifyLogin(a,b,d,e){var f=ServerConfig.contextPath+"/security/verify_login.action";var c=new Request.HTML({url:f,onSuccess:function(i,g,j,h){if(j.match(new RegExp("<!--s?success.*","g"))){a(b)}else{d(e)}},onFailure:function(){showPageError("Error: Failed to verify authentication status.")}}).send();return false}function countdown(a,g,b){try{var f=a-g;if($defined(b)&&$defined($(b))){var c=$(b);c.innerHTML=f;if(f<=0){c.setStyle("color","red")}else{if(f<10){c.setStyle("color","orange")}else{c.setStyle("color",null)}}}if(f<=0){return true}return false}catch(d){return true}}function chooseMsgLocation(a,b){if(!$defined(a)){alert("Sorry, no callback function specified. Please correct problem first.");return false}Busy.show();setTimeout(function(){Busy.hide()},1500);showOverlay(ServerConfig.contextPath+"/site/choose_location.action?tid="+ServerConfig.tid+"&callback="+a+"&showUID="+b,"Choose location")}function clickLink(a){if(a.getAttribute("onclick")==null){if(a.getAttribute("href")){document.location=a.getAttribute("href")}}else{a.onclick()}}function openTab(a){try{var c=$("menu-"+a);if($defined(c)){clickLink(c)}}catch(b){alert(b)}}function closeWindow(){if($defined("parent")&&$defined("parent.Mediabox")&&parent!=null&&parent.Mediabox!=null){parent.Mediabox.close()}else{if(newwindow!=null){newwindow.close()}else{if(parent!=null){parent.closeNewWindow()}else{if($defined("Mediabox")&&Mediabox!=null){Mediabox.close()}else{window.close()}}}}}function closeNewWindow(){if(newwindow!=null){newwindow.close()}else{window.close()}}function setupTimeout(b,c,d){var a=setTimeout(b,c);if($defined(parent)){parent[d]=a}else{window[d]=a}}function cancelTimeout(b){var a=null;if($defined(window[b])){a=window[b]}else{if($defined(parent)&&$defined(parent[b])){a=parent[b]}}if($defined(a)){clearTimeout(a)}}function loadDWRReverseAJAXEnv(b){var a=[{id:"engine_js",type:"js",script:ServerConfig.contextPath+"/dwr/engine.js"},{id:"util_js",type:"js",script:ServerConfig.contextPath+"/dwr/util.js"},{id:"dwrutil_js",type:"js",script:ServerConfig.contextPath+"/dwr/interface/DwrUtil.js"},{id:"eventmanager_js",type:"js",script:ServerConfig.contextPath+"/dwr/interface/EventManager.js",onload:function(){dwr.engine.setNotifyServerOnPageUnload(true);dwr.engine.setActiveReverseAjax(true);if($defined(b)&&$type(b)=="function"){b()}}}];loadScripts(a)}ClientContext.dwrLoaded=false;ClientContext.subscriptions={};ClientContext.subscriptions.queue=[];ClientContext.subscriptions.proc=null;function subscribe(a){ClientContext.subscriptions.queue.unshift(a);if(!ClientContext.dwrLoaded){loadDWRReverseAJAXEnv(function(){ClientContext.dwrLoaded=true;if($defined(ClientContext.subscriptions.proc)){clearTimeout(ClientContext.subscriptions.proc)}var b=setTimeout("processSubscriptions()",3000);ClientContext.subscriptions.proc=b})}}function processSubscriptions(){if(ClientContext.subscriptions.queue.length>0){dwr.engine.beginBatch();while(ClientContext.subscriptions.queue.length>0){var a=ClientContext.subscriptions.queue.pop();if(a&&$defined(EventManager)){EventManager.subscribe(a)}}dwr.engine.endBatch()}}function loadNonverBlaster(d,c){if(!($defined(d)&&$defined(c)&&$defined(c.mediaURL)&&$defined(c.width)&&$defined(c.height))){return false}var b=function(){if(!$defined($(d))){return}var e={};e.mediaURL=escape(c.mediaURL);if($defined(c.teaserURL)){e.teaserURL=escape(c.teaserURL)}e.allowSmoothing="true";e.autoPlay="false";e.buffer="6";e.showTimecode="true";e.loop="false";e.controlColor="0x3fd2a3";e.controlBackColor="0x000000";e.scaleIfFullScreen="true";e.showScalingButton="true";e.defaultVolume="100";e.crop="false";var g={};g.menu="false";g.allowFullScreen="true";g.allowScriptAccess="always";var f={};f.id=d+"_"+$time();f.bgcolor="#000000";swfobject.embedSWF(ServerConfig.contextPath+"/scripts/nonverblaster/NonverBlaster.swf",d,c.width,c.height,"9",ServerConfig.contextPath+"/scripts/nonverblaster/expressinstall.swf",e,g,f)};var a=[{id:"swfobject_js",script:ServerConfig.contextPath+"/scripts/nonverblaster/swfobject.js"},{id:"nonverblaster_js",script:ServerConfig.contextPath+"/scripts/nonverblaster/nonverblaster.js",onload:b}];window.addEvent("domready",function(){loadScripts(a)})}var ideax_js_loaded=true;
