document.writeln("<script>");
document.writeln("");
document.writeln("$(document).ready(function()");
document.writeln("{");
document.writeln("");
document.writeln("$.preloadImages = function()");
document.writeln("{");
document.writeln("       for(var i = 0; i<arguments.length; i++)");
document.writeln("       {");
document.writeln("               $(\"<img />\").attr(\"src\", arguments[i]);");
document.writeln("       }");
document.writeln("}");
document.writeln("");
document.writeln("$.preloadImages(\"images/toparrow.png\",\"images/bottomarrow.png\");");
document.writeln("");
document.writeln("");
document.writeln("var $top1= $(\'#minibar\').offset().top + 20;   ");
document.writeln("var $mid1 =  Math.floor($(window).height() / 2);");
document.writeln("$(\'#dirbutton\').data(\'mode\',\'scrollup\');");
document.writeln("");
document.writeln("");
document.writeln("");
document.writeln("");
document.writeln("$(\'#dirbutton\').click(function()");
document.writeln("{");
document.writeln("   $mode = $(this).data(\'mode\');");
document.writeln("   ");
document.writeln("   switch($mode)");
document.writeln("   {");
document.writeln("     case \'scrolldown\':");
document.writeln("	     $(\'html, body\').animate({scrollTop:0}, \'slow\');");
document.writeln("		 return false;");
document.writeln("		 break;");
document.writeln("	 case \'scrollup\':");
document.writeln("	    $scrollpos = $(\'body\').outerHeight();");
document.writeln("	    $(\'html, body\').animate({scrollTop:$scrollpos}, \'slow\');");
document.writeln("		return false;");
document.writeln("		break;");
document.writeln("   }");
document.writeln("   ");
document.writeln("   ");
document.writeln("});");
document.writeln("");
document.writeln("$(window).scroll(function()");
document.writeln("{   ");
document.writeln("");
document.writeln("		if ($(window).scrollTop()>$top1)   ");
document.writeln("		{");
document.writeln("		 $(\'#floatingbar\').hide();");
document.writeln("		 $(\'#minibar\').show();");
document.writeln("		 $(\'#minibar\').addClass(\'floater\');");
document.writeln("		}");
document.writeln("		else");
document.writeln("		{");
document.writeln("		 $(\'#minibar\').hide();");
document.writeln("		 $(\'#floatingbar\').show();");
document.writeln("");
document.writeln("		 }");
document.writeln("		 ");
document.writeln("		 ");
document.writeln("		 if($(window).scrollTop() > $mid1)");
document.writeln("		  {");
document.writeln("		     $(\'#dirbutton\').find(\'img\').attr(\'src\',\'images/toparrow.png\');");
document.writeln("			 $(\'#dirbutton\').data(\'mode\',\'scrolldown\');");
document.writeln("		     $(\'#dirbutton\').show();");
document.writeln("		  }else");
document.writeln("		  {	    ");
document.writeln("			 $(\'#dirbutton\').find(\'img\').attr(\'src\',\'images/bottomarrow.png\');");
document.writeln("			 $(\'#dirbutton\').data(\'mode\',\'scrollup\');");
document.writeln("			 ");
document.writeln("		  }");
document.writeln("});");
document.writeln(" ");
document.writeln("});");
document.writeln(" ");
document.writeln("</script>");
document.writeln("");