__rootPath=__rootPath.replace(/\\/gi,"/");
document.write([
 '<script src="'+__rootPath+'/Scripts/jquery.bgiframe.js" type="text/javascript"></script>'
,'<style type="text/css">.sub-menu{display:none;position:absolute;z-index:10000;}.over,.seo-hide{display:none;}</style>'
//,'<!--[if IE 6]><script src="'+__rootPath+'/Scripts/DD_belatedPNG.js" type="text/javascript"></script><script type="text/javascript">$(function(){DD_belatedPNG.fix("img,div");});</script><![endif]-->'
].join(''));
$(function(){
	var actions = {
		"x-main-menu":function(_this){
			var opt=_this.attr("opt");
			if(typeof(opt)=="string"&&$.trim(opt)!=""){
				var index=parseInt(opt);
				var img=$("#main-menu td:eq("+(index+1)+") img",_this);
				var src=img.attr("src");
				img.addClass("selected").attr("src",src.replace("_non.","_over."));
			}
			$("#main-menu td a",_this).each(function(){
				var a=$(this);
				var rel=a.attr("rel");
				if(rel){
					a.after($("#"+rel));
					a.parent().addClass("menu-ct");
				}
			});
			$(".menu-ct").mouseover(function(){
				$(".menu-ct>table").hide();
				var offset = $(this).addClass("menu-over").offset();
				var el=$(">table",$(this));
				var w=0,h=0,w2=0,h2=0;
				if($.browser.msie&&$.browser.version>=8){
					w=0;
					h=2;
					w2=2;
					h2=2;
				}
				if(el.is(".align-right")){
					/*el.css({
						left:((offset.left+$(this).width()+6+w2)-el.width())+"px",
						top:(offset.top+$(this).height()-7+h2)+"px"
					}).bgiframe({width:el.width(),height:el.height()}).show();*/
					el.css({
						left:(offset.left-53+w)+"px",
						top:(offset.top+$(this).height()-0+h)+"px"
					}).bgiframe({width:el.width(),height:el.height()}).show();
				}else{
					el.css({
						left:(offset.left-6+w)+"px",
						top:(offset.top+$(this).height()-0+h)+"px"
					}).bgiframe({width:el.width(),height:el.height()}).show();
				}
				var img=$(">a>img",$(this));
				var src=img.attr("src");
				img.attr("src",src.replace("_non.","_over."));
			}).mouseout(function(){
				var _xthis=this;
				$(this).removeClass("menu-over");
				setTimeout(function(){
					if(!$(_xthis).is(".menu-over")){
						$(">table",$(_xthis)).hide();
						var img=$(">a>img",$(_xthis));
						if(!img.is(".selected")){
							var src=img.attr("src");
							img.attr("src",src.replace("_over.","_non."));
						}
					}
				},0);
			});
		}
	};
	var dynItems = $(".dyn-include");
	var dynCount = 0;
	dynItems.each(function(){
		var o=$(this);
		if($.trim(o.html())==""){
			var url = o.attr("id");
			var rd=Math.round(Math.random()*10000);
			url = (url.toLowerCase().indexOf(".")!=-1)?url:url+".html?_rd="+rd;
			$.get(__rootPath+"/"+url,function(html){
				if($.browser.msie&&$.browser.version<=6){
					html=html.replace(/\.png/gi,".jpg");
					html=html.replace(/tb_(.{2})\.jpg/gi,"tb_$1.gif");
				}
				o.append(html.replace(/_root_/gi,__rootPath));
				var act=o.attr("act");
				if(typeof(act)=="string"&&$.trim(act)!=""){
					if(typeof(actions[act])=="function"){
						actions[act](o);
					}
				}
				dynCount++;
			});
		}else{
			var act=o.attr("act");
			if(typeof(act)=="string"&&$.trim(act)!=""){
				if(typeof(actions[act])=="function"){
					actions[act](o);
				}
			}
			dynCount++;
		}
	});
});
