function isDateValid(date)
{
	//re = /\d{4}\/\d{2}\/\d{2}/g
	//return re.test(date);
	return true; 
}

/*
function modalBoxAlert(message, modalBoxTitle)
{
	Modalbox.show('<div>' + message + '<br/><p> <input type="button" value="OK" onclick="Modalbox.hide();"/></p></div>', 
		{title: modalBoxTitle, width:300, slideDownDuration:0.10, overlayDuration:0.10});
}

function modalBoxConfirm2(message, okButtonText, cancelButtonText, modalBoxTitle, okCallBack)
{
	Modalbox.show('<div>' + message + '</div><br/><input type="button" value="' + okButtonText + '" onclick="' + okCallBack + '"/> <input type="button" value="' + cancelButtonText + '" onclick="Modalbox.hide();"/>', 
		{title: modalBoxTitle, width:300, slideDownDuration:0.10, overlayDuration:0.10});
}

function modalBoxConfirm(message, modalBoxTitle, okCallBack)
{
	modalBoxConfirm2(message, 'OK', 'Cancel', modalBoxTitle, okCallBack); 
}
*/

function srConfirm( message, okButtonText, cancelButtonText, title, okCallBack )
{
	$.fancybox( '<div class="fbConfirm">' 
		+ message 
		+ '<p><input type="button" value="' + okButtonText + '" onclick="' + okCallBack + '"/> <input type="button" value="' + cancelButtonText + '" onclick="$.fancybox.close();"/></p></div>', 
		{
			'autoDimensions'	: false,
			'width'				: 350, 
			'height'			: 'auto', 
			'title'				: title
		} ); 
}

function srAlert( message, title )
{
	$.fancybox(
		message,
		{
        	'autoDimensions'	: false,
			'width'         		: 380,
			'height'        		: 'auto',
			'transitionIn'		: 'none',
			'transitionOut'		: 'none', 
			'titlePosition'		: 'over', 
			'title'				: title
		}
	);
}

function trim( str ) 
{
	var	str = str.replace(/^\s\s*/, ''),
		ws = /\s/,
		i = str.length;
	while (ws.test(str.charAt(--i)));
	return str.slice(0, i + 1);
}

function shortenUrl( url, cb )
{
	var shortened = ''; 
	$.get( '/include/tweet.php?func=shorten&url='+url, 
		function( json ) {   
			if ( json.rc == 0 ) { 
				cb( json.rm );
			} else { 
				cb ( url );  	
			}
		}, 'json' ); 

	return shortened;
}
