﻿// ----------------------------------------------------------------------------------------------------------------
// Cos I do so much ActionScript I often type trace instead of alert this will fix that problem lol
function trace(x)
{
    alert(x);
}
// ----------------------------------------------------------------------------------------------------------------




// ----------------------------------------------------------------------------------------------------------------
// In Array function
// ----------------------------------------------------------------------------------------------------------------
function fInArray(arr,val)
{
    var i;
    for (i=0; i < arr.length; i++) {
        // Matches identical (===), not just similar (==).
        if (arr[i] === val) {
        	//alert("FOUND");
            return true;
        }
    }
    return false;
}
// ----------------------------------------------------------------------------------------------------------------




// ----------------------------------------------------------------------------------------------------------------
function fGo(x)
{
    self.location.href=x;
}
// ----------------------------------------------------------------------------------------------------------------



// ----------------------------------------------------------------------------------------------------------------
function fLeftTrim(str){
	return str.replace(/^\s+/, '');
}
// ----------------------------------------------------------------------------------------------------------------



// ----------------------------------------------------------------------------------------------------------------
function fRightTrim(str) {
	return str.replace(/\s+$/, '');
}
// ----------------------------------------------------------------------------------------------------------------


// ----------------------------------------------------------------------------------------------------------------
function fTrim(str) {
    str = fLeftTrim(str);
    str = fRightTrim(str);
    return str;
	//return str.replace(/^\s+|\s+$/g, '');
}
// ----------------------------------------------------------------------------------------------------------------



// ----------------------------------------------------------------------------------------------------------------
function fRemoveNewLines(str)
{
	var newStr = str.replace(/\n/g, ' ');	
	return newStr;
}
// ----------------------------------------------------------------------------------------------------------------


// ----------------------------------------------------------------------------------------------------------------
function fLoadPageConfirm(sPage,sMessage)
{
	var conf = confirm(sMessage);
	if (conf)
	{
		self.location.href=sPage;
	}
}
// ----------------------------------------------------------------------------------------------------------------







