function drop_menu() {
	$('.all_drop').slideUp('fast');	
	$('#menu_menu').slideToggle('fast');
	$('#min').fadeIn('fast');
}
function drop_sub() {
	$('.all_drop').slideUp('fast');	
	$('#menu_sub').slideToggle('fast');
	$('#min').fadeIn('fast');
}
function drop_addpage() {
	$('.all_drop').slideUp('fast');	
	$('#menu_addpage').slideToggle('fast');
	$('#min').fadeIn('fast');
}
function drop_rempage() {
	$('.all_drop').slideUp('fast');	
	$('#menu_rempage').slideToggle('fast');
	$('#min').fadeIn('fast');
}
function drop_sitesettings() {
	$('.all_drop').slideUp('fast');	
	$('#menu_settings').slideToggle('fast');
	$('#min').fadeIn('fast');
}
function retract_all() {
	$('.all_drop').slideUp('fast');	
	$('#min').fadeOut('fast');
}
function drop_pageorder() {
	$('.all_drop').slideUp('fast');	
	$('#menu_orderpage').slideToggle('fast');
	$('#min').fadeIn('fast');
}
function loginshow(){
	$('#loginbox').slideToggle('fast');
	return false;
}
function loginhide(){
	$('#loginbox').slideUp('fast');
	return false;
}
function changepos(newnum) {
	$('#changepos').val(newnum)
}
function confirmorder() {
	var answer = confirm("Are you sure you wish to delete this page?")
	if (answer){
		window.location = "FCKincludes/fck_delpage.php";
	}
	else {}
}

function inp_val() {
	$('#send_val').val('1');
	return true;
}

function losesub() {	
	$('.sub_hold').hide();
}
function showsub(divname) {	
	$('.sub_hold').hide();
	setTimeout('fadesub("'+divname+'")',50);
}
function fadesub(divname) {
	$('#sub'+divname).fadeIn(50);	
}
function showisparent() {
	$('#add_isparent').fadeIn('fast');
	$('#add_isisparent').fadeOut('fast');
	$('#add_parent').fadeIn('slow');		
}
function showisisparent() {
	$('#add_isparent').fadeOut('fast');
	$('#add_parent').fadeOut('slow');
	$('#add_isisparent').fadeIn('fast');
}
function showparent() {
	$('#add_parent').fadeOut('fast');
	$('#add_isisparent').fadeOut('fast');
	$('#add_isparent').fadeIn('slow');	
}
function subsub(subid) {
	$('#subsub'+subid).slideToggle('fast');		
}

// FIJI RESORT STUFF

function gal_thumb_hov(mapname,mapcap,mapid,mapwidth) {	
	$('#whatimg').fadeOut(300);
	$('.gal_cap').fadeOut(300);
	$('.allmap').fadeOut(300);
	setTimeout('gal_thumb_go("'+mapname+'","'+mapcap+'","'+mapid+'","'+mapwidth+'")',10);
}
function gal_thumb_go(mapname,mapcap,mapid,mapwidth) {
	$('#whatimg').attr('src','imgs/loader.gif');
	setTimeout('gal_thumb_yo("'+mapname+'","'+mapcap+'","'+mapid+'","'+mapwidth+'")',800);
}
function gal_thumb_yo(mapname,mapcap,mapid,mapwidth) {
	$('#whatimg').attr('src',mapname);
	$('#capshon').html(mapcap);
	$('#map'+mapid).fadeIn(300);
	$('#greycap').css('width',(mapwidth-10)+'px');
	$('#whatimg').fadeIn(300);
	$('.gal_cap').fadeIn(300);
}

// gives up and down scroll buttons to images, spans, ... named up_name, down_name, respectively.
// will keep the default scroll_box's style overflow if it encounters errors (so make overflow: auto;)

// usage: put this after the scrollbox div:  var div_scroll1 = new TextScroll('div_scroll1', 'scroll_box');
function TextScroll(scrollname, div_name, up_name, down_name)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 25;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

{
        if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);
            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'hidden';
            }
            div_up_obj = document.getElementById(this.up_name);
            div_dn_obj = document.getElementById(this.dn_name);
            if (div_up_obj && div_dn_obj) {
                div_up_obj.setAttribute("onmouseover", scrollname + ".scrollUp();")
                div_up_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")

div_dn_obj.setAttribute("onmouseover", scrollname + ".scrollDown();")
                div_dn_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")
            }
        }
    }

this.stopScroll = function() {
        clearTimeout(this.timeoutID);
    }

this.scrollUp = function() {
        if (this.div_obj) {
            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
        }
    }

this.scrollDown = function() {
        if (this.div_obj) {
            this.scrollCursor += this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
        }
    }

this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollTop = 0;
            this.scrollCursor = 0;
        }
    }
}