$(document).ready(function(){$("a[href='#']").click(function(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}});});function actTab(e,tab,area,url){$(tab).siblings("a").removeClass();$(tab).addClass("on");$("#"+area).height($("#"+area).outerHeight());$("#"+area).empty().html("<img src='./img/loading.gif'>").load("w.do?cmd=preview_objects_ajax&o="+url,function(response,status,xhr){if(status=="error"){var msg="Sorry but there was an error:";
$("#"+area).html(msg+xhr.status+" "+xhr.statusText);}else{$("#"+area).height("auto");}});}function loadAndInitFancy(divName,ctx,url){$("#"+divName).empty().html("<img src='"+ctx+"/img/loading.gif'>");$("#"+divName).load(url,function(){initFancy();});}var isSafari=true;var isMoz=false;var isIE=false;var GLASSFRAME;
var POPUP;if(navigator.userAgent.indexOf("Safari")>0){isSafari=true;isMoz=false;isIE=false;}else{if(navigator.product=="Gecko"){isSafari=false;isMoz=true;isIE=false;}else{isSafari=false;isMoz=false;isIE=true;}}function liveUpdater(uriFunc,constructPostParamsFunc,postFunc,preFunc){if(!postFunc){postFunc=function(){};
}if(!preFunc){preFunc=function(){};}return createLiveUpdaterFunction(uriFunc,constructPostParamsFunc,postFunc,preFunc);}function recreateTR(parentElement,subtree){var i;for(i=parentElement.childNodes.length-1;i>=0;i--){parentElement.removeChild(parentElement.childNodes[i]);}for(i=0;i<subtree.childNodes.length;
i++){var cell=document.createElement(subtree.childNodes[i].nodeName);cell.innerHTML=flattenChildren(subtree.childNodes[i].childNodes);parentElement.appendChild(cell);}}function createLiveUpdaterFunction(uriFunc,constructPostParamsFunc,postFunc,preFunc){var request=false;if(window.XMLHttpRequest){request=new XMLHttpRequest();
}function update(){if(request&&request.readyState<4){request.abort();}if(!window.XMLHttpRequest){request=new ActiveXObject("Microsoft.XMLHTTP");}preFunc();request.open("POST",uriFunc(),true);request.onreadystatechange=processRequestChange;request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
request.setRequestHeader("Accept-Charset","utf-8");request.send(constructPostParamsFunc());return true;}function processRequestChange(){if(request.readyState==4){var xmlDoc=request.responseXML;var body=xmlDoc.getElementsByTagName("body");if(body.length>0){var nodes=body[0].childNodes;for(var i=0;i<nodes.length;
i++){if(nodes[i].nodeType==1){if(isIE&&nodes[i].nodeName=="tr"){recreateTR(POPUP,nodes[i]);}else{POPUP.innerHTML=flattenChildren(nodes[i].childNodes);}}}}postFunc();}}return update;}function autocomplete(id,uri,focus){var inputField=document.getElementById(id);var options=new Array();var current=-1;var initialValue="";
createPopupDivOnce();createGlassFrameOnce();function constructUri(){return uri;}function constructPostParams(){return"s="+inputField.value;}function hidePopup(){POPUP.style.visibility="hidden";if(GLASSFRAME){GLASSFRAME.style.display="none";GLASSFRAME.style.visibility="hidden";}}function handlePopupOver(){removeListener(inputField,"blur",hidePopup);
}function handlePopupOut(){if(POPUP.style.visibility=="visible"){addListener(inputField,"blur",hidePopup);}}function handleClick(e){inputField.value=transformLine(eventElement(e).innerHTML);POPUP.style.visibility="hidden";if(GLASSFRAME){GLASSFRAME.style.display="none";GLASSFRAME.style.visibility="hidden";
}focusAndSetCaret(inputField);}function handleOver(e){if(current>=0&&options[current]){options[current].className="";}current=eventElement(e).index;if(current>=0&&options[current]){options[current].className="selectedAC";}}function postFunc(){current=-1;initialValue=inputField.value;options=POPUP.getElementsByTagName("li");
if((options&&options.length>1)||(options&&options.length==1&&transformLine(options[0].innerHTML)!=inputField.value)){setPopupStyles();for(var i=0;i<options.length;i++){options[i].index=i;addOptionHandlers(options[i]);}}else{POPUP.style.visibility="hidden";if(GLASSFRAME){GLASSFRAME.style.display="none";
GLASSFRAME.style.visibility="hidden";}}}function preFunc(){}function setPopupStyles(){var popupBorder=1;var newPopupTop=mytop(inputField)+inputField.offsetHeight;var newPopupLeft=myleft(inputField)+popupBorder;var newPopupWidth=inputField.offsetWidth-2*popupBorder;if(newPopupWidth<150){newPopupWidth=150;
}var maxHeight;if(isIE){maxHeight=250;}else{maxHeight=window.outerHeight/3;}if(POPUP.offsetHeight<maxHeight){POPUP.style.overflow="hidden";}else{if(isMoz){POPUP.style.maxHeight=maxHeight+"px";POPUP.style.overflow="-moz-scrollbars-vertical";}else{POPUP.style.height=maxHeight+"px";POPUP.style.overflowY="auto";
}}POPUP.scrollTop=0;POPUP.style.top=newPopupTop+"px";POPUP.style.left=newPopupLeft+"px";POPUP.style.width=newPopupWidth+"px";POPUP.style.visibility="visible";if(GLASSFRAME){GLASSFRAME.style.top=newPopupTop+"px";GLASSFRAME.style.left=newPopupLeft+"px";GLASSFRAME.style.height=POPUP.offsetHeight+"px";GLASSFRAME.style.width=(newPopupWidth+2*popupBorder)+"px";
GLASSFRAME.style.display="block";GLASSFRAME.style.visibility="visible";}}function addOptionHandlers(option){addListener(option,"click",handleClick);addListener(option,"mouseover",handleOver);}var updater=liveUpdater(constructUri,constructPostParams,postFunc,preFunc);var timeout=false;function start(e){var event=e||window.event;
if(timeout){window.clearTimeout(timeout);}if(event.keyCode==38){if(current>=0&&options[current]){options[current].className="";}current=current>=0?current-1:options.length-1;if(current==-1){inputField.value=initialValue;}if(current>=0&&options[current]){options[current].className="selectedAC";inputField.value=transformLine(options[current].innerHTML);
}}else{if(event.keyCode==40){if(current>=0&&options[current]){options[current].className="";}current=current<options.length-1?current+1:-1;if(current==-1){inputField.value=initialValue;}if(current>=0&&options[current]){options[current].className="selectedAC";inputField.value=transformLine(options[current].innerHTML);
}}else{if((event.keyCode==13||event.keyCode==9)&&current>=0&&POPUP.style.visibility=="visible"){inputField.value=transformLine(options[current].innerHTML);POPUP.style.visibility="hidden";if(GLASSFRAME){GLASSFRAME.style.display="none";GLASSFRAME.style.visibility="hidden";}if(isIE){event.returnValue=false;
}else{event.preventDefault();}if(event.stopPropagation){event.stopPropagation();}else{event.cancelBubble=true;}}else{if((event.keyCode==27)&&POPUP.style.visibility=="visible"){POPUP.style.visibility="hidden";if(GLASSFRAME){GLASSFRAME.style.display="none";GLASSFRAME.style.visibility="hidden";}if(isIE){event.returnValue=false;
}else{event.preventDefault();}if(event.stopPropagation){event.stopPropagation();}else{event.cancelBubble=true;}}else{timeout=window.setTimeout(updater,300);}}}}}addKeyListener(inputField,start);addListener(POPUP,"mouseover",handlePopupOver);addListener(POPUP,"mouseout",handlePopupOut);if(focus!="nofocus"){focusAndSetCaret(inputField);
}}function focusAndSetCaret(oField){oField.focus();oField.value=oField.value;}function transformLine(txt){return txt.replace(/<\/?b>/gi,"");}function eventElement(event){var el=isMoz?event.currentTarget:event.srcElement;var elName=el.tagName.toLowerCase();if(elName=="b"||elName=="i"){el=el.parentNode;
}return el;}function addKeyListener(element,listener){if(isSafari){element.addEventListener("keydown",listener,false);}else{if(isMoz){element.addEventListener("keypress",listener,false);}else{element.attachEvent("onkeydown",listener);}}}function addListener(element,type,listener){if(element.addEventListener){element.addEventListener(type,listener,false);
}else{element.attachEvent("on"+type,listener);}}function removeListener(element,type,listener){if(element.removeEventListener){element.removeEventListener(type,listener,false);}else{element.detachEvent("on"+type,listener);}}function flatten(node){if(node.nodeType==1){return"<"+node.nodeName+flattenAttributes(node)+">"+flattenChildren(node.childNodes)+"</"+node.nodeName+">";
}else{if(node.nodeType==3){return node.nodeValue;}else{return"";}}}function flattenAttributes(node){var buffer="";for(var i=0;i<node.attributes.length;i++){var attribute=node.attributes[i];buffer+=" "+attribute.name+'="'+attribute.value+'"';}return buffer;}function flattenChildren(nodes){var buffer="";
if(nodes.length>0){for(var i=0;i<nodes.length;i++){buffer+=flatten(nodes[i]);}}return buffer;}function myleft(elem){var o=elem,r=o.offsetLeft;while(o=o.offsetParent){r+=o.offsetLeft;}return r;}function mytop(elem){var o=elem,r=o.offsetTop;while(o=o.offsetParent){r+=o.offsetTop;}return r;}function createPopupDivOnce(){if(!POPUP){POPUP=document.createElement("div");
POPUP.setAttribute("class","autocomplete");POPUP.setAttribute("className","autocomplete");document.body.appendChild(POPUP);}}function createGlassFrameOnce(){if(isIE&&!GLASSFRAME){GLASSFRAME=document.createElement("iframe");GLASSFRAME.setAttribute("class","autocompletefrm");GLASSFRAME.setAttribute("className","autocompletefrm");
document.body.appendChild(GLASSFRAME);}}function goToUrl(theUrl){location.href=theUrl;}function goToNew(theUrl){window.open(theUrl);}function showRelated(elem,icon,path1,path2){var el=document.getElementById(elem);if(el.style.height!="auto"){el.style.height="auto";icon.src=path1;}else{el.style.height="2em";
icon.src=path2;}}function confirmDelete(txt){return window.confirm(txt);}function lttrCount(max,id,el){document.getElementById(id).value=max-el.value.length;}var timeout=500;var closetimer=0;var ddmenuitem=0;function jsddm_open(){if($(this).find("ul").length>0){jsddm_canceltimer();jsddm_close();ddmenuitem=$(this).find("ul").show();
var l;if(ddmenuitem.offset().left+ddmenuitem.outerWidth()>$(document).width()){l=$(this).outerWidth()-ddmenuitem.outerWidth();}ddmenuitem.css("left",l+"px");}}function jsddm_close(){if(ddmenuitem){ddmenuitem.hide();}}function jsddm_timer(){closetimer=window.setTimeout(jsddm_close,timeout);}function jsddm_canceltimer(){if(closetimer){window.clearTimeout(closetimer);
closetimer=null;}}$(document).ready(function(){$(".tab > li, .ddmenu > li").bind("mouseover",jsddm_open);$(".tab > li, .ddmenu > li").bind("mouseout",jsddm_timer);});document.onclick=jsddm_close;$(document).ready(function(){$(".remark").focusout(function(){$(this).removeClass("gray i");if(!$(this).val()){$(this).val($(this).attr("alt"));
$(this).addClass("gray i");}});$(".remark").focusin(function(){if($(this).val()==$(this).attr("alt")){$(this).val("");$(this).removeClass("gray i");}});$(".remark").focusout();$("form").submit(function(){$(this).find(".remark").each(function(){if($(this).val()==$(this).attr("alt")){$(this).val("");$(this).removeClass("gray");
}});});});$(document).ready(function(){$(".item .i1 img:not([src*=null])").hover(function(){$(this).parents("div.i1").css({"width":$(this).outerWidth(true),"height":$(this).outerHeight(true),"z-index":"1000"});$(this).addClass("hover").stop().animate({width:"200px",height:"200px"},200);},function(){$(this).removeClass("hover").stop().animate({width:"100px",height:"100px"},400,function(){$(this).parents("div.i1").css({"z-index":"0"});
});});});this.mytip=function(){this.xOffset=15;this.yOffset=10;$(".tip").unbind().hover(function(e){this.title="";if($("#mytip").size()){$("p#mytip").fadeOut("slow").remove();}if($(this).next().hasClass("dn")){$("body").append('<p id="mytip">'+$(this).next().html()+"</p>");position(e,this);$("p#mytip").fadeIn("slow");
}},function(){$("p#mytip").fadeOut("slow").remove();}).mousemove(function(e){position(e,this);});function position(e,el){el.top=(e.pageY+yOffset);var a=xOffset+$("#mytip").outerWidth();if(e.pageX+a>$(document).width()){el.left=(e.pageX-a>0)?(e.pageX-a):0;}else{el.left=(e.pageX+xOffset);}$("p#mytip").css("top",el.top+"px").css("left",el.left+"px");
}$("input[class$='tip']").unbind().focus(function(){this.title="";if($(this).next().hasClass("dn")){$("body").append('<p id="mytip">'+$(this).next().html()+"</p>");var pos=$(this).offset();var t=(pos.top);var l=(pos.left+$(this).outerWidth()+6);if(l+$("p#mytip").outerWidth()>$(document).width()){l=pos.left-$("#mytip").outerWidth()-6;
}$("p#mytip").css("top",t+"px").css("left",l+"px").fadeIn("slow");}}).blur(function(){$("p#mytip").fadeOut("slow").remove();});};jQuery(document).ready(function($){mytip();});function print_popup(title){var w=window.open("w.do?cmd=print",title,"width=700,height=800,resizeable,scrollbars");w.document.close();
}
