
/*// extend...
Object.extend = function(dst, src){	for(var i in src){ dst[i]=src[i]; } return dst; }

// extend string
Object.extend(String.prototype, {
	striptags: 	function() 			{return this.replace(/<\/?[^>]+>/gi, ''); },
	include: 	function(pattern) {return this.indexOf(pattern) > -1; },
	trim: 		function()			{return this.replace(new RegExp("^[\\s]+", "g"),"").replace(new RegExp("[\\s]+$", "g"),""); },
	isemail: 	function()			{
		chk = new RegExp(/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([_a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]{2,200}\.[a-zA-Z]{2,6}$/).test(this);
		if( chk  || new RegExp(/@localhost$/).test(this) ) return true;
		return chk;
	},
	isdate: function(){ return false;
		var date = this; var dimonth = [0,31,28,31,30,31,30,31,31,30,31,30,31];
		var tmp1 = date.split(/-|\//);
		tmp1[0] = parseFloat(tmp1[0]); tmp1[1] = parseFloat(tmp1[1]); tmp1[2] = parseFloat(tmp1[2]);
		if( format == 2){
			var _tmp = tmp1;
			tmp1[0] = _tmp[2];
			tmp1[2] = _tmp[0];
			alert('jj');
		}
		alert(format);
		
		if(	!( isNaN(tmp1[0]) || isNaN(tmp1[1]) || isNaN(tmp1[2]) ) && 
				!( tmp1[0] <= 0 || tmp1[1] <= 0 || tmp1[2] <= 0 ) &&
				!( tmp1[0] <= 0 || tmp1[1] <= 0 || tmp1[2] <= 0 ) && 
				!( tmp1[2] > 29 && tmp1[1] == 2 ) &&
				!( tmp1[2] == 29 && tmp1[1] == 2 && !(((tmp1[0] % 4 == 0) && (tmp1[0] % 100 != 0)) || (tmp1[0] % 400 == 0)) ) &&
				!( tmp1[1] > 12 ) && 
				!( tmp1[2] > dimonth[tmp1[1]] ) ) return true;
		return false;
	},
	isimage: function(){
		return new RegExp(/(\.jpg|\.jpeg|\.gif|\.png|\.bmp)$/).test(this.toLowerCase());
	},
	empty: function(){
		return this.trim(this) == "";
	}
});*/

// extend array

/*
Object.extend(Array.prototype, {
	merge: function(narg){ var narg; for(var i in narg ){ this[i] = narg[i]; } return this; },
	add: function(narg){ var narg; for(var i in narg ){ this.unshift(narg[i]); } return this; },
	remove: function(narg){ 
		var narg, newItms = [];
		for(var i in this){
			if( !in_array(i,narg) ){ newItms[i] = this[i]; }
		}	return this;
	 },
	 clear: function(){
		var nw = [];
		for( var i in this){
			nw[i] = this[i];
		}	for(var i in nw){ if( typeof( i ) == 'function' ){ nw[i] = undefined; } } return nw;
	 },
});*/



// global vars
var $_GET = [];
var $_SERVER = [];

// register globals
function __register__globals(){ var vfl;
	// register get
	var matchgt = new String( document.location.search ).replace(/^\?/g,"").split("&");
	for( var i = 0, n = matchgt.length; i < n; i++){
		vfl = matchgt[i].split("=");
		if( typeof(vfl[0]) !== 'undefined' && !new String(vfl[0]).empty() ){
			$_GET[vfl[0]] = vfl[1];
		}
	}

	// register basename
	var loc = new String(document.location).split("/");
	if( loc[loc.length-1].replace(/\?(.*?)$/,"").trim() !== "" ){
		$_SERVER['basename'] = loc[loc.length-1].substring( 0, ( loc[loc.length-1].include('?')?loc[loc.length-1].indexOf('?'):loc[loc.length-1].length ) );
	}	else	{
		$_SERVER['basename'] = loc[loc.length-2].trim();
	}
	var loc = new String(document.location).split("/");	loc.pop();
	$_SERVER['path'] = loc.join("/") + "/";
}


function __parse_url(Quit, Path, File){ var Quit, QueryString = '', Path, File;
	Path = Path ? Path : $_SERVER['path'];
	File = File ? File : $_SERVER['basename'];
	var qit = new arrayparse($_GET).remove(Quit).get();
	for( var i in qit ){ QueryString+= "&"+ i + "=" + qit[i]; }
	return (Path + File + '?' + QueryString.replace(/^[\&+]/g,""));
}

function $lang(key){ var key;
	return lang_messages[key];
}


// loader
function $wloader(){
	this.codes = [];
	this.eval = function(){ for(var i = 0; i < this.codes.length; i++ ) eval(this.codes[i]); }
	this.add = function( cde ){ var cde; this.codes.unshift( cde ); }
}

// unloader
function $uloader(){
	this.codes = [];
	this.eval = function(){ for(var i = 0; i < this.codes.length; i++ ) eval(this.codes[i]); }
	this.add = function( cde ){ var cde; this.codes.unshift( cde ); }
}


// execute...
var $wload = new $wloader;
var $uload = new $uloader;

$(document).ready(function(){
	$wload.eval();
	__register__globals();
});

$(window).unload(function(){
	$uload.eval();								  
});














