// JavaScript Document
function chkLogin() {
	with (window.document.lgnfrm) {
		if (isEmpty(login, 'Enter Login')) {
			return false;
		} else if (isEmpty(password, 'Enter Password')) {
			return false;
		} else {
			chksum.value = 'chkin';
		}
	}
}

function chkSearch(fld){
	if(document.getElementById(fld).value == ""){
		alert("Please Enter Search String");
		document.getElementById(fld).focus();
		return false;
	}
	return true;
}



function chkAudio() {
	with (window.document.frmadd) {
		if (isEmpty(audio_title, 'Enter Audio Title')) {
			return false;
		} 	
		chksum.value = 'chkin';		
	}
}

function chkPollsubmit(a){
	for (var i=0; i < a.polloption.length; i++){
		if (a.polloption[i].checked){
			var rad_val = a.polloption[i].value;
		}
	}
	if(!rad_val){
		alert("Please select an option");
		return false;
	}
	return true;
}


function chkPolls() {
	var tot =0;
	with (window.document.frmadd) {
		if (isEmpty(poll_title, 'Enter Poll Title')) {
			return false;
		} 	
		if (ans1.value == "") tot++;
		if (ans2.value == "") tot++;
		if (ans3.value == "") tot++;
		if (ans4.value == "") tot++;
		if (ans5.value == "") tot++;
		if (tot > 3) {
			alert('Please enter atleast two answers');
			ans1.focus();
			return false;
		}
		chksum.value = 'chkin';		
	}
}
function chkGallery() {
	with (window.document.frmadd) {
		if (cat_id.value == 0 || cat_id.value == "") {
			alert('Select Category');
			cat_id.focus();
			return false;
		}else if (isEmpty(photo_title, 'Enter Gallery Title')) {
			return false;
		} 	
		chksum.value = 'chkin';		
	}
}




function chkBanner() {
		with (window.document.frmadd) {
			
		
		if (isEmpty(banner_name, 'Enter Banner Name')) {
			return false;
		}else if (banner_type.value == 0 || banner_type.value == "") {
			alert('Select Banner Position');
			banner_type.focus();
			return false;
		}
		
	else	if(document.getElementById('b_img').style.display=='') 
	{	
	if(banner_fimage.value == "") {
					alert('Select Banner Image to Upload');
					banner_fimage.focus();
					return false;
				}
			else	if (banner_link.value == "") {
					alert('Add the link to the banner');
					banner_link.focus();
					return false;
				}
   }
   else if(document.getElementById('b_img').style.display=='none') 
	{
       		if(banner_code.value == "") {
					alert('Enter the Javascript Code');
					banner_code.focus();
					return false;
				}
	}
		chksum.value = 'chkin';		
	}
}







function chkDownloads() {
	with (window.document.frmadd) {
		if (cat_id.value == 0 || cat_id.value == "") {
			alert('Select Category');
			cat_id.focus();
			return false;
		}else if (isEmpty(downloads_title, 'Enter Downloads Title')) {
			return false;
		} 	
		chksum.value = 'chkin';		
	}
}
function chkVideo() {
	with (window.document.frmadd) {
		if (cat_id.value == 0 || cat_id.value == "") {
			alert('Select Category');
			cat_id.focus();
			return false;
		}else if (isEmpty(video_title, 'Enter Video Title')) {
			return false;
		} else if (isEmpty(video_code, 'Enter Video URL')) {
			return false;
		}
		chksum.value = 'chkin';
	}
}
function chkNews() {
	with (window.document.frmadd) {
		if (cat_id.value == 0 || cat_id.value == "") {
			alert('Select Category');
			cat_id.focus();
			return false;
		}else if (isEmpty(news_title, 'Enter News Title')) {
			return false;
		} else if (isEmpty(news_desc, 'Enter News Description')) {
			return false;
		}
		chksum.value = 'chkin';
	}
}
function chkVidCategory() {
	with (window.document.frmadd) {
		if (isEmpty(cat_title, 'Enter Video Category')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}
function chkAudioCategory() {
	with (window.document.frmadd) {
		if (isEmpty(cat_title, 'Enter Audio Category')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}

function chkTopicsCategory() {
	with (window.document.frmadd) {
		if (isEmpty(cat_title, 'Enter Article Category')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}

function chkTopics() {
	with (window.document.frmadd) {
		if (cat_id.value == 0 || cat_id.value == "") {
			alert('Select Category');
			cat_id.focus();
			return false;
		}else if (isEmpty(topics_title, 'Enter Article Title')) {
			return false;
		} 
		}
		chksum.value = 'chkin';
	}
}

function chkDlCategory() {
	with (window.document.frmadd) {
		if (isEmpty(cat_title, 'Enter Downloads Category')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}
function chkGalCategory() {
	with (window.document.frmadd) {
		if (isEmpty(cat_title, 'Enter Gallery Category')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}
function chkNewsCategory() {
	with (window.document.frmadd) {
		if (isEmpty(cat_title, 'Enter News Category')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}
function chkArticles() {
	with (window.document.frmadd) {
		if (isEmpty(title, 'Enter Title')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}
function chkMenu() {
	with (window.document.frmadd) {
		if (isEmpty(menu_title, 'Enter Menu Title')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}
function chkFooter() {
	with (window.document.frmadd) {
		if (isEmpty(footer_title, 'Enter Footer Title')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}
function chkHeader() {
	with (window.document.frmadd) {
		if (isEmpty(header_title, 'Enter Header Title')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}


function chkMenuCat() {
	with (window.document.frmadd) {
		if (isEmpty(cat_name, 'Enter Category Name')) {
			return false;
		} else if (isEmpty(cat_url, 'Enter Category Url')) {
			return false;
		}		chksum.value = 'chkin';
	}
}

function chkMenuSubCat1() {
	with (window.document.frmadd) {
		if (cat_id.selectedIndex == 0) {
			alert('Select Category');
			cat_id.focus();
			return false;
		} else if (isEmpty(subcat1_name, 'Enter Sub Category 1 Name')) {
			return false;
		} else if (isEmpty(subcat1_url, 'Enter Sub Category 1 Url')) {
			return false;
		}
		chksum.value = 'chkin';
	}
}
function chkMenuSubCat2() {
	with (window.document.frmadd) {
		if (cat_id.selectedIndex == 0) {
			alert('Select Category');
			cat_id.focus();
			return false;
		} else if (subcat1_id.selectedIndex == 0) {
			alert('Select Sub Category');
			subcat1_id.focus();
			return false;
		} else if (isEmpty(subcat2_name, 'Enter Sub Category 2 Name')) {
			return false;
		} else if (isEmpty(subcat2_url, 'Enter Sub Category 2 Url')) {
			return false;
		}
		chksum.value = 'chkin';
	}
}
function chkNewsCat() {
	with (window.document.frmadd) {
		if (isEmpty(cat_name, 'Enter Category Name')) {
			return false;
		}
		chksum.value = 'chkin';
	}
}
function chkNewsSubCat1() {
	with (window.document.frmadd) {
		if (cat_id.selectedIndex == 0) {
			alert('Select Category');
			cat_id.focus();
			return false;
		} else if (isEmpty(subcat1_name, 'Enter Sub Category 1 Name')) {
			return false;
		}
		chksum.value = 'chkin';
	}
}
function chkNewsSubCat2() {
	with (window.document.frmadd) {
		if (cat_id.selectedIndex == 0) {
			alert('Select Category');
			cat_id.focus();
			return false;
		} else if (subcat1_id.selectedIndex == 0) {
			alert('Select Sub Category');
			subcat1_id.focus();
			return false;
		} else if (isEmpty(subcat2_name, 'Enter Sub Category 2 Name')) {
			return false;
		}
		chksum.value = 'chkin';
	}
}

function chkVidCat() {
	with (window.document.frmadd) {
		if (isEmpty(cat_name, 'Enter Category Name')) {
			return false;
		}
		chksum.value = 'chkin';
	}
}

function chkVidSubCat() {
	with (window.document.frmadd) {
		if (cat_id.selectedIndex == 0) {
			alert('Select Category');
			cat_id.focus();
			return false;
		} else if (isEmpty(subcat_name, 'Enter Sub Category Name')) {
			return false;
		}
		chksum.value = 'chkin';
	}
}


