Difference between revisions of "MediaWiki:Common.js"

From SQLZOO
Jump to: navigation, search
Line 29: Line 29:
 
    
 
    
 
   //Adverts
 
   //Adverts
   $('<img/>',{src:'http://socweb8.napier.ac.uk/~09011004/zoo_tutorials/design/sqlhacks.png',alt:'SQL Hacks book ad'})
+
   $('<img/>',{src:'/design/sqlhacks.png',alt:'SQL Hacks book ad'})
 
     .appendTo($('#sql_hacks'));
 
     .appendTo($('#sql_hacks'));
 
   $('#p-googleadsense').prependTo('#footer');
 
   $('#p-googleadsense').prependTo('#footer');
Line 499: Line 499:
 
$(function(){
 
$(function(){
 
   $('<a/>',{href:'http://sqlzoo.net/w/index.php',id:'mp-logo',title:'Zoo You!'})
 
   $('<a/>',{href:'http://sqlzoo.net/w/index.php',id:'mp-logo',title:'Zoo You!'})
     .append($('<img/>',{src:'http://socweb8.napier.ac.uk/~09011004/zoo_tutorials/design/sql_zoo_logo05.png',alt:'SQLzoo logo'}))
+
     .append($('<img/>',{src:'/design/sql_zoo_logo05.png',alt:'SQLzoo logo'}))
 
     .appendTo($('#mw-head-base'))
 
     .appendTo($('#mw-head-base'))
 
});
 
});
Line 521: Line 521:
 
     $('#language').append(lang);
 
     $('#language').append(lang);
  
     $('<img/>',{src:'http://socweb8.napier.ac.uk/~09011004/zoo_tutorials/design/en2.png',alt:'SQL zoo in English'})
+
     $('<img/>',{src:'/design/en2.png',alt:'SQL zoo in English'})
 
       .appendTo($('#en'));
 
       .appendTo($('#en'));
     $('<img/>',{src:'http://socweb8.napier.ac.uk/~09011004/zoo_tutorials/design/de2.png',alt:'SQL zoo in German'})
+
     $('<img/>',{src:'/design/de2.png',alt:'SQL zoo in German'})
 
       .appendTo($('#de'));
 
       .appendTo($('#de'));
     $('<img/>',{src:'http://socweb8.napier.ac.uk/~09011004/zoo_tutorials/design/fr2.png',alt:'SQL zoo in French'})
+
     $('<img/>',{src:'/design/fr2.png',alt:'SQL zoo in French'})
 
       .appendTo($('#fr'));
 
       .appendTo($('#fr'));
 
});
 
});

Revision as of 23:20, 2 May 2013

/* Any JavaScript here will be loaded for all users on every page load. */
$(function(){
  var engine = $('<div class="portal"/>')
    .append($('<h5>Engine</h5>'))
    .append($('<div class=body/>')
      .append($('<ul/>')
        .append($('<li/>')
          .append($('<select id=engine/>')
            .append('<option value=mysql>MySQL</option>')
            .append('<option value=oracle>Oracle</option>')
            .append('<option value=sqlserver>SQL Server</option>')
            .append('<option value=postgres>PostgreSQL</option>')
            .append('<option id=ingres>Ingres</option>')
            .append('<option id=db2>DB2</option>')
            .change(function(){setDefaultText();})
          )
        )
      )
    )
 
  $('#right-navigation').after($('<ul/>',{'id':'zoolinks'})
     .append($('<li/>').append($('<a/>',{href:'http://csszoo.net',text:'CSS',id:'css_link', title:'Learn CSS! visit CSSzoo'})))
     .append($('<li/>').append($('<a/>',{href:'http://progzoo.net',text:'Java',id:'java_link', title:'Hungry for Java tutorials? ProgZoo is for you'})))
     .append($('<li/>').append($('<a/>',{href:'http://linuxzoo.net',text:'Linux',id:'linux_link', title:'Linux Zoo tutoials!'})))
     .append($('<li/>',{'id':'book'}).append($('<a/>',{href:'http://www.oreilly.com/catalog/sqlhks/',id:'sql_hacks',title:'Try/buy SQL Hacks book'})))
  );
 
  $('#p-Reference').before(engine);
 
  //Adverts
  $('<img/>',{src:'/design/sqlhacks.png',alt:'SQL Hacks book ad'})
    .appendTo($('#sql_hacks'));
  $('#p-googleadsense').prependTo('#footer');
 
  if (wgCanonicalNamespace=='MediaWiki' || wgCanonicalNamespace=='Special')
    $('#p-googleadsense').hide();
 
	// Reset localStorage
	var rst = $('.lsclear');
	rst.click(function(e){
	   if (localStorage) 
			localStorage.clear();
	   location.reload();
	});
 
	var numberOfQuestions = 0;
	var numberOfAnswered = 0;
	var numberOfCorrect = 0;
	var startAt = Math.max(1,$('#startAt').text()*1);
	var qu = $('.qu,.ht,.err');
	var curEng;
	if (localStorage && localStorage.getItem("currentEngine"))
	{
		curEng = localStorage.getItem("currentEngine");
		$('#engine').val(curEng);
	}
	else
		curEng = $('#engine').val();
 
	for(var i=0;i<qu.length;i++){
		var id = i+1;
		var q = qu[i];
		var lsName = wgPageName + '_' + 'frm__' + id;
 
		var def = $('.def',q);
		if (def.length>1){
			var pick = def.filter(function(){
				var clss = $(this).attr('class').split(' ');
				for(var k=0;k<clss.length;k++)
					if (clss[k].match("^e-")) return false;
				return true
				});
			for(var j=0;j<def.length;j++)
			  if ($(def[j]).hasClass('e-'+curEng))
				pick = $(def[j]);
			def = pick;
		}
 
		//Hints
		var hint = $('.hint', q);
		hint.hide();
		hint.each(function(){
			var htitle = $(this).attr("title");
			var hnt = $('<div/>', {'class':'hnt', 'text':htitle});
			var hidden = $(this);
			hnt.click(function(e){
			   e.preventDefault();
			   hidden.toggle("slow");});
			$(this).before(hnt);
		});
 
 
		var txt = def.text();
		// replace the default text with user's last query if available in LS
		if (localStorage.getItem(lsName+"_arr_"+curEng))
		{
			var lsArray = JSON.parse(localStorage.getItem(lsName+"_arr_"+curEng));
			txt = lsArray[lsArray.length-1];
		}
 
		var ans = $('.ans',q).text();
		var tdy = $('.tidy',q).text();
		var frm = $('<form/>',{name:'frm__'+id,id:'frm__'+id})
			.append($('<div/>',{'class':'quf'})
			   .append($('<textarea></textarea>',
				 {value:$.trim(txt),
				  rows:2+Math.max(Math.max(4 ,txt.split(/[\n\r]+/).length),ans.split(/[\n\r]+/).length),
				  cols:2+Math.max(Math.max(45,maxlen(txt.split(/[\n\r]+/))),maxlen(ans.split(/[\n\r]+/))),
				  'class':'sql',
				  id:'txtar_'+id}))
			   .append($('<br/>'))
			   .append($('<button/>',{text:'Submit SQL','class':'submitSQL',click:goBaby}))
			   .append($('<div/>',{text:'Restore default','class':'reset',click:restoreDefault}))
			);
 
		def.after(frm);
 
 
		// Display completion information
		if (localStorage)
		{
			if (!localStorage.getItem(lsName))
				localStorage.setItem(lsName, "unanswered");
			if (localStorage.getItem(lsName) == "answered")
			{
				//$(".completion", q).html("You have answered this question <u>incorrectly</u> before.");
				numberOfAnswered++;
				var qcorr = $('<div/>', {'class':'qincorrect', 'title':'You have answered this question incorrectly before.'});
				def.before(qcorr);
			}
			else if (localStorage.getItem(lsName) == "correct")
			{
				//$(".completion", q).html("You have answered this question <u>correctly</u> before.");
				numberOfCorrect++;
				numberOfAnswered++;
 
				var qcorr = $('<div/>', {'class':'qcorrect', 'title':'You have answered this question correctly before.'});
				def.before(qcorr);
			}
			else
			{
				//$(".completion", q).html("You have not answered this question yet.");
			}
		}
 
		var lhs = $('<div/>',{css:{width:'60ex',marginRight:'2ex','float':'left'}});
		lhs.append($('<span/>',{text:(startAt+i)+'.','class':'id'}));
		lhs.append($(q).children());
		$(q).append(lhs);
                // This line caused problems when styling - I removed the css margin-left from it - M
		//$(q).append($('<div/>',{text:'result','class':'res',css:{'margin-left':'1ex'}}));
                $(q).append($('<div/>',{text:'result','class':'res'}));
 
		//Show additional info if available for active angine
		var ecomm = $('.ecomm,.link',q);
		var ecomm1 = ecomm.filter(false);
		if (ecomm.length>0){
			var curEng = $('#engine').val();
			for(var j=0;j<ecomm.length;j++)
			  if ($(ecomm[j]).hasClass('e-'+curEng))
				ecomm1 = $(ecomm[j]);
		}
		for (var j = 0; j < ecomm.length; j++)
		{
			if ($(ecomm[j]).get(0) == ecomm1.get(0))
			{
				$(ecomm[j]).show();
			}
			else
			{
				$(ecomm[j]).hide();
			}
		}
 
		var ecomm = $('.link',q);
		var ecomm1 = def.filter(function(){
				var clss = $(this).attr('class').split(' ');
				for(var k=0;k<clss.length;k++)
					if (clss[k].match("^e-")) return false;
				return true
				});
		if (ecomm.length>0){
			var curEng = $('#engine').val();
			for(var j=0;j<ecomm.length;j++)
			  if ($(ecomm[j]).hasClass('e-'+curEng))
				ecomm1 = $(ecomm[j]);
		}
		for (var j = 0; j < ecomm.length; j++)
		{
			if ($(ecomm[j]).get(0) == ecomm1.get(0))
			{
				$(ecomm[j]).show();
			}
			else
			{
				$(ecomm[j]).hide();
			}
		}
		numberOfQuestions = id;
	}
	if (numberOfQuestions == 0)
		numberOfQuestions = 1;
 
	// Display completion info
	$(".summary").html("You have answered "+numberOfAnswered+" out of "+numberOfQuestions+" questions on this page.<br/>"+numberOfCorrect+" of your answers were correct.");
	// Save completion info
	if (localStorage)
	{
		localStorage.setItem(wgPageName+'_numberOfQuestions', numberOfQuestions);
		localStorage.setItem(wgPageName+'_numberOfCorrect', numberOfCorrect);
	}
 
	//Progress bar
	var maxWidth = $('.progressbar').css('width');
	var barModification = parseFloat(maxWidth) * numberOfCorrect / numberOfQuestions;
	$('.progressbar').css('width', barModification);
 
  //Put in the answers if url includes answer=1
  if (window.location.search && /answer/.test(window.location.search)){
    $('<def/>',{text:"Cheat mode",css:{position:'fixed',right:'2ex',
                   bottom:'2ex',width:'14ex',backgroundColor:'yellow',padding:'2ex',
                   textAlign:'center'}})
      .appendTo($('body'));
    $('.quf textarea').each(function(){
       $(this).val($(this).closest('form').next('.ans').text());
    })
  }
 
})
 
function setDefaultText() {
	var qu = $('.ht,.err');
	var curEng = $('#engine').val();
	if (localStorage)
		localStorage.setItem("currentEngine", curEng);
	for(var i=0;i<qu.length;i++){
		var id = i+1;
		var q = qu[i];
 
		var def = $('.def',q);
		if (def.length>1){
			var pick = def.filter(function(){
				var clss = $(this).attr('class').split(' ');
				for(var k=0;k<clss.length;k++)
					if (clss[k].match("^e-")) return false;
				return true
				});
			for(var j=0;j<def.length;j++)
			  if ($(def[j]).hasClass('e-'+curEng))
				pick = $(def[j]);
			def = pick;
		}
 
		var lsName = wgPageName + '_' + 'frm__' + id;
		var txt = def.text();
		// replace the default text with user's last query if available in LS
		if (localStorage.getItem(lsName+"_arr_"+curEng))
		{
			var lsArray = JSON.parse(localStorage.getItem(lsName+"_arr_"+curEng));
			txt = lsArray[lsArray.length-1];
		}
		$('textarea#txtar_'+id).val(txt);
 
		//Show additional info if available for chosen engine
		var ecomm = $('.ecomm',q);
		var ecomm1 = ecomm.filter(false);
		if (ecomm.length>0){
			var curEng = $('#engine').val();
			for(var j=0;j<ecomm.length;j++)
			  if ($(ecomm[j]).hasClass('e-'+curEng))
				ecomm1 = $(ecomm[j]);
		}
		for (var j = 0; j < ecomm.length; j++)
		{
			if ($(ecomm[j]).get(0) == ecomm1.get(0))
			{
				$(ecomm[j]).show();
			}
			else
			{
				$(ecomm[j]).hide();
			}
		}
 
		//Show headers for chosen engine
		var ecomm = $('.link',q);
		var ecomm1 = def.filter(function(){
				var clss = $(this).attr('class').split(' ');
				for(var k=0;k<clss.length;k++)
					if (clss[k].match("^e-")) return false;
				return true
				});
		if (ecomm.length>0){
			var curEng = $('#engine').val();
			for(var j=0;j<ecomm.length;j++)
			  if ($(ecomm[j]).hasClass('e-'+curEng))
				ecomm1 = $(ecomm[j]);
		}
		for (var j = 0; j < ecomm.length; j++)
		{
			if ($(ecomm[j]).get(0) == ecomm1.get(0))
			{
				$(ecomm[j]).show();
			}
			else
			{
				$(ecomm[j]).hide();
			}
		}
 
	}
}
 
function restoreDefault() {
	var qu = $(this).parents('.qu, .ht, .err');
	var def = $('.def',qu);
	var txt = def.text();
	qu.find('textarea.sql').val(txt);
}	
 
function updateProgressbar() {
	var numberOfQuestions = parseInt(localStorage.getItem(wgPageName+'_numberOfQuestions'));
	// A little workaround - max progressbar width is 96% of its background's width
	var maxWidth = parseFloat($('.progressbarbg').css('width')) * 0.96;
	var barModification = parseFloat($('.progressbar').css('width')) + maxWidth * 1 / numberOfQuestions;
	$('.progressbar').css('width', barModification);
}
 
function goBaby(){
  var qu = $(this).parents('.qu, .ht, .err');
  var lsUse = ((qu[0].getAttribute('class') != 'ht') && ($(qu[0]).find('.ans').length > 0));
  var lsName = wgPageName + '_' + $(this).parents('form').attr('id');
  if (lsUse && localStorage && (localStorage.getItem(lsName) != "correct"))
	localStorage.setItem(lsName, "answered");
  var sql = qu.find('textarea.sql').val();
  var parlst = $('.params').text().split(';');
  var params = {};
  for(var i=0;i<parlst.length;i++){
    var pair = parlst[i].split(':');
    params[pair[0]]=pair[1];
  }
  //Store the sql querry in LS
  if (localStorage)
  {
	var curEng = $('#engine').val();
	var lsArray = JSON.parse(localStorage.getItem(lsName+"_arr_"+curEng));
	if (!lsArray)
		lsArray = new Array();
	lsArray.push(sql);
	localStorage.setItem(lsName+"_arr_"+curEng, JSON.stringify(lsArray));
  }
  qu.find('.res').addClass('waiting');
  $.ajax({url:'/sqlgo.pl',cache:false,'type':'post',dataType:'json',
          data:{sql:sql.replace(/\xA0/g,' '),  //Mediawiki inserts &nbsp; before a %. We need to change it back to a space.CM 13/6/12
                format:'json',
                question:$('.id',qu).text(),
                wgUserName:wgUserName,
                cookie:$.cookie('oliver'),
                page:wgPageName,
                server:$('#engine').val(),
                setup:$('.setup',qu).text().replace(/\xA0/g,' '),
                tidy:$('.tidy',qu).text().replace(/\xA0/g,' '),
                answer:$('.ans',qu).text().replace(/\xA0/g,' '),
                schema:params['schema']
               },
          success:function(d){
            var res = qu.find('.res');
            res.empty().removeClass('waiting')
            if (d.error){
              res.append($('<h1/>',{text:'SQLZoo System Error:'}))
              res.append($('<div/>',{text:d.error}))
              return;
            }
			var headerPresent = false;
            for (var i = 0; i < d.sql.length; i++)
				{
				if (!d || !d.sql || !d.sql[i]){
				  res.append($('<h1/>',{text:'SQLZoo System Error:'}))
				  res.append($('<div/>',{text:"Problem with d or d.sql or d.sql[0]"}))
				  return;
				}
				if (d.sql[i].error){
				  res.append($('<h1/>',{text:'Error:'}))
				  res.append($('<div/>',{text:d.sql[i].error}))
				  return;
				}
				var legend = "Result:";
				if (d.score && d.answer && d.answer.length==1 && d.answer[0].fields){
				  if (d.score == 100){
					legend = 'Correct answer';
					if (lsUse && localStorage)
						localStorage.setItem(lsName, "correct");
					var def = $('.def',qu);
					if (localStorage.getItem(lsName) == "correct")
					{
						if ($(".qcorrect", qu).length == 0)
						{
							var qcorr = $('<div/>', {'class':'qcorrect', 'title':'You have answered this question correctly before.'});
							def.before(qcorr);
							updateProgressbar();
						}
					}
			      }
				  else if (d.answer[0].fields.length>d.sql[0].fields.length)
					legend = 'Too few columns';
				  else if (d.answer[0].fields.length<d.sql[0].fields.length)
					legend = 'Too many columns';
				  else if (d.answer[0].rows.length>d.sql[0].rows.length)
					legend = 'Too few rows';
				  else if (d.answer[0].rows.length<d.sql[0].rows.length)
					legend = 'Too many rows';
 
				}
				if (!headerPresent)
				{
					res.append($('<h1/>',{text:legend}));
					headerPresent = true;
				}
				var t = mkTable(d.sql[i]);
				t.addClass('sqlmine')
				 .appendTo(res);
				if (d.answer && d.answer.length>0 && d.score<100){
				  res.append($('<div/>',{text:'Show correct result','class':'showtxt'})
					.click(function(){
					  $(this).next().show('slow');
					})
				  );
				  var a = mkTable(d.answer[0]);
				  a.addClass('sqlans');
				  a.appendTo(res);
				}
			}
          },
          error:function(jqXHR,textStatus,errorThrown){
            qu.find('.res').empty().removeClass('waiting')
              .append($('<h1/>',{'class':'syserr',text:'SQLZOO system error:'}))
              .append($('<div/>',{text:textStatus}))
              .append($('<div/>',{text:errorThrown}))
              .append($('<div/>').html(jqXHR.responseText))
          }
         });
 
		// Modify completion information
		var def = $('.def',qu);
		if (localStorage)
		{
			if (localStorage.getItem(lsName) == "answered")
			{
				var qcorr = $('<div/>', {'class':'qincorrect', 'title':'You have answered this question incorrectly before.'});
				def.before(qcorr);
			}
		}
  return false;
}
function maxlen(l){
  var r = 0;
  for(var i=0;i<l.length;i++)
    r = Math.max(r,l[i].length);
  return r;
}
function truncate(s){
  if (s.length<15) return s;
  return s.substring(0,13)+"..";
}
function mkTable(a){
  var t = $('<table/>');
  t.append($('<tr/>'));
  var isnum = [];
  if (!a.fields || !a.rows) return t;
  for(var i=0;i<a.fields.length;i++){
    $('tr',t).append($('<th/>',{text:truncate(a.fields[i])}));
    var allNum = 1;
    for(var j=0;j<a.rows.length;j++){
      if (a.rows[j] && a.rows[j][i] && !a.rows[j][i].match(/^[0-9.]*$/))
        allNum = 0;
    }
    isnum.push(allNum);
  }
  for(var j=0;j<a.rows.length;j++){
    var tr = $('<tr/>').appendTo(t);
    for(var k=0;k<a.rows[j].length;k++){
      var td = $('<td/>',{text:a.rows[j][k]});
      if (isnum[k]) td.addClass('r');
      td.appendTo(tr);
    }
  }
  return t;
}
 
/* ======================= Designer js starts here */
 
// the following scripts should not be present here - they should be linked as external files !!!
 
// this script helps to manage browser inconsistency across different os
function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);
 
 
// display site logo
$(function(){
  $('<a/>',{href:'http://sqlzoo.net/w/index.php',id:'mp-logo',title:'Zoo You!'})
    .append($('<img/>',{src:'/design/sql_zoo_logo05.png',alt:'SQLzoo logo'}))
    .appendTo($('#mw-head-base'))
});
 
// display site description
$(document).ready(function(){
  $(function(){
    $("#mp-logo").append(" <h1 id='logo-desc'>Interactive <span>SQL <span>Tutorial</span></span></h1>");
  });
});
 
// display language selector
$(function(){
     $('<div/>',{id:'language'}).appendTo($('#mw-head-base'))
 
     var lang = $('<ul/>',{id:'lang','class':'side_nav_sub'});
        lang.append('<li><a id="en" href="/wiki/Main_Page"></li>');
        lang.append('<li><a id="de" href="/wiki/Main_Page/de"></a></li>');
        lang.append('<li><a id="fr" href="/wiki/Main_Page/fr"></a></li>');
 
    $('#language').append(lang);
 
    $('<img/>',{src:'/design/en2.png',alt:'SQL zoo in English'})
       .appendTo($('#en'));
    $('<img/>',{src:'/design/de2.png',alt:'SQL zoo in German'})
       .appendTo($('#de'));
    $('<img/>',{src:'/design/fr2.png',alt:'SQL zoo in French'})
       .appendTo($('#fr'));
});
 
// assemble and display main nav menu
$(function(){
    var ml1 =
    [['1 SELECT basics',  'SELECT_basics','Some simple queries to get you started']
    ,['2 SELECT from WORLD','SELECT_from_WORLD_Tutorial','Finding facts about countries']
    ,['3 SELECT from Nobel','SELECT_from_Nobel_Tutorial','More practice with SELECT statements']
    ,['4 SELECT within SELECT','SELECT_within_SELECT_Tutorial','Using the results of one query inside another']
    ,['5 SUM and COUNT','SUM_and_COUNT','Apply aggregate functions']
    ,['6 JOIN','The_JOIN_operation','Gathering data from more than one table']
    ,['7 More JOIN','More_JOIN_operations','Getting data from the movie database']
    ,['8 Using NULL','Using_Null','Dealing with missing data']
    ,['9 Self JOIN','Self_join','Dealing with missing data']
	,['10 SQL Quizzes','Tutorial_Quizzes','Test your knowledge with multiple choice quizzes']
    ];
    var mm1 = $('<ul/>',{id:'mm1','class':'dropdown mm_sub'});
    for(var i=0;i<ml1.length;i++){
	  var maxWidth = 50; // adjust the value so that it fits menu well
	  var NoQ = localStorage.getItem(ml1[i][1] + '_numberOfQuestions');
	  if (!NoQ) NoQ = 1;
	  var NoC = localStorage.getItem(ml1[i][1] + '_numberOfCorrect');
	  if (!NoC) NoC = 0;	  
	  var pbWidth = parseFloat(maxWidth) * NoC / NoQ;
	  var mprogbar = $('<div/>',{'class':'progressbarbg1'}).append($('<div/>',{'class':'progressbar1', 'id':ml1[i][1], css:{'width':pbWidth}}));
          mm1.append($('<li/>').append($('<a/>',{href:'/wiki/'+ml1[i][1],text:ml1[i][0]})).append(ml1[i][2]).append(mprogbar));
    }
    var mm2 = $('<ul/>',{id:'mm2','class':'dropdown mm_sub'});
        mm2.append('<li><a href="/wiki/AdventureWorks">1 AdventureWorks</a> Flogging sports gear. Assessment for CO22008 2007/8</li>');
        mm2.append('<li><a href="/wiki/Neeps">2 Neeps</a> A timetable database</li>');
        mm2.append('<li><a href="/wiki/Musicians">3 Musicians</a> Concerts and compositions</li>');
        mm2.append('<li><a href="/wiki/Southwind">4 Southwind</a> Buying and selling</li>');
        mm2.append('<li><a href="/wiki/Dressmaker">5 Dressmaker</a> Constructing clothing</li>');
        mm2.append('<li><a href="/wiki/Congestion Charging">6 Congestion Charging</a> Monitoring traffic (old questions)</li>');
        mm2.append('<li><a href="/wiki/Weather data for Southhampton">7 Weather data for Southhampton</a></li>');
        mm2.append('<li><a href="/wiki/Album Tracks Style">8 Album Tracks Style</a> Music data</li>');
 
    var mm3 = $('<ul/>',{id:'mm3','class':'dropdown mm_sub'});
        mm3.append('<li><a href="/wiki/SELECT_Reference">SELECT</a>How to read the data from a database.</li>');
        mm3.append('<li><a href="/wiki/CREATE_and_DROP_Reference">CREATE and DROP</a>How to create tables, indexes, views and other things. How to get rid of them.</li>');
        mm3.append('<li><a href="/wiki/INSERT_and_DELETE_Reference">INSERT and DELETE</a>How to put records into a table, change them and how to take them out again.</li>');
        mm3.append('<li><a href="/wiki/DATE_and_TIME_Reference">DATE and TIME</a>How to work with dates; adding, subtracting and formatting.</li>');
        mm3.append('<li><a href="/wiki/Functions_Reference">Functions</a>How to use string functions, logical functions and mathematical functions.</li>');
        mm3.append('<li><a href="/wiki/Users_Reference">Users</a>How to create users, GRANT and DENY access, get at other peoples tables. How to find processes and kill them.</li>');
        mm3.append('<li><a href="/wiki/Meta_Data_Reference">Meta Data</a>How to find out what tables and columns exist. How to count and limit the rows return.</li>');
        mm3.append('<li><a href="/wiki/Hacks_Reference">SQL Hacks</a>Useful SQL hacks .</li>');
 
    var mm = $('<ul/>',{id:'main_menu'}).appendTo('#mw-head-base');
        mm.append('<li id="mm1"><a href="/" class="navlink">Tutorials</a></li>');
        mm.append('<li id="mm2"><a href="/" class="navlink">Assessments</a></li>');
        mm.append('<li id="mm3"><a href="/" class="navlink">Reference</a></li>');
 
    $('#mm1').append(mm1);
    $('#mm2').append(mm2);
    $('#mm3').append(mm3);
 
    $('#main_menu').wrap('<div id="navigation_horiz" />');
    $('#navigation_horiz').naviDropDown({
      dropDownWidth: '35em'
    });
});
 
// stick on top elements that need to be visible
$(function(){
    $("#main_menu").addClass("stickableMenu");
    $("#p-Reference").addClass("stickableRef");
    $(".ref_section").addClass("stickableDbRef");
});
 
$(document).scroll(function() {
    var useFixedMenu = $(document).scrollTop() > 175;
    $('.stickableMenu').toggleClass('fixedMenu', useFixedMenu);
 
//    var useFixedRef = $(document).scrollTop() > 275;
//    $('.stickableRef').toggleClass('fixedRef', useFixedRef);
 
    $('.stickableDbRef').toggleClass('fixedDbRef', $(document).scrollTop() > 275);
});
 
// swap classes on external links to change their side icons
$(function(){
 $(".external").addClass("zoo_external");
 $(".external").removeClass("external");
});
 
/* === Designer js ends here === */
 
 
// Insert tables into Quiz distractors
var qq = $('.question');
for (var i = 0; i < qq.length; i++)
{
	var q = $(qq[i]);
	var distractors = "ABCDE";
	for (var j=0;j<distractors.length;j++){
		var tans = $('table caption:contains("Table-'+distractors[j]+'")', q).parents('table');
		if (tans.length>0)
		{
			var ttd = $('table tr td:contains("Table-'+distractors[j]+'")', q);
			if (ttd.length>0){
			   ttd.empty();
			   ttd.append(tans);
			}
		}
	}
}
 
$(function(){
  $('input.check').each(function(i,e){
    $(this).attr('id','quiz_d_'+i);
  });
  $('tr.proposal').each(function(i,e){
    var tds = $('td',$(this));
    var html1= $(tds[1]).html();
    $(tds[1]).html($('<label/>',{html:html1,'for':$('input',$(this)).attr('id') }));
  })
})
//Connor 23/7/12 creates the labels for the multiple choice questions allowing them to be highlighted.
 
 
//Analytics code
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-33860668-1']);
  _gaq.push(['_trackPageview']);
 
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
 
 
//JSON
(function($){var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};$.toJSON=typeof JSON==='object'&&JSON.stringify?JSON.stringify:function(o){if(o===null){return'null';}
var type=typeof o;if(type==='undefined'){return undefined;}
if(type==='number'||type==='boolean'){return''+o;}
if(type==='string'){return $.quoteString(o);}
if(type==='object'){if(typeof o.toJSON==='function'){return $.toJSON(o.toJSON());}
if(o.constructor===Date){var month=o.getUTCMonth()+1,day=o.getUTCDate(),year=o.getUTCFullYear(),hours=o.getUTCHours(),minutes=o.getUTCMinutes(),seconds=o.getUTCSeconds(),milli=o.getUTCMilliseconds();if(month<10){month='0'+month;}
if(day<10){day='0'+day;}
if(hours<10){hours='0'+hours;}
if(minutes<10){minutes='0'+minutes;}
if(seconds<10){seconds='0'+seconds;}
if(milli<100){milli='0'+milli;}
if(milli<10){milli='0'+milli;}
return'"'+year+'-'+month+'-'+day+'T'+
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
if(o.constructor===Array){var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i])||'null');}
return'['+ret.join(',')+']';}
var name,val,pairs=[];for(var k in o){type=typeof k;if(type==='number'){name='"'+k+'"';}else if(type==='string'){name=$.quoteString(k);}else{continue;}
type=typeof o[k];if(type==='function'||type==='undefined'){continue;}
val=$.toJSON(o[k]);pairs.push(name+':'+val);}
return'{'+pairs.join(',')+'}';}};$.evalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){return eval('('+src+')');};$.secureEvalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){var filtered=src.replace(/\\["\\\/bfnrtu]/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered)){return eval('('+src+')');}else{throw new SyntaxError('Error parsing JSON, source is not valid.');}};$.quoteString=function(string){if(string.match(escapeable)){return'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;}
c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';};})(jQuery);
 
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/
 
// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];
 
jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});
 
/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */
/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
/**
* plugin: jquery.naviDropDown.js
* author: kt.cheung @ Brandammo
* website: www.brandammo.co.uk
* version: 1.0
* date: 19th feb 2011
* description: simple jquery navigation drop down menu with easing and hoverIntent
 
Copyright (c) 2011 KT Cheung
 
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
 
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
 
**/
 
(function($){
 
  $.fn.naviDropDown = function(options) {  
 
	//set up default options 
	var defaults = { 
		dropDownClass: 'dropdown', //the class name for your drop down
		dropDownWidth: 'auto',	//the default width of drop down elements
		slideDownEasing: 'easeInOutCirc', //easing method for slideDown
		slideUpEasing: 'easeInOutCirc', //easing method for slideUp
		slideDownDuration: 500, //easing duration for slideDown
		slideUpDuration: 500, //easing duration for slideUp
		orientation: 'horizontal' //orientation - either 'horizontal' or 'vertical'
	}; 
 
	var opts = $.extend({}, defaults, options); 	
 
    return this.each(function() {  
	  var $this = $(this);
	  $this.find('.'+opts.dropDownClass).css('width', opts.dropDownWidth).css('display', 'none');
 
	  var buttonWidth = $this.find('.'+opts.dropDownClass).parent().width() + 'px';
	  var buttonHeight = $this.find('.'+opts.dropDownClass).parent().height() + 'px';
	  if(opts.orientation == 'horizontal') {
		//$this.find('.'+opts.dropDownClass).css('left', '0px').css('top', buttonHeight);
	  }
	  if(opts.orientation == 'vertical') {
		$this.find('.'+opts.dropDownClass).css('left', buttonWidth).css('top', '0px');
	  }
 
	  $this.find('li').hoverIntent(getDropDown, hideDropDown);
    });
 
	function getDropDown(){
		activeNav = $(this);
		showDropDown();
	}
 
	function showDropDown(){
		activeNav.find('.'+opts.dropDownClass).slideDown({duration:opts.slideDownDuration, easing:opts.slideDownEasing});
	}
 
	function hideDropDown(){
		activeNav.find('.'+opts.dropDownClass).slideUp({duration:opts.slideUpDuration, easing:opts.slideUpEasing});//hides the current dropdown
	}
 
  };
})(jQuery);
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense