function login_user(thisform) /////******VALIDATION FOR LOGIN PAGE***********////////
{
	
	if(document.loginform.uname.value == "")
	{
		alert("Please enter Username.");
		document.loginform.uname.focus();
		return false;
	}
	if(document.loginform.pass.value == "")
	{
		alert("Please enter Password.");
		document.loginform.pass.focus();
		return false;
	}
	
} 
/////////*****ALERT ON ADD A CELEBRITY PHOTO BUTTON ON INDEX.PHP*******///////
function loginalert()
{
	alert("Please Login to post celebrities photos.");
	return false;
}
////////*********ORDER BY IN ALL.PHP**************/////////////
function searchby_rating(thisform,cid)
{
		if(cid!="")
		{
			document.searching.action="all.php?mode=rate&cid="+cid;
			document.searching.submit();
		}
		else
		{
			document.searching.action="all.php?mode=rate";
			document.searching.submit();
		}
}
function searchby_name(thisform,cid)
{
		if(cid!="")
		{
			document.searching.action="all.php?mode=name&cid="+cid;
			document.searching.submit();
		}
		else
		{
			document.searching.action="all.php?mode=name";
			document.searching.submit();
		}
}
function searchby_date(thisform,cid)
{
		if(cid!="")
		{
			document.searching.action="all.php?mode=date&cid="+cid;
			document.searching.submit();
		}
		else
		{
			document.searching.action="all.php?mode=date";
			document.searching.submit();
		}
}
function searchby_gender(thisform,cid)
{
		if(cid!="")
		{
			document.searching.action="all.php?mode=sex&cid="+cid;
			document.searching.submit();
		}
		else
		{
			document.searching.action="all.php?mode=sex";
			document.searching.submit();
		}
}

//////////////***********ORDER BY IN CELEBRITY.PHP*********////////////
function celebrity_rating(thisform,cn_id)
{
		if(cn_id!="")
		{
			document.searching.action="celebrity.php?mode=rate&cn_id="+cn_id;
			document.searching.submit();
		}
		else
		{
			document.searching.action="celebrity.php?mode=rate";
			document.searching.submit();
		}
}

function celebrity_date(thisform,cn_id)
{
		if(cn_id!="")
		{
			document.searching.action="celebrity.php?mode=date&cn_id="+cn_id;
			document.searching.submit();
		}
		else
		{
			document.searching.action="celebrity.php?mode=date";
			document.searching.submit();
		}
}

//////////*********ORDER BY TOP_RATED.PHP***********///////////////
function top_rated_pic(thisform)
{
	document.searching.action="top_rated.php?mode=rate";
	document.searching.submit();
}
function top_rated_byname(thisform)
{
	document.searching.action="top_rated.php?mode=name";
	document.searching.submit();
}
function top_rated_bydate(thisform)
{
	document.searching.action="top_rated.php?mode=date";
	document.searching.submit();
}
function top_rated_bysex(thisform)
{
	document.searching.action="top_rated.php?mode=sex";
	document.searching.submit();
}

/////////////**********ORDER BY IN HOME.PHP**************////////////////
function home_rating(thisform)
{
	document.searching.action="home.php?mode=rate";
	document.searching.submit();
}
function home_name(thisform)
{
	document.searching.action="home.php?mode=name";
	document.searching.submit();
}
function home_date(thisform)
{
	document.searching.action="home.php?mode=date";
	document.searching.submit();
}
function home_gender(thisform)
{
	document.searching.action="home.php?mode=sex";
	document.searching.submit();
}
 
////////*********PAGGING IN TOP_RATED.PHP*********///////////
function Pagging_toprated(page)
{
	document.toprated.action="top_rated.php?page="+page;
	document.toprated.submit();
}

////////*********PAGGING IN RECENTLY_ADDED.PHP*********///////////
function Pagging_recently_added(page)
{
	document.recenly_added_form.action="recently_added.php?page="+page;
	document.recenly_added_form.submit();
}

///////////********PAGGING IN ALL.PHP**********////////////
function Pagging_all_pics(page,cid)
{
	document.all_pics.action="all.php?page="+page+"&cid="+cid;
	document.all_pics.submit();
}

////////*********PAGGING IN CELEBRITY.PHP**********/////////
function Pagging_pics(page)
{
	document.pics.action="index.php?page="+page;
	document.pics.submit();
}

function Pagging_myaccount(page)
{
	document.myaccount.action="myaccount.php?page="+page;
	document.myaccount.submit();
}

function Pagging_view(page)
{
	document.view_photo.action="view_add_photo.php?page="+page;
	document.view_photo.submit();
}

//////////********PAGGING ON HOME.PHP**********///////////////
function Pagging_home(page)
{
	document.home_page.action="home.php?page="+page;
	document.home_page.submit();
}

/////////*****PAGGING IN BLOG.PHP (MESSAGE BOARD) PAGE **/////
function Pagging(page)
{
	document.post.action="blog.php?page="+page;
	document.post.submit();
}

//////****DELETE PIC BY LOGIN USER IN MYPHOTOS.PHP******/////////
function del_homepic(photoid,page,numrow)
{
	if(confirm("Do you want to delete this Pic"))
	{
		document.searching.action="my_photos.php?mode=del&pid="+photoid+"&page="+page+"&remaining="+numrow;
		document.searching.submit();
	}
	else
	{
		return false;
	}
}
		function login()
		{
			if (document.form1.fname.value=="")
			  {
				alert("	Please enter a username.");
				document.form1.fname.focus();
				return false;
			  }
		  if (document.form1.pword.value=="")
		  {
			alert("Please enter a password.");
			document.form1.pword.focus();
			return false;
		  }
		  //document.form1.action="index.php?mode=login";
		  //document.form1.submit();
//		  else{return true}
		}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		layout_15_over = newImage("images/layout_15-over.gif");
		layout_16_over = newImage("images/layout_16-over.gif");
		layout_18_over = newImage("images/layout_18-over.gif");
		layout_20_over = newImage("images/layout_20-over.gif");
		preloadFlag = true;
	}
}
	function largeimage(imgid) 
	{
		var newwindow=window.open("show_picture.php?pid="+escape(imgid),"",'width=700,height=600,scrollbars=yes,resizable=yes');
		newwindow.moveTo(100,50);
	}
/*function all_rate(photoid)
{
	document.searching.action="index1.php?imgid="+photoid;
	document.searching.submit();
}
function celebrity_rate(photoid)
{
	document.searching.action="index1.php?imgid="+photoid;
	document.searching.submit();
}

function top_rated_rate(photoid)
{
	document.searching.action="index1.php?imgid="+photoid;
	document.searching.submit();
}*/

function validate()
	{
		if(document.photo.catname.value=="")
		{
			alert("Category name can not be blank");
			document.photo.catname.focus();
			return false;
		}
		if(document.photo.title.value=="")
		{
			alert("Title can not be blank");
			document.photo.title.focus();
			return false;
		}
	}
	
function Form1_Validator(theForm)
{
	if(document.form1.image.value=="")
	{
		alert("Please submit a picture. Make sure the filesize is less than 500000 bytes.");
		document.form1.image.focus();
		return false;
	}
}

function removeImage(rpid)
{
	if(confirm("Are you sure you want to delete this Picture"))
	{
		document.form1.action="edit_photo.php?mode=rem&pid="+escape(rpid);
		document.form1.submit();
	}
}
function DelectuserConfirm(searchmid,page,no_rows) {
	if(confirm("Do you want to delete ?"))
	{
	
		document.form1.remuser_mid.value=searchmid;
		document.form1.action="view_add_photo.php?m=del&page="+page+"&no_rows="+no_rows;
		document.form1.submit();
	}
}


var http_request = false;
var tempTxt;
function makeRequest(url,txt,strVariables) 
	{
	
	http_request = false;
	tempTxt=txt;
	if (window.XMLHttpRequest)
		{ // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType)
			{
			http_request.overrideMimeType('text/xml');
			// See note below about this line
			}
		}
	else if (window.ActiveXObject)
		{ // IE
		try
			{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try
				{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (e)
				{
				}
			}
		}
	if (!http_request)
		{
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
		}
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
	http_request.send(strVariables);
	http_request.onreadystatechange = alertContents;
	}

function alertContents()
	{
	
	if (http_request.readyState == 4)
		{
		if (http_request.status == 200)
			{		
				var resul= http_request.responseText;
				document.getElementById(tempTxt).innerHTML=http_request.responseText;
				if(tempTxt=="byadmin")
				{
					var resul= http_request.responseText;
					
					document.getElementById('byadmin').innerHTML=resul;
					
					//document.getElementById('shippingArea').innerHTML=b;
					
					if(resul=='$0.00')
					{
						document.getElementById('byadmin').innerHTML='121';
						//document.getElementById('display').style.display = 'none';
					}
				}
			}
			else
				{
				alert('There was a problem with the request.');
				}
		   }
		else if (http_request.readyState == 1 )
			{
			
			document.getElementById(tempTxt).innerHTML = "sorry";
			
			}
		}
		
function bigphoto(image)
{
//var categ=document.datashow.categ.value;
	var divid = document.getElementById('byadmin');
	divid.innerHTML = "<img src=\"img_vignette.php?img="+image+"&mode=fet&w=450&h=300&far=C&f=jpg&fltr[]=bord|1\">";
	//var divid = document.getElementById('byuser');
	//divid.innerHTML = "<img src=\"img_vignette.php?img="+image+"&mode=fet&w=450&h=300&far=C&f=jpg&fltr[]=bord|1\">";
}
//++++++++++
var http_request = false;
var tempTxt;
function makeRequest(url,txt,strVariables) 
	{
	
	http_request = false;
	tempTxt=txt;
	if (window.XMLHttpRequest)
		{ // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType)
			{
			http_request.overrideMimeType('text/xml');
			// See note below about this line
			}
		}
	else if (window.ActiveXObject)
		{ // IE
		try
			{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try
				{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (e)
				{
				}
			}
		}
	if (!http_request)
		{
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
		}
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
	http_request.send(strVariables);
	http_request.onreadystatechange = alertContents;
	}

function alertContents()
	{
	
	if (http_request.readyState == 4)
		{
		if (http_request.status == 200)
			{		
				var resul= http_request.responseText;
				document.getElementById(tempTxt).innerHTML=http_request.responseText;
				if(tempTxt=="byuser")
				{
					var resul= http_request.responseText;
					
					document.getElementById('byuser').innerHTML=resul;
					
					//document.getElementById('shippingArea').innerHTML=b;
					
					if(resul=='$0.00')
					{
						document.getElementById('byuser').innerHTML='121';
						//document.getElementById('display').style.display = 'none';
					}
				}
			}
			else
				{
				alert('There was a problem with the request.');
				}
		   }
		else if (http_request.readyState == 1 )
			{
			
			document.getElementById(tempTxt).innerHTML = "sorry";
			
			}
		}
		
function bigphoto_user(image)
{
//var categ=document.datashow.categ.value;
	var divid = document.getElementById('byuser');
	divid.innerHTML = "<img src=\"img_vignette.php?img="+image+"&mode=fet2&w=450&h=300&far=C&f=jpg&fltr[]=bord|1\">";
	//var divid = document.getElementById('byuser');
	//divid.innerHTML = "<img src=\"img_vignette.php?img="+image+"&mode=fet&w=450&h=300&far=C&f=jpg&fltr[]=bord|1\">";
}



//++++++++++ view.php
var http_request = false;
var tempTxt;
function makeRequest(url,txt,strVariables) 
	{
	
	http_request = false;
	tempTxt=txt;
	if (window.XMLHttpRequest)
		{ // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType)
			{
			http_request.overrideMimeType('text/xml');
			// See note below about this line
			}
		}
	else if (window.ActiveXObject)
		{ // IE
		try
			{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try
				{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (e)
				{
				}
			}
		}
	if (!http_request)
		{
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
		}
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
	http_request.send(strVariables);
	http_request.onreadystatechange = alertContents;
	}

function alertContents()
	{
	
	if (http_request.readyState == 4)
		{
		if (http_request.status == 200)
			{		
				var resul= http_request.responseText;
				document.getElementById(tempTxt).innerHTML=http_request.responseText;
				if(tempTxt=="view")
				{
					var resul= http_request.responseText;
					
					document.getElementById('view').innerHTML=resul;
					
					//document.getElementById('shippingArea').innerHTML=b;
					
					if(resul=='$0.00')
					{
						document.getElementById('view').innerHTML='121';
						//document.getElementById('display').style.display = 'none';
					}
				}
			}
			else
				{
				alert('There was a problem with the request.');
				}
		   }
		else if (http_request.readyState == 1 )
			{
			
			document.getElementById(tempTxt).innerHTML = "sorry";
			
			}
		}
		
function big_view(image)
{ 
document.getElementById('did').value=image;
	//var dimge=document.getElementById('did').value;
	//alert(dimge);

//alert(image);
//var categ=document.datashow.categ.value;
	var divid = document.getElementById('view');
	divid.innerHTML = "<img src=\"img_vignette.php?img="+image+"&mode=fetch&w=300&h=400&far=C&f=jpg&fltr[]=bord|1\">";
	
	/////////var comnt=document.getElementById(cmt).value;
	
	/////////////var strVariables = "imgdivid="+imgdivid+"&aid="+aid+"&cid="+cid+"&mode=postcommet";
	//////////////makeRequest('view1.php',"postcomment",strVariables);
	
	//var im = document.getElementById(image);
	     
		  //divid.innerHTML = "imgname=imgname";
	//var divid = document.getElementById('byuser');
	//divid.innerHTML = "<img src=\"img_vignette.php?img="+image+"&mode=fet&w=450&h=300&far=C&f=jpg&fltr[]=bord|1\">";
}
//comment..........................
var http_request = false;
var tempTxt;
function makeRequest(url,txt,strVariables) 
	{
	
	http_request = false;
	tempTxt=txt;
	if (window.XMLHttpRequest)
		{ // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType)
			{
			http_request.overrideMimeType('text/xml');
			// See note below about this line
			}
		}
	else if (window.ActiveXObject)
		{ // IE
		try
			{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try
				{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (e)
				{
				}
			}
		}
	if (!http_request)
		{
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
		}
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
	http_request.send(strVariables);
	http_request.onreadystatechange = alertContents;
	}

function alertContents()
	{
	
	if (http_request.readyState == 4)
		{
		if (http_request.status == 200)
			{		
				var resul= http_request.responseText;
				document.getElementById(tempTxt).innerHTML=http_request.responseText;
				if(tempTxt=="commentall")
				{
					var resul= http_request.responseText;
					
					document.getElementById('commentall').innerHTML=resul;
					
					//document.getElementById('shippingArea').innerHTML=b;
					
					if(resul=='$0.00')
					{
						document.getElementById('commentall').innerHTML='121';
						//document.getElementById('display').style.display = 'none';
					}
				}
			}
			else
				{
				alert('There was a problem with the request.');
				}
		   }
		else if (http_request.readyState == 1 )
			{
			
			document.getElementById(tempTxt).innerHTML = "sorry";
			
			}
		}
		
function commentshow(img)
{ 

	var strVariables = "img="+img+"&mode=coment_photo";
	makeRequest('view1.php',"commentall",strVariables);
	
	
}

//coment


//++++++++++++++++++++++

var http_request = false;
var tempTxt;
function makeRequest(url,txt,strVariables) 
	{
	
	http_request = false;
	tempTxt=txt;
	if (window.XMLHttpRequest)
		{ // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType)
			{
			http_request.overrideMimeType('text/xml');
			// See note below about this line
			}
		}
	else if (window.ActiveXObject)
		{ // IE
		try
			{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try
				{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (e)
				{
				}
			}
		}
	if (!http_request)
		{
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
		}
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
	http_request.send(strVariables);
	http_request.onreadystatechange = alertContents;
	}

function alertContents()
	{
	
	if (http_request.readyState == 4)
		{
		if (http_request.status == 200)
			{		
				var resul= http_request.responseText;
				document.getElementById(tempTxt).innerHTML=http_request.responseText;
				if(tempTxt=="postcomment")
				{
					var resul= http_request.responseText;
					
					document.getElementById('postcomment').innerHTML=resul;
					
					//document.getElementById('shippingArea').innerHTML=b;
					
					if(resul=='$0.00')
					{
						document.getElementById('postcomment').innerHTML='121';
						//document.getElementById('display').style.display = 'none';
					}
				}
			}
			else
				{
				alert('There was a problem with the request.');
				}
		   }
		else if (http_request.readyState == 1 )
			{
			
			document.getElementById(tempTxt).innerHTML = "sorry";
			
			}
		}
		
function comment(imgdivid,aid,cid)
{ 
//alert(imgdivid);

var didi=document.getElementById('did').value;
alert(didi);
//alert(imgdivid);
//document.getElementById('did').value=image;
	
	//var divid = document.getElementById('postcomment');
	//divid.innerHTML = "view.php?imgdivid="+imgdivid+"&aid="+aid+"&cid="+cid+"&mode=postcommet";
	
	
	var strVariables = "imgdivid="+imgdivid+"&aid="+aid+"&cid="+cid+"&mode=postcommet";
	makeRequest('view1.php',"postcomment",strVariables);
}







//++++++++++
//++++++Comment Posted+++++++++++++++++++/

var http_request = false;
var tempTxt;
function makeRequest(url,txt,strVariables) 
	{
	
	http_request = false;
	tempTxt=txt;
	if (window.XMLHttpRequest)
		{ // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType)
			{
			http_request.overrideMimeType('text/xml');
			// See note below about this line
			}
		}
	else if (window.ActiveXObject)
		{ // IE
		try
			{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try
				{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (e)
				{
				}
			}
		}
	if (!http_request)
		{
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
		}
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
	http_request.send(strVariables);
	http_request.onreadystatechange = alertContents;
	}

function alertContents()
	{
	
	if (http_request.readyState == 4)
		{
		if (http_request.status == 200)
			{		
				var resul= http_request.responseText;
				document.getElementById(tempTxt).innerHTML=http_request.responseText;
				if(tempTxt=="commentposted")
				{
					var resul= http_request.responseText;
					
					document.getElementById('commentposted').innerHTML=resul;
					
					//document.getElementById('shippingArea').innerHTML=b;
					
					if(resul=='$0.00')
					{
						document.getElementById('commentposted').innerHTML='121';
						//document.getElementById('display').style.display = 'none';
					}
				}
			}
			else
				{
				alert('There was a problem with the request.');
				}
		   }
		else if (http_request.readyState == 1 )
			{
			
			document.getElementById(tempTxt).innerHTML = "sorry";
			
			}
		}
		
function comment_post(did,cid,text,aid,mid)
{ 
alert(did);

//var didi=document.getElementById('did').value;
//alert(didi);
//alert(imgdivid);
//document.getElementById('did').value=image;
	
	//var divid = document.getElementById('postcomment');
	//divid.innerHTML = "view.php?imgdivid="+imgdivid+"&aid="+aid+"&cid="+cid+"&mode=postcommet";
	
	
	var strVariables = "did="+did+"&cid="+cid+"&text="+text+"&aid="+aid+"&mid="+mid+"&mode=Comment_Posted";
	makeRequest('view1.php',"commentposted",strVariables);
}






//++++++End+++++++++++++++++++


var http_request = false;
var tempTxt;
function makeRequest(url,txt,strVariables) 
	{
	
	http_request = false;
	tempTxt=txt;
	if (window.XMLHttpRequest)
		{ // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType)
			{
			http_request.overrideMimeType('text/xml');
			// See note below about this line
			}
		}
	else if (window.ActiveXObject)
		{ // IE
		try
			{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try
				{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (e)
				{
				}
			}
		}
	if (!http_request)
		{
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
		}
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
	http_request.send(strVariables);
	http_request.onreadystatechange = alertContents;
	}

function alertContents()
	{
	
	if (http_request.readyState == 4)
		{
		if (http_request.status == 200)
			{		
				var resul= http_request.responseText;
				document.getElementById(tempTxt).innerHTML=http_request.responseText;
				if(tempTxt=="forgatepass")
				{
					var resul= http_request.responseText;
					
					document.getElementById('forgatepass').innerHTML=resul;
					
					//document.getElementById('shippingArea').innerHTML=b;
					
					if(resul=='$0.00')
					{
						document.getElementById('forgatepass').innerHTML='121';
						//document.getElementById('display').style.display = 'none';
					}
				}
			}
			else
				{
				alert('There was a problem with the request.');
				}
		   }
		else if (http_request.readyState == 1 )
			{
			
			document.getElementById(tempTxt).innerHTML = "sorry";
			
			}
		}
		
function forgate()
{
//var city=document.datashow.city.value;


	var strVariables = 'action=getforgate';
	makeRequest('getforgate.php',"forgatepass",strVariables);
}


function postComment()
{		
		//if (LOGGED_IN == false){
		//go('index.php?url='+escape(CURRENT_URL));
			//return false;
		//}
		
		if(document.commentform.textarea.value == "")
	{
		alert("You must enter a comment!");
		document.commentform.textarea.focus();
		return false;
	}
	
	
	
		return true;
}
function postCommentset()
{		

if(document.view.desc.value == "")
	{
		alert("You must enter a comment!");
		document.view.desc.focus();
		return false;
	}
	
		return true;
}
				
		/*
		var comment_form = document.forms[form_id];
        var textarea = comment_form.textarea;
        var comment_button = comment_form.comment_button;
       
        if (textarea.value.length == 0 || textarea.value == null) {
            alert("You must enter a comment!");
            textarea.focus();
            alert('textarea');
			return false;
        }

        if (textarea.value.length > 500) {
            alert("Your comment must be shorter than 500 characters!");
            textarea.focus();
            return false;
        }
		
		makeHttpRequest(comment_form.name,commentResXML);
		*/
        
//function validate_category_for_edit(thisform,catid,page)
//{
//	if(document.edit_category_form.cate_name.value == "")
//	{
//		alert("Please enter Category name.");
//		document.edit_category_form.cate_name.focus();
//		return false;
//	}
//	else
//	{
//		document.edit_category_form.action="edit_category_list.php?mode=edit&catid="+catid+"&page="+page;
//		document.edit_category_form.submit();
//	}
//}
//function validate_subcategory_for_edit(thisform,catid,page,c_name,search_word)
//{
//	if(document.edit_subcategory_form.sub_cate_name.value == "")
//	{
//		alert("Please enter Subcategory name.");
//		document.edit_subcategory_form.sub_cate_name.focus();
//		return false;
//	}
//	else
//	{
//		if(c_name!="")
//		{
//			c_name=c_name.replace(/\s/g,"+");
//		}
//		if(search_word!="")
//		{
//			search_word=search_word.replace(/\s/g,"+");
//		}
//		document.edit_subcategory_form.action="edit_subcategory_list.php?mode=edit&catid="+catid+"&page="+page+"&c_name="+c_name+"&sub_cate_name="+search_word;
//		document.edit_subcategory_form.submit();
//	}
//}
//function validate_username(thisform)
//{
//	with (thisform)
//	{
//	 if (document.adminlogin.uname.value=="")
//	  {
//		alert("Please enter a username.");
//		document.adminlogin.uname.focus();
//		return false;
//	  }
//		var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.";
//		var checkOK1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_";
//		var ctr=document.adminlogin;
//		var checkStr = ctr.uname.value;
//
//			var allValid = true;
//			for (i = 0;  i < checkStr.length;  i++)
//			{
//					ch = checkStr.charAt(i);
//					ch1 = checkStr.charAt(0);
//				for (k=0; k < checkOK1.length; k++)
//					if (ch1 == checkOK1.charAt(k))
//							break;
//					if (k == checkOK.length)
//					{
//						 allValid = false;
//						 break;
//					}
//					for (j = 0;  j < checkOK.length;  j++)
//						if (ch == checkOK.charAt(j))
//							break;
//						if (j == checkOK.length)
//						{
//							allValid = false;
//							break;
//						}
//			}
//			if (!allValid)
//			{
//				alert("Use only letters, numbers, dot(.) or the underscore (_). No spaces or special characters please.");
//				ctr.uname.focus();
//				return false;
//			}
//			if (document.adminlogin.uname.value.length < 5)
//			  {
//				alert("Your Username must be at least 5 characters long.");
//				document.adminlogin.uname.focus();
//				return false;
//			  }
//		  if (document.adminlogin.pass.value=="")
//		  {
//			alert("Please enter password.");
//			document.adminlogin.pass.focus();
//			return false;
//		  }
//		  if (document.adminlogin.pass.value.length < 4)
//		  {
//			alert("Your password must be at least 4 characters long.");
//			document.adminlogin.pass.focus();
//			return false;
//		  }
//	}
//}
//
//function confirm_edit_cate(catid,page) 
//{
//		document.main_category_list.action="edit_category_list.php?catid="+catid+"&page="+page;
//		document.main_category_list.submit();
//}
//function confirm_delete_cate(catid) 
//{
//	if(confirm("Do you really want to delete this category ?"))
//	{
//		document.main_category_list.action="view_category_list.php?mode=del&catid="+catid;
//		document.main_category_list.submit();
//	}
//}
//function confirm_edit_subcate(subcatid,page,c_name) 
//{
//		if(c_name!="")
//		{
//			c_name=c_name.replace(/\s/g,"+");
//		}
//		if(document.sub_category_list.sub_cate_name.value.length>0)
//		{
//			var search_word=document.sub_category_list.sub_cate_name.value;
//			if(search_word!="")
//			{
//				search_word=search_word.replace(/\s/g,"+");
//			}
//			document.sub_category_list.action="edit_subcategory_list.php?catid="+subcatid+"&page="+page+"&c_name="+c_name+"&sub_cate_name="+search_word;
//		}
//		else
//		{
//			document.sub_category_list.action="edit_subcategory_list.php?catid="+subcatid+"&page="+page+"&c_name="+c_name	
//		}
//		document.sub_category_list.submit();
//}
//function confirm_delete_subcate(subcatid) 
//{
//	if(confirm("Do you really want to delete this Subcategory ?"))
//	{
//		document.sub_category_list.action="view_subcategory_list.php?mode=del&subcatid="+subcatid;
//		document.sub_category_list.submit();
//	}
//}
//function Pagging(page)
//{
//	document.main_category_list.action="view_category_list.php?page="+page;
//	document.main_category_list.submit();
//}
//function Pagging_viewsubcat(page)
//{
//	document.sub_category_list.action="view_subcategory_list.php?page="+page;
//	document.sub_category_list.submit();
//}
//function Pagging_pending_ad(page)
//{
//	document.pending_result.action="view_pending_ad_list.php?page="+page;
//	document.pending_result.submit();
//}
//function Pagging_approved_ad(page)
//{
//	document.pending_result.action="view_approved_ad_list.php?page="+page;
//	document.pending_result.submit();
//}
//
//function Pagging_view_reply(page,adid)
//{
//	document.view_all_reply_form.action="view_all_reply.php?mode=view&page="+page+"&ad_id="+adid;
//	document.view_all_reply_form.submit();
//}
//function updatepassword() 
//{
//	if(document.change_password.pass_word.value == "")
//	{
//		alert("Please enter your Password.");
//		document.change_password.pass_word.focus();
//		return false;
//	}
//	if (document.change_password.pass_word.value.length < 4)
//	{
//			alert("Your password must be at least 4 characters long.");
//			document.change_password.pass_word.focus();
//			return false;
//	}
//	else(confirm("Do you really want to Update Your password ?"))
//	{
//		document.change_password.action="change_password.php?m=change";
//		document.change_password.submit();
//	}
//	
//}
//function sel_cate()
//{
//	var category_name=document.sub_category_list.category_name.value;
//	if(category_name!="")
//    {
//    	category_name=category_name.replace(/\s/g,"+");
//    }
//	else
//	{
//		category_name="All";
//	}
//	document.sub_category_list.action="view_subcategory_list.php?c_name="+category_name;
//	document.sub_category_list.submit();
//}
//function search_subcat()
//{
//	var sub_cate_name=document.sub_category_list.sub_cate_name.value;
//	if(document.sub_category_list.sub_cate_name.value=="")
//	{
//		alert("Please enter some text to search.");
//		document.sub_category_list.sub_cate_name.focus();
//	return false;
//	}
//	else
//	{
//		document.sub_category_list.action="view_subcategory_list.php?mode=search";
//		document.sub_category_list.submit();
//	}
//}
//function adpost()
//{
//	//var category_name=document.postad.category_name.value;
////	temp=category_name.split("-");
////	var catid=temp[0];
////	var catname=temp[1];
////	if(catname!="")
////    {
////    	catname=category_name.replace(/\s/g,"+");
////    }
//	//document.postad.action="postanad.php?c_name="+temp[1];
//	document.postad.action="postanad.php";
//	document.postad.submit();
//}
//function validate_email(field,alerttxt)
//{
//		with (field)
//		{
//		apos=value.indexOf("@")
//		dotpos=value.lastIndexOf(".")
//		if (apos<1||dotpos-apos<2)
//		  {alert(alerttxt);return false}
//		else {return true}
//		}
//}
//function validate_postad_form(thisform)
//{
//	with (thisform)
//	{
//		if (thisform.category_name.selectedIndex <= 0)
//		{
//			alert("Please select Category.");
//			thisform.category_name.focus();
//			return (false);
//		}
//		var radioSelected = "no";
//		for (i = 0;  i < thisform.adtype.length;  i++)
//		{
//			if (thisform.adtype[i].checked)
//			{
//				radioSelected = "yes";
//			}
//		}
//		if (radioSelected=="no")
//		{
//			alert("Please enter Ad Type.");
//			return (false);
//		}
//		if (thisform.title.value=="")
//		  {
//			alert("Enter Your Ad title.");
//			thisform.title.focus();
//			return false;
//		  }
//		if (thisform.title.value.length < 5)
//		  {
//			alert("Your Ad Title must be at least 5 characters long.");
//			thisform.title.focus();
//			return false;
//		  }
//		if (thisform.title.value.length >50)
//		  {
//			alert("Your Ad Title must be at most 50 characters long.");
//			thisform.title.focus();
//			return false;
//		  }
//		 if (thisform.description.value=="")
//		  {
//			alert("Enter Your Ad Description.");
//			thisform.description.focus();
//			return false;
//		  }
//		if (thisform.description.value.length < 50)
//		  {
//			alert("Your Ad Description must be at least 50 characters long.");
//			thisform.description.focus();
//			return false;
//		  }
//		if (thisform.description.value.length >2000)
//		  {
//			alert("Your Ad Description must be at most 2000 characters long.");
//			thisform.description.focus();
//			return false;
//		  }
//		 /*if (thisform.image.value=="")
//		  {
//			alert("Enter Photo for Your Ad.");
//			thisform.image.focus();
//			return false;
//		  }*/
//		 if (thisform.name.value=="")
//		  {
//			alert("Your name is required.");
//			thisform.name.focus();
//			return false;
//		  }
//		  if (thisform.address.value=="")
//		  {
//			alert("Your address is required.");
//			thisform.address.focus();
//			return false;
//		  }
//		  if (thisform.email.value=="")
//		  {
//			alert("Enter your valid email address.");
//			thisform.email.focus();
//			return false;
//		  }
//			if (validate_email(email,"Not a valid e-mail address!")==false)
//			{
//				email.focus();
//				return false;
//			}
//		  if (thisform.phone.value=="")
//		  {
//			alert("Enter your Contact number.");
//			thisform.phone.focus();
//			return false;
//		  }
//		  if (thisform.phone.value.length>12)
//		  {
//			alert("Max 12 characters allowed.");
//			thisform.phone.focus();
//			return false;
//		  }
//		  
//	}
//}
//function ad_view_search()
//{
//	document.view_ad.action="view_pending_ad_list.php";
//	document.view_ad.submit();
//}
//function approved_ad_view_search()
//{
//	document.view_ad.action="view_approved_ad_list.php";
//	document.view_ad.submit();
//}
//function ad_view_email_search(thisform)
//{
//	if (thisform.email.value!=="")
//	{
//		if ((thisform.email.value.indexOf("@")==-1) ||(thisform.email.value.indexOf(".")==-1))
//		{
//			alert ("Please enter a vaild Email address.");
//			thisform.email.focus();
//			return false;
//		}
//	}
//}
//
//function edit_pending_ad(adid,page)
//{
//	document.pending_result.action="postanad.php?mode=edit&list=pending&ad_id="+adid+"&page="+page;
//	document.pending_result.submit();
//}
//function edit_approved_ad(adid,page)
//{
//	document.pending_result.action="postanad.php?mode=edit&list=approved&ad_id="+adid+"&page="+page;
//	document.pending_result.submit();
//}
//
//function delete_ad(adid,page,num_result)
//{
//	if(confirm("Do you really want to delete this Ad ?"))
//	{
//		document.pending_result.action="view_pending_ad_list.php?mode=del_Ad&ad_id="+adid+"&page="+page+"&no_res="+num_result;
//		document.pending_result.submit();
//	}
//}
//function delete_approved_ad(adid,page,num_result)
//{
//	if(confirm("Do you really want to delete this Ad ?"))
//	{
//		document.pending_result.action="view_approved_ad_list.php?mode=del_Ad&ad_id="+adid+"&page="+page+"&no_res="+num_result;
//		document.pending_result.submit();
//	}
//}
//
//function approved_ad(adid,page,num_result)
//{
//	if(confirm("Do you really want to Approved this Ad ?"))
//	{
//		document.pending_result.action="view_pending_ad_list.php?mode=apr_Ad&ad_id="+adid+"&page="+page+"&no_res="+num_result;
//		document.pending_result.submit();
//	}
//}
//
//function reject_ad(adid,page,num_result)
//{
//	if(confirm("Do you really want to Reject this Ad ?"))
//	{
//		document.pending_result.action="view_pending_ad_list.php?mode=reject_Ad&ad_id="+adid+"&page="+page+"&no_res="+num_result;
//		document.pending_result.submit();
//	}
//}
//
//var checked = false;
//function checkUncheckAll(val)
//{
//     checked = !checked;
//     var form1 = document.forms.pending_result, z = 0;
//	 for(z=0; z<form1.length;z++)
//	 {
//		  if(form1[z].type == 'checkbox') 
//		  {
//			 form1[z].checked = checked;
//		  }
//     }
//}
//var checked = false;
//function checkUncheck(val)
//{
//     checked = !checked;
//     var form1 = document.forms.view_all_reply_form, z = 0;
//	 for(z=0; z<form1.length;z++)
//	 {
//		  if(form1[z].type == 'checkbox') 
//		  {
//			 form1[z].checked = checked;
//		  }
//     }
//	 document.getElementById('selectbutton').value = checked ? 'unselect all' : ' select all ';
//}
//
//function delete_all_ad(page)
//{
//	if(confirm("Do you really want to delete all Ads ?"))
//	{
//		document.pending_result.action="view_pending_ad_list.php?mode=del_All&page="+page;
//		document.pending_result.submit();
//	}
//}
//
//function delete_all_approved_ad(page)
//{
//	if(confirm("Do you really want to delete all Ads ?"))
//	{
//		document.pending_result.action="view_approved_ad_list.php?mode=del_All&page="+page;
//		document.pending_result.submit();
//	}
//}
//
//function approve_all_ad(page)
//{
//	if(confirm("Do you really want to Approve all Ads ?"))
//	{
//		document.pending_result.action="view_pending_ad_list.php?mode=apr_All&page="+page;
//		document.pending_result.submit();
//	}
//}
//
//function reject_all_ad(page)
//{
//	if(confirm("Do you really want to Reject all Ads ?"))
//	{
//		document.pending_result.action="view_pending_ad_list.php?mode=rej_All&page="+page;
//		document.pending_result.submit();
//	}
//}
//
//function res_per_page()
//{
//		document.pending_result.submit();
//}
//function reply_per_page()
//{
//		document.view_all_reply_form.submit();
//}
//function reply_ad(adid,page)
//{
//		document.pending_result.action="reply_ad.php?mode=reply&ad_id="+adid+"&page="+page;
//		document.pending_result.submit();
//};
//
//function reply_adreply(replyid,page,adid)
//{
//		document.reply_more_details.action="reply_ad.php?mode=reply_adreply&reply_id="+replyid+"&page="+page+"&ad_id="+adid;
//		document.reply_more_details.submit();
//}
//function validate_reply(thisform)
//{
//	with (thisform)
//	{
//		if (thisform.title.value=="")
//		{
//			alert("Please enter Ad Title.");
//			thisform.title.focus();
//			return (false);
//		}
//		if (thisform.name.value=="")
//		{
//			alert("Please enter your name.");
//			thisform.name.focus();
//			return (false);
//		}
//		if (thisform.email.value=="")
//		{
//			alert("Enter your valid email address.");
//			thisform.email.focus();
//			return false;
//		}
//		if (validate_email(email,"Not a valid e-mail address!")==false)
//		{
//			email.focus();
//			return false;
//		}
//	   if (thisform.phone.value=="")
//	  {
//		alert("Enter your Contact number.");
//		thisform.phone.focus();
//		return false;
//	  }
//	  if (thisform.phone.value.length>12)
//	  {
//		alert("Max 12 characters allowed.");
//		thisform.phone.focus();
//		return false;
//	  }
//	  if (thisform.description.value=="")
//	  {
//		alert("Enter Your Ad Description.");
//		thisform.description.focus();
//		return false;
//	  }
//	  if (thisform.description.value.length < 50)
//	  {
//		alert("Your Ad Description must be at least 50 characters long.");
//		thisform.description.focus();
//		return false;
//	  }
//	  if (thisform.description.value.length >2000)
//	  {
//		alert("Your Ad Description must be at most 2000 characters long.");
//		thisform.description.focus();
//		return false;
//	  }
//	}
//}
//
//function view_all_reply(adid,page)
//{
//	document.pending_result.action="view_all_reply.php?mode=view&ad_id="+adid+"&page="+page;
//	document.pending_result.submit();
//}
//function delete_reply(page,n_rows)
//{
//	if(confirm("Do you really want to delete?"))
//	{
//		document.view_all_reply_form.action="view_all_reply.php?mode=delete&page="+page+"&n_rows="+n_rows;
//		document.view_all_reply_form.submit();
//		
//	}
//}
//function more_detail(replyid,page)
//{
//	document.view_all_reply_form.action="reply_detailinfo.php?page="+page+"&reply_id="+replyid;
//	document.view_all_reply_form.submit();
//}
//
//function back_button(replyid,page)
//{
//	document.reply_more_details.action="view_all_reply.php?mode=view&ad_id="+replyid+"&page="+page;
//	document.reply_more_details.submit();
//}
//
//function back_button_reply_adpage(replyid,page)
//{
//	document.reply_ad_form.action="reply_detailinfo.php?reply_id="+replyid+"&page="+page;
//	document.reply_ad_form.submit();
//}
