// JavaScript Document
function validate_blog ( )
{    
	if ( document.getElementById("val1").value==""||document.getElementById("val2").value=="null"||document.getElementById("val3").value==""||document.getElementById("val4").value==""){        
		Error.alert('<h1>Add new blog</h1><p>Please fill all the field\n</p>');
        fieldValid = false;		
    }else if ( document.getElementById("val2").value==""){        
		Error.alert('<h1>Add new blog</h1><p>Please select an image\n</p>');
        fieldValid = false;		
    }else{
		fieldValid = true;
	}
	
    return fieldValid;
}
function validate_coment(id){    
	if ( document.getElementById(id).value==""){        
		Error.alert('<h1>Add new comments</h1><p>Please fill the text area\n</p>');
        fieldValid = false;		
    }else{
		fieldValid = true;
	}
	
    return fieldValid;

}

var valid_extensions = /(.jpg|.jpeg|.png|.swf|.flv)$/i;

function image(fld)
{
if (valid_extensions.test(fld.value)) return true;
Error.alert('<h1>Media type</h1><p>You have selected invalid file type.</p><p>Please select one of the following file type only .jpg | .png | .flv | .swf</p>');

fld.value = '';
fld.select();
fld.focus();
return false;
}