/*	JSCookMenu v1.4.3.  (c) Copyright 2002-2005 by Heng Yuan
	Permission is hereby granted, free of charge, to any person obtaining a
	copy of this software and associated documentation files (the "Software"),
	to deal in the Software without restriction, including without limitation
	the rights to use, copy, modify, merge, publish, distribute, sublicense,
	and/or sell copies of the Software, and to permit persons to whom the
	Software is furnished to do so, subject to the following conditions:
	The above copyright notice and this permission notice shall be included
	in all copies or substantial portions of the Software.
	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	ITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
	FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
	DEALINGS IN THE SOFTWARE.
*/
var _cmIDCount=0;var _cmIDName="cmSubMenuID";var _cmTimeOut=null;var _cmCurrentItem=null;var _cmNoAction=new Object();var _cmNoClick=new Object();var _cmSplit=new Object();var _cmItemList=new Array();var _cmNodeProperties={mainFolderLeft:"",mainFolderRight:"",mainItemLeft:"",mainItemRight:"",folderLeft:"",folderRight:"",itemLeft:"",itemRight:"",mainSpacing:0,subSpacing:0,delay:500,clickOpen:1};function cmNewID(){return _cmIDName+(++_cmIDCount)}function cmActionItem(j,d,h,g,c,k){var b=_cmNodeProperties.clickOpen;if(k.clickOpen){b=k.clickOpen}_cmItemList[_cmItemList.length]=j;var e=_cmItemList.length-1;g=(!g)?"null":("'"+g+"'");c="'"+c+"'";d="'"+d+"'";var f=(b==3)||(b==2&&h);var a;if(f){a=' onmouseover="cmItemMouseOver (this,'+d+","+h+","+g+","+e+')" onmousedown="cmItemMouseDownOpenSub (this,'+e+","+d+","+c+","+g+')"'}else{a=' onmouseover="cmItemMouseOverOpenSub (this,'+d+","+h+","+g+","+c+","+e+')" onmousedown="cmItemMouseDown (this,'+e+')"'}return a+' onmouseout="cmItemMouseOut (this,'+k.delay+')" onmouseup="cmItemMouseUp (this,'+e+')"'}function cmNoClickItem(f,g,c,b,e,a){_cmItemList[_cmItemList.length]=f;var d=_cmItemList.length-1;b=(!b)?"null":("'"+b+"'");e="'"+e+"'";g="'"+g+"'";return' onmouseover="cmItemMouseOver (this,'+g+","+c+","+b+","+d+')" onmouseout="cmItemMouseOut (this,'+a.delay+')"'}function cmNoActionItem(a,b){return a[1]}function cmSplitItem(prefix,isMain,vertical){var classStr="cm"+prefix;if(isMain){classStr+="Main";if(vertical){classStr+="HSplit"}else{classStr+="VSplit"}}else{classStr+="HSplit"}return eval(classStr)}function cmDrawSubMenu(e,g,a,d,m){var j='<div class="'+g+'SubMenu" id="'+a+'"><table summary="sub menu" cellspacing="'+m.subSpacing+'" class="'+g+'SubMenuTable">';var h="";var l;var k;var b;var f;var c;for(f=5;f<e.length;++f){l=e[f];if(!l){continue}b=(l.length>5);k=b?cmNewID():null;if(l==_cmSplit){l=cmSplitItem(g,0,true)}j+='<tr class="'+g+'MenuItem"';if(l[0]!=_cmNoClick){j+=cmActionItem(l,g,0,k,d,m)}else{j+=cmNoClickItem(l,g,0,k,d,m)}j+=">";if(l[0]==_cmNoAction||l[0]==_cmNoClick){j+=cmNoActionItem(l,g);j+="</tr>";continue}c=g+"Menu";c+=b?"Folder":"Item";j+='<td class="'+c+'Left">';if(l[0]!=null){j+=l[0]}else{j+=b?m.folderLeft:m.itemLeft}j+='</td><td class="'+c+'Text">'+l[1];j+='</td><td class="'+c+'Right">';if(b){j+=m.folderRight;h+=cmDrawSubMenu(l,g,k,d,m)}else{j+=m.itemRight}j+="</td></tr>"}j+="</table></div>"+h;return j}function cmDraw(a,b,g,q,k){var j=cmGetObject(a);if(!q){q=_cmNodeProperties}if(!k){k=""}var n='<table summary="main menu" class="'+k+'Menu" cellspacing="'+q.mainSpacing+'">';var l="";if(!g){g="hbr"}var e=String(g);var m;var d;if(e.charAt(0)=="h"){m="v"+e.substr(1,2);n+="<tr>";d=false}else{m="v"+e.substr(1,2);d=true}var h;var p;var o;var c;var f;for(h=0;h<b.length;++h){p=b[h];if(!p){continue}n+=d?"<tr":"<td";n+=' class="'+k+'MainItem"';c=(p.length>5);o=c?cmNewID():null;n+=cmActionItem(p,k,1,o,g,q)+">";if(p==_cmSplit){p=cmSplitItem(k,1,d)}if(p[0]==_cmNoAction||p[0]==_cmNoClick){n+=cmNoActionItem(p,k);n+=d?"</tr>":"</td>";continue}f=k+"Main"+(c?"Folder":"Item");n+=d?"<td":"<span";n+=' class="'+f+'Left">';n+=(p[0]==null)?(c?q.mainFolderLeft:q.mainItemLeft):p[0];n+=d?"</td>":"</span>";n+=d?"<td":"<span";n+=' class="'+f+'Text">';n+=p[1];n+=d?"</td>":"</span>";n+=d?"<td":"<span";n+=' class="'+f+'Right">';n+=c?q.mainFolderRight:q.mainItemRight;n+=d?"</td>":"</span>";n+=d?"</tr>":"</td>";if(c){l+=cmDrawSubMenu(p,k,o,m,q)}}if(!d){n+="</tr>"}n+="</table>"+l;j.innerHTML=n}function cmDrawFromText(g,b,a,d){var e=cmGetObject(g);var f=null;for(var c=e.firstChild;c;c=c.nextSibling){if(!c.tagName||c.tagName.toLowerCase()!="ul"){continue}f=cmDrawFromTextSubMenu(c);break}if(f){cmDraw(g,f,b,a,d)}}function cmDrawFromTextSubMenu(f){var b=new Array();for(var e=f.firstChild;e;e=e.nextSibling){if(!e.tagName||e.tagName.toLowerCase()!="li"){continue}if(e.firstChild==null){b[b.length]=_cmSplit;continue}var d=new Array();var c=e.firstChild;for(;c;c=c.nextSibling){if(!c.tagName||c.tagName.toLowerCase()!="span"){continue}if(!c.firstChild){d[0]=null}else{d[0]=c.innerHTML}break}if(!c){continue}for(;c;c=c.nextSibling){if(!c.tagName||c.tagName.toLowerCase()!="a"){continue}d[1]=c.innerHTML;d[2]=c.href;d[3]=c.target;d[4]=c.title;if(d[4]==""){d[4]=null}break}for(;c;c=c.nextSibling){if(!c.tagName||c.tagName.toLowerCase()!="ul"){continue}var a=cmDrawFromTextSubMenu(c);for(i=0;i<a.length;++i){d[i+5]=a[i]}break}b[b.length]=d}return b}function cmItemMouseOver(b,d,k,j,e){clearTimeout(_cmTimeOut);if(!b.cmPrefix){b.cmPrefix=d;b.cmIsMain=k}var a=cmGetThisMenu(b,d);if(!a.cmItems){a.cmItems=new Array()}var c;for(c=0;c<a.cmItems.length;++c){if(a.cmItems[c]==b){break}}if(c==a.cmItems.length){a.cmItems[c]=b}if(_cmCurrentItem){if(_cmCurrentItem==b||_cmCurrentItem==a){var l=_cmItemList[e];cmSetStatus(l);return}var h=_cmCurrentItem.cmPrefix;var g=cmGetThisMenu(_cmCurrentItem,h);if(g!=a.cmParentMenu){if(_cmCurrentItem.cmIsMain){_cmCurrentItem.className=h+"MainItem"}else{_cmCurrentItem.className=h+"MenuItem"}if(g.id!=j){cmHideMenu(g,a,h)}}}_cmCurrentItem=b;cmResetMenu(a,d);var l=_cmItemList[e];var f=cmIsDefaultItem(l);if(f){if(k){b.className=d+"MainItemHover"}else{b.className=d+"MenuItemHover"}}cmSetStatus(l)}function cmItemMouseOverOpenSub(g,f,b,a,e,d){cmItemMouseOver(g,f,b,a,d);if(a){var c=cmGetObject(a);cmShowSubMenu(g,f,c,e)}}function cmItemMouseOut(a,b){if(!b){b=_cmNodeProperties.delay}_cmTimeOut=window.setTimeout("cmHideMenuTime ()",b);window.defaultStatus=""}function cmItemMouseDown(b,a){if(cmIsDefaultItem(_cmItemList[a])){if(b.cmIsMain){b.className=b.cmPrefix+"MainItemActive"}else{b.className=b.cmPrefix+"MenuItemActive"}}}function cmItemMouseDownOpenSub(f,d,e,c,a){cmItemMouseDown(f,d);if(a){var b=cmGetObject(a);cmShowSubMenu(f,e,b,c)}}function cmItemMouseUp(h,a){var c=_cmItemList[a];var b=null,g="_self";if(c.length>2){b=c[2]}if(c.length>3&&c[3]){g=c[3]}if(b!=null){window.open(b,g)}var f=h.cmPrefix;var e=cmGetThisMenu(h,f);var d=(c.length>5);if(!d){if(cmIsDefaultItem(c)){if(h.cmIsMain){h.className=f+"MainItem"}else{h.className=f+"MenuItem"}}cmHideMenu(e,null,f)}else{if(cmIsDefaultItem(c)){if(h.cmIsMain){h.className=f+"MainItemHover"}else{h.className=f+"MenuItemHover"}}}}function cmMoveSubMenu(e,a,b){var f=String(b);var d=a.offsetParent;var c=cmGetWidth(a);var g=cmGetHorizontalAlign(e,f,d,c);if(f.charAt(0)=="h"){if(f.charAt(1)=="b"){a.style.top=(cmGetYAt(e,d)+cmGetHeight(e))+"px"}else{a.style.top=(cmGetYAt(e,d)-cmGetHeight(a))+"px"}if(g=="r"){a.style.left=(cmGetXAt(e,d))+"px"}else{a.style.left=(cmGetXAt(e,d)+cmGetWidth(e)-c)+"px"}}else{if(g=="r"){a.style.left=(cmGetXAt(e,d)+cmGetWidth(e))+"px"}else{a.style.left=(cmGetXAt(e,d)-c)+"px"}if(f.charAt(1)=="b"){a.style.top=(cmGetYAt(e,d))+"px"}else{a.style.top=(cmGetYAt(e,d)+cmGetHeight(e)-cmGetHeight(a))+"px"}}}function cmGetHorizontalAlign(f,g,e,c){var h=g.charAt(2);if(!(document.body)){return h}var a=document.body;var b;var d;if(window.innerWidth){b=window.pageXOffset;d=window.innerWidth+b}else{if(a.clientWidth){b=a.clientLeft;d=a.clientWidth+b}else{return h}}if(g.charAt(0)=="h"){if(h=="r"&&(cmGetXAt(f)+c)>d){h="l"}if(h=="l"&&(cmGetXAt(f)+cmGetWidth(f)-c)<b){h="r"}return h}else{if(h=="r"&&(cmGetXAt(f,e)+cmGetWidth(f)+c)>d){h="l"}if(h=="l"&&(cmGetXAt(f,e)-c)<b){h="r"}return h}}function cmShowSubMenu(e,d,a,b){if(!a.cmParentMenu){var c=cmGetThisMenu(e,d);a.cmParentMenu=c;if(!c.cmSubMenu){c.cmSubMenu=new Array()}c.cmSubMenu[c.cmSubMenu.length]=a}cmMoveSubMenu(e,a,b);a.style.visibility="visible";if(document.all){if(!a.cmOverlap){a.cmOverlap=new Array()}cmHideControl("IFRAME",a);cmHideControl("SELECT",a);cmHideControl("OBJECT",a)}}function cmResetMenu(d,c){if(d.cmItems){var b;var e;var a=d.cmItems;for(b=0;b<a.length;++b){if(a[b].cmIsMain){e=c+"MainItem"}else{e=c+"MenuItem"}if(a[b].className!=e){a[b].className=e}}}}function cmHideMenuTime(){if(_cmCurrentItem){var a=_cmCurrentItem.cmPrefix;cmHideMenu(cmGetThisMenu(_cmCurrentItem,a),null,a);_cmCurrentItem=null}}function cmHideMenu(d,c,b){var e=b+"SubMenu";if(d.cmSubMenu){var a;for(a=0;a<d.cmSubMenu.length;++a){cmHideSubMenu(d.cmSubMenu[a],b)}}while(d&&d!=c){cmResetMenu(d,b);if(d.className==e){d.style.visibility="hidden";cmShowControl(d)}else{break}d=cmGetThisMenu(d.cmParentMenu,b)}}function cmHideSubMenu(c,b){if(c.style.visibility=="hidden"){return}if(c.cmSubMenu){var a;for(a=0;a<c.cmSubMenu.length;++a){cmHideSubMenu(c.cmSubMenu[a],b)}}cmResetMenu(c,b);c.style.visibility="hidden";cmShowControl(c)}function cmHideControl(d,e){var l=cmGetX(e);var k=cmGetY(e);var m=e.offsetWidth;var j=e.offsetHeight;var g;for(g=0;g<document.all.tags(d).length;++g){var f=document.all.tags(d)[g];if(!f||!f.offsetParent){continue}var b=cmGetX(f);var a=cmGetY(f);var c=f.offsetWidth;var n=f.offsetHeight;if(b>(l+m)||(b+c)<l){continue}if(a>(k+j)||(a+n)<k){continue}if(f.style.visibility=="hidden"){continue}e.cmOverlap[e.cmOverlap.length]=f;f.style.visibility="hidden"}}function cmShowControl(a){if(a.cmOverlap){var b;for(b=0;b<a.cmOverlap.length;++b){a.cmOverlap[b].style.visibility=""}}a.cmOverlap=null}function cmGetThisMenu(d,c){var b=c+"SubMenu";var a=c+"Menu";while(d){if(d.className==b||d.className==a){return d}d=d.parentNode}return null}function cmIsDefaultItem(a){if(a==_cmSplit||a[0]==_cmNoAction||a[0]==_cmNoClick){return false}return true}function cmGetObject(a){if(document.all){return document.all[a]}return document.getElementById(a)}function cmGetWidth(b){var a=b.offsetWidth;if(a>0||!cmIsTRNode(b)){return a}if(!b.firstChild){return 0}return b.lastChild.offsetLeft-b.firstChild.offsetLeft+cmGetWidth(b.lastChild)}function cmGetHeight(b){var a=b.offsetHeight;if(a>0||!cmIsTRNode(b)){return a}if(!b.firstChild){return 0}return b.firstChild.offsetHeight}function cmGetX(b){var a=0;do{a+=b.offsetLeft;b=b.offsetParent}while(b);return a}function cmGetXAt(b,c){var a=0;while(b&&b!=c){a+=b.offsetLeft;b=b.offsetParent}if(b==c){return a}return a-cmGetX(c)}function cmGetY(a){var b=0;do{b+=a.offsetTop;a=a.offsetParent}while(a);return b}function cmIsTRNode(b){var a=b.tagName;return a=="TR"||a=="tr"||a=="Tr"||a=="tR"}function cmGetYAt(b,d){var c=0;if(!b.offsetHeight&&cmIsTRNode(b)){var a=b.parentNode.firstChild;b=b.firstChild;c-=a.firstChild.offsetTop}while(b&&b!=d){c+=b.offsetTop;b=b.offsetParent}if(b==d){return c}return c-cmGetY(d)}function cmSetStatus(a){var b="";if(a.length>4){b=(a[4]!=null)?a[4]:(a[2]?a[2]:b)}else{if(a.length>2){b=(a[2]?a[2]:b)}}window.defaultStatus=b}function cmGetProperties(b){if(b==undefined){return"undefined"}if(b==null){return"null"}var c=b+":\n";var a;for(a in b){c+=a+" = "+b[a]+"; "}return c};