
var Window_Number = 0;

function FileUploadHide(Name, UploadCurrent, UploadMax)
{
    if(document.getElementById("Hide" + UploadCurrent).disabled == false)
    {
        if(UploadCurrent != UploadMax)
        {
            if(UploadCurrent > 1)
                document.getElementById("Hide" + (UploadCurrent - 1)).disabled = false;
                
            document.getElementById("Show" + UploadCurrent).disabled = false;
            document.getElementById("Hide" + UploadCurrent).disabled = true;
            
            if((UploadCurrent + 1) < UploadMax)
                document.getElementById("Show" + (UploadCurrent + 1)).disabled = true;
            
            document.getElementById(Name + (UploadCurrent + 1)).className = "ObjectHide";
        }
    }
    
    return true;
}

function FileUploadShow(Name, UploadCurrent, UploadMax)
{
    if(document.getElementById("Show" + UploadCurrent).disabled == false)
    {
        if(UploadCurrent != UploadMax)
        {
            if(UploadCurrent > 1)
                document.getElementById("Hide" + (UploadCurrent - 1)).disabled = true;
                
            document.getElementById("Show" + UploadCurrent).disabled = true;
            document.getElementById("Hide" + UploadCurrent).disabled = false;
            
            if((UploadCurrent + 1) < UploadMax)
                document.getElementById("Show" + (UploadCurrent + 1)).disabled = false;
            
            document.getElementById(Name + (UploadCurrent + 1)).className = "ObjectShow_TableRow";
        }
    }
    
    return true;
}

function IFCodeTarget(code, targetname)
{
    var TargetValue = document.getElementById(targetname).value;
    
    TargetValue += code;
    
    document.getElementById(targetname).value = TargetValue;
    
	return true;
}

function GoogleSearchText()
{
    if(document.getElementById("sbi").value == "search...")
    {
        document.getElementById("sbi").value = "";
    }
    
    return true;
}

function AreaOver(obj, inClass)
{
	obj.className = inClass + "_On";
	
	return true;
}

function AreaOut(obj, inClass)
{
	obj.className = inClass + "_Off";
	
	return true;
}

function PanelBoxState(GUID)
{
	var sImg = document.getElementById("FBimg" + GUID).src;
	
	if(document.getElementById("FBtd" + GUID).className == "ObjectShow")
	{
		document.getElementById("FBtd" + GUID).className = "ObjectHide";
		document.getElementById("FBimg" + GUID).src = sImg.replace("collapse", "expand");
	}
	else
	{
		document.getElementById("FBtd" + GUID).className = "ObjectShow";
		document.getElementById("FBimg" + GUID).src = sImg.replace("expand", "collapse");
	}
	
	return true;
}

function PopUp(sURL, Width, Height, Resizable, Unique, Normal)
{
	var Window_Width		= 0;
	var Window_Height		= 0;
	var Window_Name			= "";
	var Window_Options		= "";
	var Window_Reference;
	
    Window_Width = Width + 20;
	Window_Height = Height + 85;
	
	Window_Name = Window_Width.toString() + Window_Height.toString();
	if(Normal == false)
	    Window_Options = "channelmode=0,directories=0,fullscreen=0,width=" + Window_Width + ",height=" + Window_Height + ",location=1,menubar=0,resizable=" + Resizable + ",scrollbars=1,status=1,titlebar=0,toolbar=0,left=" + ((window.screen.width / 2) - (Window_Width / 2)) + ",top=" + ((window.screen.height / 2) - (Window_Height / 2));
	else
	    Window_Options = "";
	
	if(Unique == true)
		Window_Reference = window.open(sURL, Window_Number++, Window_Options, false);
	else
	{
		Window_Reference = window.open(sURL, Window_Name, Window_Options, false);
		Window_Reference.focus();
	}
	
	return true;
}

function NavigateCurrent(sURL)
{
	var LocalURL = "";
	LocalURL = sURL;
	
	if(LocalURL.length == 0)
		return false;
	
	window.location.href = LocalURL;
	return true;
}
