
//	Codename:			DS FUNCTION
//	For slightly shorter code: Example: set ds.Default = "get"; instead of ds.get("name") you can use ds("name")
var	a = function(a,b,c){
	
	if(ds[ds.Default]){
		return ds[ds.Default](a,b);
	}
	
};

//	Codename:			GET ID
//	returns document.getElementById
a.get = function(a){
	return document.getElementById(a);
}
//	Codename:			GET TAGS
a.tags = function(a){
	return document.getElementsByTagName(a);
}
//	Codename:			GET/SET HTML
//	gets a nodes innerHTML. if var b is set, changes the innerHTML to b.
a.html = function(a,b){
	a = ( typeof a == "string" ? ds.get(a) : a );
	if( b === undefined ){
		return a.innerHTML;
	}
	return a.innerHTML = b;
}
//	Codename:			GET/SET VALUE
//	gets a nodes value. if var b is set, changes the value to b.
a.value = function(a,b){
	a = ( typeof a == "string" ? ds.get(a) : a );
	if( b === undefined ){
		return a.value;
	}
	return a.value = b;
}
a.dn = function(a){
	if( typeof a == "string" ){
		a = ds.get(a);
	}
	a.style.display = "none";
}

a.copy = function(a){
	return JSON.parse(JSON.stringify(a));
}

a.ds = function(){
	
	return navigator.platform == "Nintendo 3DS";
	
}
a.wiiu = function(){
	
	return navigator.platform == "Nintendo WiiU";
	
}

a.Ajax = function(_$_){
var	a = new XMLHttpRequest() || new ActiveXObject( 'Microsoft.XMLHTTP' ), _$_ = _$_ || {}, i;
	a.onreadystatechange = function(){
		if( a.readyState == 4 && a.status == 200 ){
			if( _$_.Log || ds.Ajax.Log ){
				console.log( 'Log: ' + a.responseText );
			}
			if( _$_.Function ){
				try{
					_$_.Function( a );
				}
				catch( _ ){
					console.log("Ajax _$_.Function has failed. " + _ );
				}
			}
			if( a.responseText[0] == ';' ){
				eval( a.responseText );
			}
			else if( _$_.Eval || ds.Ajax.Eval ){
				eval( a.responseText );
			}
			if( _$_.After ){
				try{
					_$_.After( a );
				}
				catch( _ ){
					console.log("Ajax _$_.After has failed. " + _ );
				}
			}
		}
	};
	a.open( _$_.Method || ds.Ajax.Method || 'GET', _$_.URL || ds.Ajax.URL || '', (_$_.Async !== undefined ? _$_.Async : false) || ds.Ajax.Async || false );
	if( _$_.Send && typeof _$_.Send == 'object' ){
		_$_.Encode = _$_.Send;
	}
	if( _$_.Encode ){
		_$_.String = '';
		for( i in _$_.Encode ){
			if( typeof _$_.Encode[ i ] !== 'string' ){
				_$_.Encode[ i ] = JSON.stringify( _$_.Encode[ i ] );
			}
			_$_.String+= i + '=' + encodeURIComponent( _$_.Encode[ i ] ) + '&'
		}
	}
	if( _$_.String ){
		a.setRequestHeader( _$_.Header || 'Content-type', _$_.Value || 'application/x-www-form-urlencoded' );
		a.send( _$_.String );
	}
	else{
		a.send();
	}
	return a;
};



//	Codename:			CUSTOM AJAX
//	Custom variables and stuff
a.Ajax.Log = false;
a.Ajax.URL = false;
a.Ajax.Eval = false;
a.Ajax.Async = false;
a.Ajax.Value = false;
a.Ajax.Encode = false;
a.Ajax.Header = false;
a.Ajax.Method = false;
a.Ajax.String = false;
a.Ajax.Function = false;
a.Default = false;







//	Codename:			NAME VARIABLE
//	Unsure of official name. But can be easily changed.
ds = a;
