/**
 * @Author				: eli0311
 * @Create				: 2008-08-04
 * @Update				:
 */

Global = function () {

		this.NaviXmlObj;
		this.depth1_id;
		this.depth2_id;
		this.localnum	= 2;
		this.subnum		= 1;

		this.init = function(depth1, depth2) {
			new Ajax.Request(
										"/xml/navi.xml",
										{
											method		: "get",
											asynchronous: false,
											parameters	: "",
											encoding	: "UTF-8",
											onComplete	: function(OriRuquest) { rtnXml = OriRuquest.responseXML; }
										}
								);

			//main °ªÀÇ ¿¤·¹¸àÆ®
			this.NaviXmlObj	=rtnXml.getElementsByTagName("navi");

			if(depth1 != ""){	//-- 1 DEPTH
				var rtnV	= this.NaviXmlObj[0].getElementsByTagName("one_depth");
				for(var i=0; i<rtnV.length; i++){
					if(rtnV[i].getAttribute("id") == depth1){
						this.depth1_id	= rtnV[i];
						this.localnum	= this.depth1_id.getAttribute("idx");

						if(depth2 != ""){	//-- 2 DEPTH
							var rtnV2	= rtnV[i].getElementsByTagName("two_depth");
							for(var i=0; i<rtnV2.length; i++){
								if(rtnV2[i].getAttribute("id") == depth2){
									this.depth2_id	= rtnV2[i];
									this.subnum	= this.depth2_id.getAttribute("idx");
									break
								}
							}
						}

						break
					}
				}
			}

		}//Init

		this.naviStr = function(){
			var str = "<a href='/'>Home</a>";
			if (this.depth1_id){
				str += " &gt; <a href='"+ this.depth1_id.getAttribute("url") +"'>"+ this.depth1_id.getAttribute("title") +"</a>"

				if (this.depth2_id){
					str += " &gt; <a href='"+ this.depth2_id.getAttribute("url") +"'><strong class='ced7b00'>"+ this.depth2_id.getAttribute("title") +"</strong></a>"
				}

			}
			document.write(str);
		}
}
var Glb = new Global();
