function oddEven(value, returned) {
	if(typeOf(returned) != 'object' || returned.length < 2) {
		returned = new Array(true, false);
	}

	return returned[(value % 2)];
}

function str_replace(search, replace, subject) {
	return subject.split(search).join(replace);
}


function strstr( haystack, needle, bool ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfxied by: Onno Marsman
    // *     example 1: stristr('Kevin van Zonneveld', 'Van');
    // *     returns 1: 'van Zonneveld'
    // *     example 2: stristr('Kevin van Zonneveld', 'VAN', true);
    // *     returns 2: 'Kevin '

    var pos = 0;

    haystack += '';
    pos = haystack.toLowerCase().indexOf( (needle+'').toLowerCase() );
    if( pos == -1 ){
        return false;
    } else{
        if( bool ){
            return haystack.substr( 0, pos );
        } else{
            return haystack.slice( pos );
        }
    }
}

function isInt(x) {
	var y=parseInt(x);
	if (isNaN(y)) return false;
	return x==y && x.toString()==y.toString();
}

function getOffset(id) {
	var parents	 = document.getElementById(id);

	var position	 = new Array(0,0,0,0);

	while (parents) {
		position[0]	+= parents.offsetTop;
		position[3]	+= parents.offsetLeft;

		parents	 = parents.offsetParent;
	}

	return position;
}