function Menu(params) {

	var menuId;
	var menuName;
	var href;
	var onclick;
	var childMenu;
	var selectedNavId = '';
	var renderDiv;
	var menuJson;
	var currentNav;
	var callBackMethod;
	var url;
	{

		renderDiv = params['renderDiv'];
		menuJson = params['menuJson'];
		selectedNavId = params['selectedNavId'];
		callBackMethod = params['callback'];
		url = params['url'];
	}
	this.setNav = function(menujson) {
		childMenu.push('<UL id=nav>');
		var navClass = '';
		for (var i = 0; i < menujson.length; i++) {
			if (menujson[i]['AREA_ID'] == selectedNavId) {
				currentNav = 'nav_' + selectedNavId;
				navClass = 'nav_on';
			} else {
				navClass = 'nav_off';
			}
			var nav = '<LI><A  class="' + navClass + '" id="nav_'
					+ menujson[i]['AREA_ID'] + '"><SPAN>'
					+ menujson[i]['AREA_NAME']
					+ '</SPAN></A></LI><LI class="menu_line"></LI>'
			childMenu.push(nav);
		}

		childMenu.push('</UL>');
	}
	this.setcNav = function(menujson) {
		childMenu.push('<div id=menu_con>');
		for (var i = 0; i < menujson.length; i++) {
			var className = 'DISPLAY:none';
			if (menujson[i]['AREA_ID'] == selectedNavId) {
				className = 'DISPLAY:block';
			}
			childMenu.push('<div id="cnav_' + menujson[i]['AREA_ID']
					+ '" style="' + className + '"><UL>');
			var cnavs = menujson[i]['COUNTRYLIST'];
			for (var j = 0; j < cnavs.length; j++) {
				childMenu.push('<LI><a  id="cnav_' + cnavs[j]['COUNTRY_ID']
						+ '"><span>' + cnavs[j]['COUNTRY_NAME']
						+ '</span></A></LI><LI class="menu_line2"></LI>');
			}
			childMenu.push('</UL></div>');
		}
		childMenu.push('</div>');
	}

	this.setMenu = function(menujson) {
		childMenu = new Array();
		childMenu.push('<div id="menu_out"><div id="menu_in"><div id="menu">');
		this.setNav(menujson);
		this.setcNav(menujson);
		childMenu.push('</div></div></div>');
		this.render(childMenu.join(''), this.getRenderDiv());
	}
	this.render = function(menu, div) {
		if (typeof div == 'undefined') {
			return false;
		}
		var obj = jQuery(menu);
		obj.appendTo(jQuery('#' + div));
		this.bindEvents();

	}
	this.getRenderDiv = function() {
		return renderDiv;
	}
	this.renderTo = function(todiv) {
		if (typeof todiv != 'undefined') {
			renderDiv = todiv;
		}
		me = this;
		if (typeof menuJson == 'undefined') {
			doAjax({
						url : url,
						data : null,
						needMask : false,
						success : function(result) {
							menuJson = result;
							me.setMenu(menuJson);
						}
					});
		} else {
			me.setMenu(menuJson);
		}

	}
	this.bindEvents = function() {
		var menuObj = jQuery('#' + this.getRenderDiv());
		jQuery("#nav li a").each(function(index, obj) {
			obj.onclick = function() {
				if (typeof currentNav != 'undefined') {
					document.getElementById(currentNav).className = "nav_off";
					document.getElementById('c' + currentNav).style.display = "none";
				}
				currentNav = this.id;
				document.getElementById(currentNav).className = "nav_on";
				document.getElementById('c' + currentNav).style.display = "block";
			
				callBackMethod({
							area_id : this.id.replace("nav_",'')
						});
			}
		});
		jQuery("#menu_con li a").each(function(index, obj) {
					obj.onclick = function() {
						callBackMethod({
									county_id : this.id.replace('cnav_','')
								});
					}
				});

	}
	this.setCallback = function(fun) {
		if (typeof fun == 'function') {
			callBackMethod = fun;
		} else {
			callBackMethod = function() {
			}
		}
	}
}
