
// LavaBlocks Web Application System [1.0]
// ---------------------------------------
// Copyright (C) 2002-2004 E-Global, Inc. All rights reserved.
// 
// The Core
// core.js - Core JavaScript File
//
// $Id: core.js,v 1.7 2004/08/18 01:12:16 adminq Exp $

function openLink(link) 
{
    OpenCustomWindow("helpcenter", link, 500, 400);
}

function OpenSideWindow(link) 
{
	OpenCustomWindow("side", link, 400, 500);
}

function FocusText(field)
{
    if (field.value.length > 0)
        field.select();
    else
        field.focus();
}

function UpperizeText(field)
{
    field.value = field.value.toUpperCase();
}

function OpenCustomWindow(name, link, width, height)
{
    var properties = "fullscreen=no" + ",toolbar=no" + ",status=no" +
    ",menubar=no" + ",scrollbars=yes" + ",resizable=yes" + ",directories=no" +
    ",location=no" + ",width=" + width + ",height=" + height;
    
    window.open(link, name, properties);
}

function IsAllDigits(str)
{
	return IsValidCharSet(str, "0123456789");
}

function IsValidCharSet(str, charset)
{
	var result = true;

	for (var i = 0; i < str.length; i++)
    {
		if (charset.indexOf(str.substr(i, 1)) < 0)
		{
			result = false;
			break;
		}
	}
    
	return result;
}



