/* MAIN MENU */		
function operateMenu() {
	var menu=document.getElementById('menu');
	var Lists=menu.getElementsByTagName('LI');
	for(var i=0; i<Lists.length; i++) {
		Lists[i].onmouseover=function() {
			this.className=(this.className=='drop')?'':'drop';
		}
		Lists[i].onmouseout=function() {
			this.className=(this.className=='drop')?'':'drop';
		}
	}
}
/* end MAIN MENU */		
		
/* SCROLL */
var timer = null;
function ScrollStart( dir , div ) {
	stopScroller();
	timer = window.setInterval( function() { scrollIt( dir , div ) }, 50);
	document.onmouseup=stopScroller;
}
function scrollIt( dir , div ) {
	var obj = document.getElementById(div);
	switch( dir )
	{
		case 'up': obj.scrollTop-=4; break;
		default: obj.scrollTop+=4; break;
	}
}
function stopScroller() {
	window.clearInterval( timer );
}
/* end SCROLL */

/* PAGING & AJAX */
function jspaging(url){

	$("#div_paging").fadeOut('fast');
	$("#div_paging").load(url);
	setTimeout("$('#div_paging').fadeIn('slow');", 100);
}
/* end PAGING & AJAX */

function popitup(url) {
	window.open('http://'+url,'test','height=500,width=577,scrollbars=yes');
	return false;
}


$(document).ready(function() {
    if($("ul#about")){
        $("ul#about ul").hide();		
        $('ul#about li:has(ul)').each(function(i) {
            $(this).children('ul').slideUp(400);
        });

        if(subcurrent != '' && subcurrent != 'undefined') {
        	$("li."+subcurrent).addClass("clicked");
        	$("li."+subcurrent+" ul").show();
        }
		
        $('ul#about li:has(ul) a span').click(function(){
            if ($(this).parent().parent().hasClass ("clicked")){
                $(this).parent().parent().removeClass("clicked");
                $(this).parent().parent().children("ul").slideUp(400);
            }else{
                $('ul#about li:has(ul)').removeClass("clicked");
                $('ul#about li:has(ul) ul').slideUp(400);
                $(this).parent().parent().addClass("clicked");
                $(this).parent().parent().children("ul").slideDown(400);
            }
        });
    }
    
});
