/*
	Author: Stephen W. Cote
	Email: wranlon@hotmail.com
	
	Copyright 2002, All Rights Reserved.
	
	Do not copy, archive, or distribute without prior written consent of the author.
*/

/*
	Package Functions
*/

var _js_packages=[],_js_packages_index=[];

function _js_package(c){
	var a,i=0,s,w=window,o,l;
	o = w;
	if(typeof c=="string"){
		if(!_js_packages_index[c]){
			l = _js_packages.length;
			_js_packages_index[c]=l;
			_js_packages[l]=c;
		}
		a = c.split(".");
		for(;i<a.length;){
			s=a[i++];
			if(typeof o[s]!="object") o[s]={};
			o = o[s];
		}
	}
}

function _js_validate_package(c){
	var a,i=0,s,w=window,o,l;
	o = w;
	if(typeof c=="string"){
		a = c.split(".");
		l = a.length;
		if(l==0) return false;
		for(;i<l;){
			s=a[i++];
			if(typeof o[s]!="object") return false;
			o = o[s];
		}
	}
	else{
		return false;
	}
	return true;
}

