function Set_Image_Src(id_img,src_img)
{
	$('#'+id_img).attr("src",src_img);
}

function Clear_Input(id_input,default_value)
{
	if($('#'+id_input).val() == "")
		$('#'+id_input).val(default_value);
	else if($('#'+id_input).val() == default_value)
		$('#'+id_input).val("");
}

function Modal_Message(message) {
	$('#modalmessage').modal({
		closeHTML:"<a href='#' title='Close' class='modal-close'>x</a>",
		position: ["20%",],
		overlayId:'modalmessage-overlay',
		containerId:'modalmessage-container', 
		overlayClose:true,
		onShow: function (dialog) {
			$('.message', dialog.data[0]).append(message);
		}
	});
}

function Modal_Loading() {
	
	$.modal(
			'<img src="images/loadingAnimation.gif">',
			{
				opacity:50,
				overlayCss: {backgroundColor:"#eeeeee"}
			}
			);
}

function Select_Checkbox_All(selectbox_name)
{
	$('input[name='+selectbox_name+']').attr('checked', true);
}

function UnSelect_Checkbox_All(selectbox_name)
{
	$('input[name='+selectbox_name+']').attr('checked', false);
}

function isValidEmail(email)
{
  var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

  if(!filter.test(email))
    return false;
  return true;
}

function validateEmail(){
	if (regexEmailValidate('sender_email'))
		hideWarning('error_email');
	else {
		setWarning('error_email', 'Please enter a valid e-mail address.');
		return false;
	}
}
