
function DisplayFlashMessage( MsgType, Msg, Width )
{
	var DivId = "#flash-msg-div-object";
	var MsgInnerDiv = "#flash-msg-p";
	
	if( MsgType == 'Success' )
		$( DivId ).addClass("FlashMsgSuccessClass");
	
	$( DivId ).width( Width );
	
	$( MsgInnerDiv ).html( Msg );
		
	DisplayJQueryDiv( DivId );
	
	setTimeout( function( ) { HideFlashMsg( DivId ); }, 5000);
}

function DisplayJQueryDiv( obj )
{
	jQuery(obj).animate({ 
        	top: "0px"
      }, 30 ).fadeIn(100);
}

function HideFlashMsg(obj)
{
	jQuery(obj).fadeOut("slow");
}

function ClosePopup()
{
	jQuery.fn.fancybox.close();
}


function isEmailAddr(email)
{
	
	var result = false
	var theStr = new String(email)
	var index = theStr.indexOf("@");
	if (index > 0)
	{
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1))
		result = true;
	}
	return result;
}		

function SetJQueryFancyBox_By_Class( DivClass, FrameWidth, FrameHeight )
{
	jQuery('.' + DivClass ).attr('href', jQuery( "." + DivClass ).attr( 'rel' ));
	
	jQuery("." + DivClass + ".fancybox").fancybox( {
		'hideOnContentClick': false,
		'frameHeight' 		: FrameHeight,
		'frameWidth' 		: FrameWidth
	});
}
