/* FUNCTII PENTRU CONVERSIE CULORI */
function rgbToHex(rgbString) {
	//detect if string is rgb
	var parts = rgbString.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
	if( parts === null ) return rgbString.replace('#','');
	else
	{
		delete (parts[0]);
		for (var i = 1; i <= 3; ++i) {
			parts[i] = parseInt(parts[i]).toString(16);
			if (parts[i].length == 1) parts[i] = '0' + parts[i];
		}
		return parts.join('');
	}

}
function hexToRGB(hexString) {
	return "rgb("+parseInt((hexString).substring(0,2),16)+", "+parseInt((hexString).substring(2,4),16)+", "+parseInt((hexString).substring(4,6),16)+")";
}
/////////////////////////////////////
function function_exists (function_name) {
    // Checks if the function exists  
    // 
    // version: 909.322
    // discuss at: http://phpjs.org/functions/function_exists
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Steve Clay
    // +   improved by: Legaev Andrey
    // *     example 1: function_exists('isFinite');
    // *     returns 1: true
    if (typeof function_name == 'string'){
        return (typeof this.window[function_name] == 'function');
    } else{
        return (function_name instanceof Function);
    }
}
function showHelp(tid)
{
	$('#help'+tid).css('top',($(window).height()-$('#help'+tid).height())/2);
	$('#help'+tid).css('left',(($(window).width()-$('#help'+tid).width())/2)-14);
	$('#help'+tid).slideDown(500);
}