function validateBlogProfile(objForm) {
	document.getElementById("catId").value = document.getElementById("category").options[document.getElementById("category").selectedIndex].value;
	var isValid = true;	
	isFieldFocusSet = false;

	if(isEmptyValue("title")){
			xAlert('Please enter the title','blog_title'); 
			isValid=false;
			document.getElementById("title").focus;
	}else {
		xAlert('','blog_title');
	}	

	if(isEmptyValue("displayTitle")){
		xAlert('Please enter the Display Title','blog_displayTitle'); 
		isValid=false;
		document.getElementById("displayTitle").focus;
	}else {
		xAlert('','blog_displayTitle');
	}	

	
	if(isEmptyValue("subTitle")){xAlert('Please enter the Sub-Title','blog_subTitle'); isValid=false;document.getElementById("subTitle").focus;}	
	else {xAlert('','blog_subTitle');}	

	if(isEmptyValue("description")){xAlert('Please enter the description','blog_description'); isValid=false;document.getElementById("description").focus;}	
	else {xAlert('','blog_description');}	

	if(objForm.photo.value == "" || objForm.photo.value==undefined) {
		xAlert("Choose a Profile Image to upload","blog_photo");
		return false;
	}else {
	xAlert("","blog_photo");
	}
	
	var catField = document.getElementById("category");
	var selCategory = catField[catField.selectedIndex].value;
//	alert('selCategory .. '+selCategory);
	if(selCategory == '0'){
		xAlert('Please enter the Category','blog_category'); isValid=false;
	}else{
		xAlert('','blog_category');
	}
	
	return isValid;	
}


function validateEditBlogProfile() {

	var isValid = true;	
	isFieldFocusSet = false;


	if(isEmptyValue("title")){
		xAlert('Please enter the title','blog_title');
	    isValid=false;
	    document.getElementById("title").focus;
	}else {
		xAlert('','blog_title');
	}	

	if(isEmptyValue("displayTitle")){
		xAlert('Please enter the Display Order','blog_displayTitle'); 
		isValid=false;
		document.getElementById("displayTitle").focus;
	}else {
		xAlert('','blog_displayTitle');
	}	

	
	if(isEmptyValue("subTitle")){
			xAlert('Please enter the Sub-Title','blog_subTitle');
			 isValid=false;
			 document.getElementById("subTitle").focus;
		}else {
			xAlert('','blog_subTitle');
		}	

	if(isEmptyValue("description")){
			xAlert('Please enter the description','blog_description');
		   isValid=false;
			document.getElementById("description").focus;
	}else {
		xAlert('','blog_description');
	}	

	return isValid;	
}

function clearForm(){
	xAlert('','blog_title');
	xAlert('','blog_displayTitle');
	xAlert('','blog_subTitle');
	xAlert('','blog_category');
	xAlert('','blog_photo');
	xAlert('','blog_description');
}
