function admin_validate()
{
	if(document.form1.adminname.value=="")
	{
		alert("Please enter username");
		document.form1.adminname.focus();
		return false;
	}
	if(document.form1.adminpass.value=="")
	{
		alert("Please enter password");
		document.form1.adminpass.focus();
		return false;
	}
}
function check_login()
{
	document.form1.admin_login.value="true";
	document.form1.submit();
}


function check_validate_category()
{
	if(document.form1.category_name.value=="")
	{
		alert("Please enter Category name");
		document.form1.category_name.focus();
		return false;
	}
}
function check_validate_sub_category()
{
	if(document.form1.category.value=="")
	{
		alert("Please Select Category");
		document.form1.category.focus();
		return false;
	}
	if(document.form1.category_name.value=="")
	{
		alert("Please enter Category name");
		document.form1.category_name.focus();
		return false;
	}
}


function del(delid)
{
	if(confirm("All contest will be deleted in this category if you delete this Category"))
	{
		window.location = "category.php?action=delete&delid="+delid;
		exit;
	}
}
function del_contest(delid)
{
	if(confirm("All Comments and Vote will be deleted if you delete this Contest"))
	{
		window.location = "my_contest.php?action=delete&delid="+delid;
		exit;
	}
}
function del_image(delid)
{
	if(confirm("Do you really want to delete this Image"))
	{
		window.location = "make_album.php?action=delete&delid="+delid;
		exit;
	}
}
function del_comments(delid,cid)
{
	if(confirm("Do you really want to delete this comment"))
	{
		window.location = "contest.php?action=deletecomment&commentid="+delid+"&CID="+cid;
		exit;
	}
}
function del_comments_user(delid,cid)
{
	if(confirm("Do you really want to delete this comment"))
	{
		window.location = "user_profile.php?action=deletecomment&commentid="+delid+"&CID="+cid;
		exit;
	}
}
function del1(delid)
{
	if(confirm("Do you really want to delete this Link"))
	{
		window.location = "footer_link.php?action=delete&delid="+delid;
		exit;
	}
}
function del2(delid)
{
	if(confirm("Do you Really want to delete this Image"))
	{
		window.location = "user_profile.php?action=delete&delid="+delid;
		exit;
	}
}
function del_subcat(delid,maincatid)
{
	if(confirm("all software will be Deleted under this Sub-category .If you delete this Sub-category"))
	{
		window.location = "sub_category.php?action=delete&delid="+delid+'&category='+maincatid;
		exit;
	}
}
function check_cat_subcat_empty()
{
	if(document.edit.select_category.value=="")
	{
		alert("Please Select Category");
		return false;
	}
	if(document.edit.sub_category.value=="")
	{
		alert("Please Select Sub Category");
		return false;
	}
	
}
///////////////////// END /////////////////////////
function check_add_cat()
{
	if(document.form1.catname1.value=="")
	{
		alert("Please enter Category Name");
		document.form1.catname1.focus();
		return false;
	}
	if(document.form1.catname2.value=="")
	{
		alert("Please enter Category Name");
		document.form1.catname2.focus();
		return false;
	}
	if(document.form1.catname3.value=="")
	{
		alert("Please enter Category Name");
		document.form1.catname3.focus();
		return false;
	}
}
function ban_ipadress()
{
	if(document.form1.ipadress.value=="")
	{
		alert("Please enter IP Address");
		document.form1.ipadress.focus();
		return false;
	}
}
function delete_ip()
{
	if(confirm("Do you want to delete selected IP adsress"))
	{
		document.form1.delip.value="true";
		document.form1.submit();
	}
}

function check_submit_form_validate()
{
	if(document.form1.uname.value=="")
	{
		alert("Please Enter Name");
		document.form1.uname.focus();
		return false;
	}
	if(document.form1.email.value=="")
	{
		alert("Please Enter E-mail Address");
		document.form1.email.focus();
		return false;
	}
	if(document.form1.title.value=="")
	{
		alert("Please Enter Title");
		document.form1.title.focus();
		return false;
	}
	if(document.form1.msg.value=="")
	{
		alert("Please Enter Message");
		document.form1.msg.focus();
		return false;
	}
}
