// 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 chkPedia() {
	with (window.document.frmadd) {
		if (isEmpty(pedia_title, 'Enter Pedia Title')) {
			return false;
		} 
		if (isEmpty(pedia_desc, 'Enter Pedia Description')) {
			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 Type');
			banner_type.focus();
			return false;
		}
		
		if(banner_type.value == "direct"){
			if(bimg[0].checked){
				if (isEmpty(banner_image, 'Enter Banner Image URL')) {
					return false;
				}	
			}
			if(bimg[1].checked){
				if (banner_fimage.value == "") {
					alert('Select Banner to Upload');
					banner_fimage.focus();
					return false;
				}
			}
			if (isEmpty(banner_link, 'Enter Banner Link')) {
				return false;
			}	
		}

		if(banner_type.value == "thirdparty"){
			if (isEmpty(banner_code, 'Enter Banner Code')) {
				return false;
			}	
		}

		chksum.value = 'chkin';		
	}
}
function chkPanchangam() {
	with (window.document.frmadd) {
		if(isEmpty(pan_date, 'Enter Banner Name')) return false;
		else if(isEmpty(pan_year_type, 'Enter Year Type')) return false;
		else if(isEmpty(pan_year_name, 'Enter Year Name')) return false;
		else if(isEmpty(pan_masam, 'Enter Masam')) return false;
		else if(isEmpty(pan_thithi, 'Enter Thithi')) return false;
		else if(isEmpty(pan_nakshatram, 'Enter Nakshatram')) return false;
		else if(isEmpty(pan_varjyam, 'Enter Banner Varjyam')) return false;
		else if(isEmpty(pan_durmuhurtham, 'Enter Durmuhurtham')) return false;
		else if(isEmpty(pan_sunrise, 'Enter Sunrise')) return false;
		else if(isEmpty(pan_sunset, 'Enter Sunset')) return false;
		chksum.value = 'chkin';		
	}
}
function chkHoroscope() {
	with (window.document.frmadd) {
		if(isEmpty(aries, 'Enter Horoscope for Aries')) return false;
		else if(isEmpty(taurus, 'Enter Horoscope for Taurus')) return false;
		else if(isEmpty(gemini, 'Enter Horoscope for Gemini')) return false;
		else if(isEmpty(cancer, 'Enter Horoscope for Cancer')) return false;
		else if(isEmpty(leo, 'Enter Horoscope for Leo')) return false;
		else if(isEmpty(virgo, 'Enter Horoscope for Virgo')) return false;
		else if(isEmpty(libra, 'Enter Horoscope for Libra')) return false;
		else if(isEmpty(scorpio, 'Enter Horoscope for Scorpio')) return false;
		else if(isEmpty(sagittarius, 'Enter Horoscope for Sagittarius')) return false;
		else if(isEmpty(capricorn, 'Enter Horoscope for Capricorn')) return false;
		else if(isEmpty(aquarius, 'Enter Horoscope for Aquarius')) return false;
		else if(isEmpty(pisces, 'Enter Horoscope for Pisces')) 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 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 Topic Title')) {
			return false;
		} else if (isEmpty(topics_desc, 'Enter Topic Description')) {
			return false;
		}
		chksum.value = 'chkin';
	}
}
function chkGreetings() {
	with (window.document.frmadd) {
		if (cat_id.value == 0 || cat_id.value == "") {
			alert('Select Category');
			cat_id.focus();
			return false;
		}else if (isEmpty(greetings_title, 'Enter Greeting Title')) {
			return false;
		} else if (isEmpty(greetings_desc, 'Enter Greetings Description')) {
			return false;
		}
		chksum.value = 'chkin';
	}
}
function chkProducts() {
	with (window.document.frmadd) {
		if (cat_id.value == 0 || cat_id.value == "") {
			alert('Select Category');
			cat_id.focus();
			return false;
		}else if (isEmpty(products_title, 'Enter Product Title')) {
			return false;
		} else if (isEmpty(products_desc, 'Enter Product Description')) {
			return false;
		} else if (isEmpty(products_price, 'Enter Product Price')) {
			return false;
		} else if (isEmpty(products_quantity, 'Enter Product Quantity')) {
			return false;
		} else if (isEmpty(india_ship_cost, 'Enter India Shipping Cost')) {
			return false;
		} else if (isEmpty(us_ship_cost, 'Enter US/Canada Shipping Cost')) {
			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 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 chkTopicsCategory() {
	with (window.document.frmadd) {
		if (isEmpty(cat_title, 'Enter News Category')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}
function chkGreetingsCategory() {
	with (window.document.frmadd) {
		if (isEmpty(cat_title, 'Enter Greetings Category')) {
			return false;
		}
		if (isEmpty(cat_desc, 'Enter Greetings Description')) {
			return false;
		}		
		chksum.value = 'chkin';
	}
}
function chkProductsCategory() {
	with (window.document.frmadd) {
		if (isEmpty(cat_title, 'Enter Products Category')) {
			return false;
		}
		if (isEmpty(cat_desc, 'Enter Products Description')) {
			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';
	}
}


