//document.writeln(''); /* lnbmenulist = function() { this.list = {}; this.settings = {}; } lnbmenulist.prototype.menu = function (id, title, link) { this.list[id] = {id: id, title: title, link: link, length: 0, sublist: {}}; } lnbmenulist.prototype.submenu = function (paid, id, title, link) { if( typeof this.list[paid].sublist[id] == 'undefined' ) this.list[paid].length++; this.list[paid].sublist[id] = {id: id, title: title, link: link}; } lnbmenulist.prototype.setting = function (settings) { this.settings = settings; } lnbmenulist.prototype.ensureDefault = function (settingName, defaultValue) { this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName]; }; lnbmenulist.prototype.print = function () { this.ensureDefault('title',''); this.ensureDefault('selectmenu',''); this.ensureDefault('selectsubmenu',''); var isfirst = true; document.write(''); document.write('
'); document.write('
'); document.write('
'); document.write('
'+this.settings.title+'
'); for( var i in this.list ){ //document.write(''); document.write('
'); document.write('
'); document.write(''); this.eventHandle(); } lnbmenulist.prototype.eventHandle = function () { $('.unselectlmenu').mouseenter(function (){ if( $(this).attr('chkclick') != 'on' ){ $(this).addClass('onover'); $(this).children('a').addClass('onovercolor'); } }); $('.unselectlmenu').mouseleave(function (){ if( $(this).attr('chkclick') != 'on' ){ $(this).removeClass('onover'); $(this).children('a').removeClass('onovercolor'); } }); $('.unselectlmenu').click(function (){ if( $(this).attr('chkclick') != 'on' ){ //$('.selectlmenu').each(function(){ // $('#sublmlist_'+this.id).hide(); // $(this).attr('chkclick','off') // $(this).removeClass('on'); // $(this).children('a').removeClass('onselectcolor'); //}); $('.ondropdown').each(function(){ $('#sublmlist_'+this.id).hide(); $(this).attr('chkclick','off') $(this).removeClass('ondropdown'); $(this).children('a').removeClass('ondropdowncolor'); }); $('#sublmlist_'+this.id).show(); $(this).attr('chkclick','on') $(this).addClass('ondropdown'); $(this).children('a').addClass('ondropdowncolor'); $(this).removeClass('onover'); $(this).children('a').removeClass('onovercolor'); }else{ $('#sublmlist_'+this.id).hide(); $(this).attr('chkclick','off') $(this).addClass('onover'); $(this).children('a').addClass('onovercolor'); $(this).removeClass('ondropdown'); $(this).children('a').removeClass('ondropdowncolor'); } }); $('.unselectlsmenu').mouseenter(function (){ $(this).addClass('sonovercolor'); }); $('.unselectlsmenu').mouseleave(function (){ $(this).removeClass('sonovercolor'); }); } */ //(function($) { lnbmenulist = { list: {}, settings: {}, menu: function (id, title, link, target) { if( typeof target == 'undefined' ){ target = ''; } this.list[id] = {id: id, title: title, link: link, target: target, length: 0, sublist: {}}; }, submenu: function (paid, id, title, link, target) { if( typeof target == 'undefined' ){ target = ''; } if( typeof this.list[paid].sublist[id] == 'undefined' ) this.list[paid].length++; this.list[paid].sublist[id] = {id: id, title: title, link: link, target: target}; }, setting: function (settings) { this.settings = settings; }, ensureDefault: function (settingName, defaultValue) { this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName]; }, print: function () { this.ensureDefault('title',''); this.ensureDefault('selectmenu',''); this.ensureDefault('selectsubmenu',''); var isfirst = true; var thispageselect = ''; //document.write(''); document.write('
'); document.write('
'); document.write('
'); document.write('
'+this.settings.title+'
'); for( var i in this.list ){ if( this.settings.selectmenu==this.list[i].id ) thispageselect = this.list[i].id; //document.write(''); document.write('
'); document.write('
'); //document.write(''); this.eventHandle(thispageselect); }, eventHandle: function (thispageselect) { $('.unselectlmenu').mouseenter(function (){ if( $(this).attr('chkclick') != 'on' ){ $(this).addClass('onover'); $(this).children('a').addClass('onovercolor'); } }); $('.unselectlmenu').mouseleave(function (){ if( $(this).attr('chkclick') != 'on' ){ $(this).removeClass('onover'); $(this).children('a').removeClass('onovercolor'); } }); $('.unselectlmenu').click(function (){ if( $(this).attr('chkclick') != 'on' ){ /* $('.ondropdown').each(function(){ $('#sublmlist_'+this.id).hide(); $(this).attr('chkclick','off'); $(this).removeClass('ondropdown'); $(this).children('a').removeClass('ondropdowncolor'); }); */ var this_id = this.id.replace('lmlist_',''); //if( this_id == thispageselect ) return; $('#sublmlist_'+this_id).show(); $(this).attr('chkclick','on'); $(this).removeClass('onover'); $(this).children('a').removeClass('onovercolor'); $(this).addClass('ondropdown'); $(this).children('a').addClass('ondropdowncolor'); // var this_id = this.id; $('.unselectlmenu').each(function(){ var sthis_id = this.id.replace('lmlist_',''); if( this_id != sthis_id ){ if( $(this).hasClass('ondropdown') ){ $('#sublmlist_'+sthis_id).hide(); $(this).attr('chkclick','off'); $(this).removeClass('ondropdown'); $(this).children('a').removeClass('ondropdowncolor'); } } }); }else{ var this_id = this.id.replace('lmlist_',''); if( this_id == thispageselect ) return; $('#lmlist_'+thispageselect).addClass('ondropdown'); $('#lmlist_'+thispageselect).children('a').addClass('ondropdowncolor'); $('#sublmlist_'+thispageselect).show(); $('#sublmlist_'+this_id).hide(); $(this).attr('chkclick','off'); $(this).removeClass('ondropdown'); $(this).children('a').removeClass('ondropdowncolor'); $(this).addClass('onover'); $(this).children('a').addClass('onovercolor'); //if( $('.ondropdown').length == 0 ){ //$('.thispageselect').addClass('ondropdown'); //$('.thispageselect').children('a').addClass('ondropdowncolor'); //} } }); $('.unselectlsmenu').mouseenter(function (){ $(this).addClass('sonovercolor'); }); $('.unselectlsmenu').mouseleave(function (){ $(this).removeClass('sonovercolor'); }); } }; //})(jQuery);