var menuthemewizard={selectedtheme:0,demoids:["ddtopmenubar-wizard","ddtopmenubar-wizard2"],cssfilename:["ddlevelsmenu-topbar.css","ddlevelsmenu-sidebar.css"],jvars:{},separatortheme:"",jsondata:null,themes:[{demoindx:0,id:"mattblackmenu",title:"Matt Menu",path:"matt/",screenshot:"mattblackmenu.gif"},{demoindx:0,id:"matttabs",title:"Matt Tabs",path:"mattred/",screenshot:"matttabs.gif"},{demoindx:0,id:"chromemenu",title:"Chrome Menu",path:"chrome/",screenshot:"chrome.gif"},{demoindx:0,id:"shadetabs",title:"Shade Tabs",path:"shadetabs/",screenshot:"shadetabs.gif"},{demoindx:0,id:"indentmenu",title:"Indent Menu",path:"indent/",screenshot:"indentmenu.gif"},{demoindx:0,id:"solidblockmenu",title:"Solid Block Menu",path:"solidblock/",screenshot:"solidblockmenu.gif"},{demoindx:1,id:"glowingtabs",title:"Glowing Tabs Menu",path:"glowtabs/",screenshot:"glowingtabs.gif"},{demoindx:1,id:"ubercolortabs",title:"Uber Round Color Tabs",path:"uberround/",screenshot:"ubercolortabs.gif"},{demoindx:0,id:"wireframemenu",title:"Wire Frame Menu",path:"wireframe/",screenshot:"wireframemenu.gif"},{demoindx:0,id:"slantedmenu",title:"Slanted Divider Menu",path:"slantedmenu/",screenshot:"slantedmenu.gif"},{demoindx:1,id:"slidetabsmenu",title:"Sliding Doors Menu",path:"slidingdoors/",screenshot:"slidedoors.gif"},{demoindx:0,id:"underlinemenu",title:"Thick Underline Menu",path:"underlinemenu/",screenshot:"underlinemenu.gif"}],changetheme:function(F,E){for(var C=0;C<this.demoids.length;C++){document.getElementById(this.demoids[C]).style.display=(C==F)?"block":"none"}var B=document.getElementById(this.demoids[F]);B.className=this.themes[E].id;ddlevelsmenu.gettopitemsdimensions();this.jvars.$instructions.css({opacity:0.1});var A=this.jvars.$instructions.offset().left+this.jvars.$instructions.outerWidth()/2-this.jvars.$loadingdiv.outerWidth()/2;var D=this.jvars.$instructions.offset().top+10;this.jvars.$loadingdiv.css({left:A,top:D,display:"block"});clearTimeout(this.showtimer);this.jvars.$themecssfile.attr({href:this.themes[E].path+"ddlevelsmenu-topbar.css"});this.jvars.$titles.each(function(G){$(this).html(menuthemewizard.themes[E].title+($(this).hasClass("showclass")?" (CSS class: <code>"+menuthemewizard.themes[E].id+"</code>)":""))});this.updatesourcebody(E);this.fetchdata(E)},updatesourcebody:function(C){var B=/1/.test(location.href)?this.jvars.defaultsource:$("#localsource").html();B=B.replace("classholder",this.themes[C].id).replace(/(\[\[\[)|(\]\]\])/g,function(D){if(D=="[[["){return(menuthemewizard.themes[C].demoindx==0)?"":"<span>"}else{if(D=="]]]"){return(menuthemewizard.themes[C].demoindx==0)?"":"</span>"}}});try{this.jvars.$sourcebody.val(B)}catch(A){}},loadmenucss:function(){var A=this.themes;document.write('<link rel="stylesheet" type="text/css" href="combinedcss.css" />')},showpreviews:function(){var A=this.themes;document.write('<div style="width:100%; overflow:hidden">');for(var B=0;B<A.length;B++){document.write('<div class="screenshots">');document.write('<div><a href="#'+A[B].id+'" rel="'+B+'" title="'+A[B].title+'" onClick="menuthemewizard.changetheme('+A[B].demoindx+', this.rel); return false"><img src="'+A[B].path+A[B].screenshot+'" /></a></div>');document.write('<a href="#'+A[B].id+'" rel="'+B+'" onClick="menuthemewizard.changetheme('+A[B].demoindx+', this.rel); return false">'+A[B].title+"</a><br /></div>");if(A[B].id==this.separatortheme){document.write('<hr style="clear:left" />')}}document.write("</div>")},fetchdata:function(A){if(!this.jsondata){$.getJSON("menudata.json",function(B){menuthemewizard.jsondata=/1/.test(location.href)?B:$.getScript("data.js");menuthemewizard.showinstructions(A)})}else{menuthemewizard.showinstructions(A)}},showinstructions:function(D){this.jvars.$descdiv.html(this.jsondata[D].desc+'<br /><br /><b>Note:</b> By default, <b>all</b> external files (.js, .css, images etc) mentioned below should be saved in the sub directory "<code>/ddlevelsfiles</code>" relative to your menu page');if(this.jsondata[D].images){var A=this.jsondata[D].images;var C="";for(var B=0;B<A.length;B++){C+='<img src="'+menuthemewizard.themes[D].path+A[B][0]+'" style="border:1px solid black; width:'+A[B][1]+"px; height:"+A[B][2]+'px" /> '}this.jvars.$mediadiv.css({display:"inline"}).html('This menu also comes with the following image(s), which you should save to the sub directory "<code>/ddlevelsfiles</code>" as well:<br /><br />'+C)}else{this.jvars.$mediadiv.empty()}menuthemewizard.showtimer=setTimeout(function(){menuthemewizard.jvars.$instructions.animate({opacity:0.99},function(){menuthemewizard.jvars.$loadingdiv.css({display:"none"});menuthemewizard.equalize()})},800)},equalize:function(){this.jvars.$cols.eq(0).css({height:this.jvars.$cols.eq(1).height()})},init:function(){this.changetheme(this.themes[this.selectedtheme].demoindx,this.selectedtheme);for(var A=0;A<this.demoids.length;A++){document.getElementById(this.demoids[A]).style.visibility="visible"}}};menuthemewizard.loadmenucss();$(document).ready(function(){menuthemewizard.jvars.$cols=$("#leftcolumn, #centercolumn");menuthemewizard.jvars.$cols=$("#leftcolumn, #centercolumn");menuthemewizard.jvars.$instructions=$("#themeinstructions").css({opacity:0.1});menuthemewizard.jvars.$loadingdiv=$('<div style="position:absolute;width; width:100px; height:100px; background:transparent; color:white; padding:10px; left:0; top:0; display:none"></div>').html('<img src="loading.gif" />').appendTo(document.body);menuthemewizard.jvars.$themecssfile=$("#themecssfile");menuthemewizard.jvars.$titles=$(".titlegoeshere");menuthemewizard.jvars.$descdiv=$("#descdiv").empty().css({display:"block"});menuthemewizard.jvars.$mediadiv=$("#mediadiv");menuthemewizard.jvars.$sourcebody=$("#sourcebody");menuthemewizard.jvars.defaultsource=$("#defaultsourcearea").val();menuthemewizard.equalize()});$(window).bind("load",function(){menuthemewizard.demoids=/ddlevelsmenu/i.test(location.href)?menuthemewizard.demoids:["local-wizard","local-wizard2"],menuthemewizard.init()});