//<script language="JavaScript" type="text/javascript">
var menu_t,Menu_Showing;
String.prototype.Replace = function(o, n) { return this.split(o).join(n); };
function getElmPos(elm) {var t=elm.offsetTop;var l=elm.offsetLeft;while((elm=elm.offsetParent)!=null){t+=elm.offsetTop;l+=elm.offsetLeft;};return [l,t];};
function getElmHeight(elm){return elm.offsetHeight;};
function getElmWidth(elm){return elm.clientWidth;};
function get_menu_object(o){while(o&&o.parentNode&&o.nodeName!="BODY"){if(o.Menu||(o.obj&&(o.obj.Name||'')=='Co_DropMenu'))return o;o=o.parentNode;}return null;}

if(typeof(window.onbeforeunload)=='function')window.__onbeforeunload=window.onbeforeunload;
window.onbeforeunload=function(){if(typeof(window.__onbeforeunload)=='function')window.__onbeforeunload();if(typeof(Co_Menu)=='object')return;Co_Menu.Close();Co_Menu=null;}
var DropMenu=function(o){this.Name="Co_DropMenu";this.TextAlign="Left";this.Dir="ltr";this.__Initialized=false;this.Use_Iframe=((navigator.userAgent.toLowerCase().indexOf('msie')!=-1));this.obj=o;this.current=null;this.previous=null;this.link_url='';this.menu_hover_class='';this.do_not_select_parent=false;this.position='bottom';this.parent=null;this.wrapper_top='';this.wrapper_bottom='';this.divider='';this.content='';this.show_name=false;this.Menus=[];if(!this.Use_Iframe)this.Init();else Co_Tools.AddEventListener(window, "load", this.Init, null, this);};
DropMenu.prototype.Init=function(){
	this.InitBehaviors();
	document.onmouseover=function(e){
		if(!e)e=window.event;
		if(Menu_Showing){
			var o=get_menu_object(e.target||e.srcElement);
			if(!o)Menu_Showing.Hide();
		}
	};
	this.__Initialized=true;
	this.GetMenu();
}
DropMenu.prototype.Add=function(o){this.Menus[this.Menus.length]=o;};
DropMenu.prototype.GetMenu=function(){if(this.obj)return this.obj;this.obj=this.obj||document.body.appendChild(document.createElement("DIV"));
	if (this.obj){
		if (this.Use_Iframe){
			if(window.parent!=window){this.obj=this.Iframe=window.parent.document.createElement("IFRAME");}else{this.obj=this.Iframe=document.createElement("IFRAME");}
			this.Iframe.src='/scripts/js/blank.html';this.obj.style.display="none";this.Iframe.scrolling='no';this.Iframe.frameBorder='0';this.Iframe.style.position='absolute';this.Iframe.style.zIndex=10000;this.Iframe.width=175;this.Iframe.height=100;this.Iframe.marginWidth=this.Iframe.margingHeight=0;
			this.Iframe.ownerDocument.body.appendChild(this.Iframe);
			this.Doc=this.Iframe.contentWindow.document;
			this.Iframe.__Initialized=false;
		};
		
		this.obj.obj=this;
		this.obj.className="co_menu_container";
	};
	return this.obj;
}
DropMenu.prototype.SetHTML=function(s) {
	var o=this.GetMenu();
	if (this.Use_Iframe) {
//		try {
			if(!this.Iframe.__Initialized){this.AppendStyles();this.Doc.body.obj=this;this.Doc.body.dir=this.Dir;this.Doc.body.onclick=Menu_OnClick;this.Doc.body.appendChild(this.Doc.createElement("DIV"));this.Iframe.__Initialized=true;}
			this.Doc.body.firstChild.innerHTML=s;o.style.display="";o.width=this.Doc.body.firstChild.offsetWidth;o.height=this.Doc.body.firstChild.offsetHeight;
//		}
//		catch(e){}
	}
	else {o.innerHTML=s;}
}
DropMenu.prototype.Hide=function(o,e){this.CompleteHide();
/*	this.CancelHide();Drop_Menu=this;menu_t=window.setTimeout(function(){if(Drop_Menu)Drop_Menu.CompleteHide(this);Drop_Menu=null;}, 500);*/
}
DropMenu.prototype.CancelHide=function(){/*if(menu_t)window.clearTimeout(menu_t);menu_t=null;Drop_Menu=null;*/}
DropMenu.prototype.CompleteHide=function(){/*menu_t=null;*/Menu_Showing=false;this.obj.style.display='none';if(!this.current)return;if (typeof(this.current.parent._Real_OnMouseOut)=='function')this.current.parent._Real_OnMouseOut();this.current.IsOpen=false;this.previous=this.current;this.current=null;}
DropMenu.prototype.InitBehaviors=function(){this.GetMenu().onmouseover=Menu_OnMouseOver;this.obj.onmouseout=Menu_OnMouseOut;this.obj.onclick=Menu_OnClick;/*for(var i=0;i<this.Menus.length;i++)this.Menus[i].InitBehaviors();*/}
DropMenu.prototype.Close=function(){for(var i=0;i<this.Menus.length;i++)this.Menus[i]=null;this.Doc=null;this.Iframe=null;}
DropMenu.prototype.AppendStyles=function(){
	if(!this.Use_Iframe)return;
	if(typeof(this.Style_Array)=="undefined")return;
	this.styles=this.Doc.createStyleSheet();
	var a=this.Style_Array;
	for(var i=0;i<a.length;i++){if(a[i][1]=="")continue;this.styles.addRule(a[i][0], a[i][1]);};
}
DropMenu.prototype.get_styleTags=function() {var styleSheets=document.styleSheets;var i,s,r=[];for(i=0;i<styleSheets.length;i++){r.push(styleSheets[i]);};s=styleSheets=null;return r;}
DropMenu.prototype.getCssTextByClassName=function(className){if(typeof(this.styleSheets)=="undefined")this.styleSheets=this.get_styleTags();className=className.toLowerCase();var s=this.styleSheets,r,rl,x,i,return_str="";for(i=0,sl=s.length;i<sl;i++){if(s[i].cssText.toLowerCase().indexOf(className)>-1){r=s[i].rules;for(x=0,rl=r.length;x<rl;x++){if (r[x].selectorText.toLowerCase()==className) return_str+= r[x].style.cssText+";";}}};return return_str;}

var Menu=function(elm, Name, obj){this.obj=(obj||Co_Menu);this.IsOpen=false;if(typeof(elm)=='string')elm=document.getElementById(elm);this.parent=elm;this.id=this.parent.id;this.Name=Name;this.menuItems=[];this.parent.Menu=this;this.parent._Real_OnMouseOver=this.parent.onmouseover;this.parent._Real_OnMouseOut=this.parent.onmouseout;this.obj.Add(this);this.InitBehaviors();}
Menu.prototype.GetPosition=function(){
this.position=getElmPos(this.parent);
if(window.parent!=window){var t=getElmPos(window.frameElement);this.position[0]+=t[0];this.position[1]+=t[1];}
switch(this.obj.position.toLowerCase()){case "right":this.position[0]+=getElmWidth(this.parent);break;
case"bottom":this.position[1]+=getElmHeight(this.parent);if (this.obj.Dir=="rtl")this.position[0]-=(getElmWidth(this.Menu)-getElmWidth(this.parent));break;
};

}
Menu.prototype.AddItem=Menu.prototype.addItem=function(menu_text, menu_link, target) {this.menuItems[this.menuItems.length]={Text:menu_text,Link:menu_link,Target:(target?target:"_self")};};
Menu.prototype.Show=function(o,e){
	if (!this.obj.__Initialized&&this.obj.Use_Iframe) {if(document.readyState=="complete")this.obj.Init();else return;}
	if(this.obj.current&&this.obj.current!=this){if (typeof(this.obj.current.parent._Real_OnMouseOut)=='function')this.obj.current.parent._Real_OnMouseOut();}
	if(!this.obj)return;this.obj.current=this;this.obj.CancelHide();
	this.Menu=this.obj.GetMenu();if(this.obj.Use_Iframe){if(this.obj.Doc.readyState!='complete')return;};this.Generate();
	/*if (!this.position)*/this.GetPosition();
	this.Menu.style.top=this.position[1]+"px";this.Menu.style.left=this.position[0]+"px";
	
	this.Menu.style.display='';
	Menu_Showing=this.obj;this.IsOpen=true;
	if(this.obj.menu_hover_class!=''&&!this.obj.do_not_select_parent) {this.parent._Real_ClassName=this.parent.className;this.parent.className=this.obj.menu_hover_class;};
	if(this.obj.Iframe){var o=this.obj.Doc.body;while(o=o.firstChild)if(o.clientWidth>0)break;if(o)this.obj.Iframe.width=o.clientWidth;}
}
Menu.prototype.InitBehaviors=function(){this.parent.onmouseover=MenuParent_OnMouseOver;this.parent.onmouseout=MenuParent_OnMouseOut;}
Menu.prototype.ItemClick=function(o,e){var item_clicked=e.target||e.srcElement;if(item_clicked.nodeName=="A") {if (this.obj.Iframe){if(item_clicked.target == "" && item_clicked.href!="#" && item_clicked.href.indexOf("javascript:") == -1){document.location.href=item_clicked.href;return false;}};return;};item_clicked=this.GetMenuItem(item_clicked);if(item_clicked==null)return;if(item_clicked.firstChild.nodeName=="A"&&typeof(item_clicked.firstChild.click)=='function'){item_clicked.firstChild.click();return;};var OnClickAction=item_clicked.onclick||item_clicked.firstChild.onclick;var href=item_clicked.href||item_clicked.firstChild.href;var target=item_clicked.target||item_clicked.firstChild.target;if(typeof(OnClickAction)=='function'){OnClickAction();return;};if(typeof(href)=='string')window.open(href, (target&&target!=''?target:'_self'));}
Menu.prototype.GetMenuItem=function(o){var menu_item=o;while(o&&o!=this.obj.obj&&o.nodeName!="BODY"){if(o.nodeName=="DIV")return o;if(o.nodeName=="TABLE")return menu_item;o=o.parentNode;};return null;}
Menu.prototype.IsOpened=function(){return this.IsOpen;}
Menu.prototype.Generate=function(){
	var s_html='';
	if (!this.content) {
		s_html=this.obj.wrapper_top.Replace('MENU_ID', this.id);
	  var content_html='';
	  
	  var style_suffix='';
		if (this.parent)if(this.parent.getAttribute("style_suffix")!="")style_suffix=this.parent.getAttribute("style_suffix");
	
	  var menu_wrapper=this.obj.content.Replace('MENU_ID', this.id);
		var MenuItems=this.menuItems;
		for (var i=0;i<MenuItems.length;i++) {
		  if (MenuItems[i].Text!=''&&typeof(MenuItems[i])!='function') {
				content_html+=menu_wrapper.Replace('ITEM_LINK', this.obj.link_url+MenuItems[i].Link);
				content_html=content_html.Replace('MENU_TEXT', MenuItems[i].Text); 
				content_html=content_html.Replace('ITEM_TARGET', MenuItems[i].Target);
		  }
			if(i<MenuItems.length-1)content_html+=this.obj.divider;
		}
		MenuItems=null;
		s_html+=content_html;
		s_html+=this.obj.wrapper_bottom;
		s_html=s_html.Replace("<<STYLE_SUFFIX>>", style_suffix);
		
		this.content=s_html;
	}
	this.obj.SetHTML(this.content);
}

function MenuParent_OnMouseOver(e){if(typeof(this._Real_OnMouseOver)=='function')this._Real_OnMouseOver();if(!e)e=window.event;this.Menu.Show(this,e);}
function MenuParent_OnMouseOut(e){if(typeof(this.Menu)=="object"&&!this.Menu.obj.__Initialized){if(typeof(this._Real_OnMouseOut)=='function')this._Real_OnMouseOut();}/*if(!e)e=window.event;this.Menu.Hide(this,e);*/}
function Menu_OnMouseOver(e){if(this.obj&&this.obj.current)this.obj.CancelHide();}
function Menu_OnMouseOut(e){if(!e)e=window.event;if (Co_Menu.Use_Iframe){this.contentWindow.document.body.obj.Hide(this, e);}}
function Menu_OnClick(e){if (!e)e=window.event||this.document.parentWindow.event;if (typeof(this.obj)!='undefined'&&this.obj.current);this.obj.current.ItemClick(this, e);}
var Co_Menu=new DropMenu();


//</script>