var url =window.location.href; 
var slashPos = url.lastIndexOf('/');
var pageName = url.substring(slashPos+1);
var foo=0;
var kit=0;
function rollover(arg)
{ 
	document.getElementById(arg).src='images1/link_over/'+ arg + '.gif';
}
function rollout(arg)
{
	//alert(pageName);
	document.getElementById(arg).src='images1/link_on/'+ arg + '.gif';
	//alert(arg);
	if(pageName=='' || pageName=='index.php')
	document.getElementById('find').src='images1/link_over/find.gif';
	else if(pageName=='index2.php')
	document.getElementById('submit').src='images1/link_over/submit.gif';
	else if(pageName=='#')
	document.getElementById('myboondogglen').src='images1/link_over/myboondogglen.gif';
	else if(pageName=='#')
	document.getElementById('places').src='images1/link_over/places.gif';
	else if(pageName=='#')
	document.getElementById('about').src='images1/link_over/about.gif';
	else if(pageName=='#')
	document.getElementById('signup').src='images1/link_over/signup.gif';
	else if(pageName=='#')
	document.getElementById('performer').src='images1/link_over/performer.gif';
}

function hide(id1, id2)
{
	document.getElementById(id1).style.display='none';
	document.getElementById(id2).style.display='none';
}
function hide1(id)
{
	document.getElementById(id).style.display='none';
}



function mouseon(imgnm)
	{  
       //alert(document.images1[imgnm].src);
		document.images1[imgnm].src="images1/over/"+ imgnm + ".gif";
	}
	
function mouseOff(imgnm)
	{
		document.images1[imgnm].src="images1/out/"+ imgnm + ".gif";
	}
	
function header()
{
	//alert('menu');
 var p=document.location.href;
	var pn=p.lastIndexOf('/');
	var pe=p.indexOf('?');
	//alert(pe);
	if(pe!='-1')
	var pageName=p.substring(pn+1,pe);
	else
	var pageName=p.substring(pn+1);
	
	var str = "";
	
str+="<div id='upper_navigation'>";
str+="<ul>";
str+="<li><img src='images1/over/link_left_round.gif' alt=''  border='0'/></li>";
          if(pageName=='' || pageName=='index.php')
		  {
			   str += "<li style='cursor:pointer;' ><img src='images1/over/find.gif' border='0' /></li>";
		  }
		  else
		  {
			   str += "<li ><a href='index.php' onmouseover=mouseon('find'); onmouseout=mouseOff('find');><img name='find' src='images1/out/find.gif' border='0'/></a></li>";
		  }
		  if(pageName=='dash_board.php')
		  {
			  str += "<li style='cursor:pointer;'><img src='images1/over/myboondogglen.gif' border='0'/></li>"; 
		  }
		 else
		 {
		str += "<li ><a href='dash_board.php' onmouseover=mouseon('myboondogglen'); onmouseout=mouseOff('myboondogglen');><img name='myboondogglen' src='images1/out/myboondogglen.gif' border='0' /></a></li>"; 
		  }
		  if(pageName=='aboutus.php')
		  {
			  str += "<li style='cursor:pointer;'><img src='images1/over/about.gif' border='0'/></li>"; 
		  }
		 else
		 {
		str += "<li ><a href='#' onmouseover=mouseon('about'); onmouseout=mouseOff('about');><img name='about' src='images1/out/about.gif' border='0'/></a></li>"; 
		  }
		  
		  if(pageName=='places.php')
		  {
			  str += "<li style='cursor:pointer;'><img src='images1/over/places.gif' border='0'/></li>"; 
		  }
		 else
		 {
		str += "<li><a href='#' onmouseover=mouseon('places'); onmouseout=mouseOff('places');><img name='places' src='images1/out/places.gif' border='0'/></a></li>"; 
		  }
		  if(pageName=='signup.php')
		  {
			  str += "<li style='cursor:pointer;'><img src='images1/over/signup.gif' border='0'/></li>"; 
		  }
		 else
		 {
		str += "<li ><a href='signup.php' onmouseover=mouseon('signup'); onmouseout=mouseOff('signup');><img name='signup' src='images1/out/signup.gif' border='0'/></a></li>"; 
		  }
		 
str+=" <li><img src='images1/over/link_right_round.gif' alt='' /></li>";
str+="</ul>";
str+="</div>";
	
	//alert(str);
  document.write(str);
}	


/*--------------------Code for login blank check-------------------------*/

function login_check()
{
	var a=document.frm_header;
	var msg="";
	if(a.login_input.value=="")
	{
		msg+="Please enter the Username!";
	}
	else if(a.login_pass.value=="")
	{
		msg+="Please enter the Password!";
	}
	if(msg!="")
	{
		alert(msg);
	}
}

/*-------------------------function for validation check (add_performer)--------------------*/


function add_performer_check()
{
	var msg="";
	var a=document.add_perf;
	if(a.per_name.value=="")
	{
		msg="Please enter the Name!";
		alert(msg);
		a.per_name.focus();
		return false;
	}
	else if(a.tag_name.value=="")
	{
		msg="Please enter the Tag!";
		alert(msg);
		a.tag_name.focus();
		return false;
	}
	else if(a.website_name.value=="")
	{
		msg="Please enter the Website Name!";
		alert(msg);
		a.website_name.focus();
		return false;
	}
	else if(a.per_desc.value=="")
	{
		msg="Please enter the Description!";
		alert(msg);
		a.per_desc.focus();
		return false;
	}
	else if(a.per_photo.value=="")
	{
		msg="Please enter the Photo!";
		alert(msg);
		a.per_photo.focus();
		return false;
	}	
}

/*-----------------------function for validation check (add_venue.tpl)-----------------------*/

function add_venue_check()
{
	var a=document.frm_add_venue;
	var msg="";
	var count=0;
	for(var i=0; i<a.age_restriction.length; i++)
	{
		if(a.age_restriction[i].checked==true)
		{
			count++;
		}
	}
	if(a.venue_name.value=="")
	{
		msg="Please enter the Venue Name!";
		alert(msg);
		a.venue_name.focus();
		return false;
	}
	else if(a.tag_name_av.value=="")
	{
		msg="Please enter the Tag Name!";
		alert(msg);
		a.tag_name_av.focus();
		return false;
	}
	else if(a.website_name_av.value=="")
	{
		msg="Please enter the Website Name!";
		alert(msg);
		a.website_name_av.focus();
		return false;
	}
	else if(a.street_address_av.value=="")
	{
		msg="Please enter the Street Address!";
		alert(msg);
		a.street_address_av.focus();
		return false;
	}
	else if(a.address_line_1_av.value=="")
	{
		msg="Please enter the Address Line 1!";
		alert(msg);
		a.address_line_1_av.focus();
		return false;
	}
	else if(a.city_av.value=="")
	{
		msg="Please enter the City!";
		alert(msg);
		a.city_av.focus();
		return false;
	}
	else if(a.state_av.value=="")
	{
		msg="Please enter the State!";
		alert(msg);
		a.state_av.focus();
		return false;
	}
	else if(a.phone_no_av.value=="")
	{
		msg="Please enter the Phone No!";
		alert(msg);
		a.phone_no_av.focus();
		return false;
	}
	else if(a.phone_no_av.value=="")
	{
		msg="Please enter the Phone No!";
		alert(msg);
		a.phone_no_av.focus();
		return false;
	}
	else if(count>0)
	{
		msg="Please select the Age Restriction!";
		alert(msg);
		//a.age_restriction.focus();
		return false;
	}
	else if(a.operation_weekdays.value=="")
	{
		msg="Please enter the Hours of Operation on weekdays!";
		alert(msg);
		a.operation_weekdays.focus();
		return false;
	}
	else if(a.operation_weekends.value=="")
	{
		msg="Please enter the Hours of Operation on weekends!";
		alert(msg);
		a.operation_weekends.focus();
		return false;
	}
	else if(a.photo_av.value=="")
	{
		msg="Please enter the Photo!";
		alert(msg);
		a.photo_av.focus();
		return false;
	}
	else if(a.coupon_av.value=="")
	{
		msg="Please enter the Coupon!";
		alert(msg);
		a.coupon_av.focus();
		return false;
	}
	else if(a.desc_av.value=="")
	{
		msg="Please enter the Description!";
		alert(msg);
		a.desc_av.focus();
		return false;
	}
}

///for website check
function checkWebsite(URL)
{
	lPos=URL.length-1;
	fDPos=URL.indexOf(".",0);
	lDPos=URL.lastIndexOf(".",lPos);
	if(URL.substr(0,11)!="http://www.")
		return false;
	else if(lDPos-fDPos<=1)
		return false;
	else if(lPos-lDPos<2)
		return false;
	else
		return true;
}
///////////////////////////////////////////////////////
function diff_sche(id)
{
	var eventSchedule	=	document.getElementById(id);
	if(id==1)
	{
			document.getElementById('same_sche').style.display='';
			document.getElementById('diff_sche').style.display='none';
	}
	else if(id==2)
	{
		document.getElementById('same_sche').style.display='none';
		document.getElementById('diff_sche').style.display='';
	}
}


///////////////////////////////////   search bar   ////////////////////////////////////////////


function mouseover_per(id)
{
	var str=document.getElementById(id);
	str.src="images_new/performer_over.gif";
}
function mouseover_venue(id)
{
	var str=document.getElementById(id);
	str.src="images_new/venue_over.gif";
}
function mouseout_per(id)
{
	var str=document.getElementById(id);
	str.src="images_new/performer_on.gif";
}
function mouseout_venue(id)
{
	var str=document.getElementById(id);
	str.src="images_new/venue_on.gif";
}
function mouseover_event(id)
{
	var str=document.getElementById(id);
	str.src="images_new/event_over.gif";
}
function mouseout_event(id)
{
	var str=document.getElementById(id);
	str.src="images_new/event_on.gif";
}

function mouseover_list(id)
{
	var str=document.getElementById(id);
	str.src="images_new/list_view_over.gif";
}
function mouseout_list(id)
{
	var str=document.getElementById(id);
	str.src="images_new/list_view_on.gif";
}
function mouseover_map(id)
{
	var str=document.getElementById(id);
	str.src="images_new/map_view_over.gif";
}
function mouseout_map(id)
{
	var str=document.getElementById(id);
	str.src="images_new/map_view_on.gif";
}

////////////////////////////////////////  Add_event.php///////////////////////////////////////
function SAME_schedule_show(i)
{
//	alert(i);
	var monthly=document.getElementById('SMonthly');
	var weekly=document.getElementById('SWeekly');
	var daily=document.getElementById('SDaily');
	var dates=document.getElementById('SDates');

// alert(i);
	if (i=="SMonthly") 
		{
		
		monthly.style.display='';
		weekly.style.display='none';
		daily.style.display='none';
		dates.style.display='none';
		
		}
	if (i=="SWeekly")
		{
		monthly.style.display='none';
		weekly.style.display='';
		daily.style.display='none';
		dates.style.display='none';
		

		}
		if (i=="SDaily")
		{
		monthly.style.display='none';
		weekly.style.display='none';
		daily.style.display='';
		dates.style.display='none';
				}
		if (i=="SDates")
		{
		monthly.style.display='none';
		weekly.style.display='none';
		daily.style.display='none';
		dates.style.display='';
		}
	
}
//////////////////////////////////////////////////////////////////////////////
function diff_schedule_show(i)
{
//	alert(i);
	var monthly=document.getElementById('DMonthly');
	var weekly=document.getElementById('DWeekly');
	var daily=document.getElementById('DDaily');
	var dates=document.getElementById('DDates');

// alert(i);
	if (i=="DMonthly") 
		{
		
		monthly.style.display='';
		weekly.style.display='none';
		daily.style.display='none';
		dates.style.display='none';
		
		}
	if (i=="DWeekly")
		{
		monthly.style.display='none';
		weekly.style.display='';
		daily.style.display='none';
		dates.style.display='none';
		

		}
		if (i=="DDaily")
		{
		monthly.style.display='none';
		weekly.style.display='none';
		daily.style.display='';
		dates.style.display='none';
				}
		if (i=="DDates")
		{
		monthly.style.display='none';
		weekly.style.display='none';
		daily.style.display='none';
		dates.style.display='';
		}
	
}



function schedule_show1(i)
{
//	alert(i);
	var monthly1=document.getElementById('Monthly1');
	var weekly1=document.getElementById('Weekly1');
	var daily1=document.getElementById('Daily1');
	var dates1=document.getElementById('Dates1');

 //alert(i);
	if (i=="Monthly1")
		{
		
		monthly1.style.display='';
		weekly1.style.display='none';
		daily1.style.display='none';
		dates1.style.display='none';
		
		}
	if (i=="Weekly1")
		{
		monthly1.style.display='none';
		weekly1.style.display='';
		daily1.style.display='none';
		dates1.style.display='none';
		

		}
		if (i=="Daily1")
		{
		monthly1.style.display='none';
		weekly1.style.display='none';
		daily1.style.display='';
		dates1.style.display='none';
				}
		if (i=="Dates1")
		{
		monthly1.style.display='none';
		weekly1.style.display='none';
		daily1.style.display='none';
		dates1.style.display='';
		

		
		}
	
}




function schedule_show2(i)
{
//	alert(i);
	var monthly2=document.getElementById('Monthly2');
	var weekly2=document.getElementById('Weekly2');
	var daily2=document.getElementById('Daily2');
	var dates2=document.getElementById('Dates2');

 //alert(i);
	if (i=="Monthly2")
		{
		
		monthly2.style.display='';
		weekly2.style.display='none';
		daily2.style.display='none';
		dates2.style.display='none';
		
		}
	if (i=="Weekly2")
		{
		monthly2.style.display='none';
		weekly2.style.display='';
		daily2.style.display='none';
		dates2.style.display='none';
		

		}
		if (i=="Daily2")
		{
		monthly2.style.display='none';
		weekly2.style.display='none';
		daily2.style.display='';
		dates2.style.display='none';
				}
		if (i=="Dates2")
		{
		monthly2.style.display='none';
		weekly2.style.display='none';
		daily2.style.display='none';
		dates2.style.display='';
		

		
		}
	
}



function schedule_show3(i)
{
//	alert(i);
	var monthly3=document.getElementById('Monthly3');
	var weekly3=document.getElementById('Weekly3');
	var daily3=document.getElementById('Daily3');
	var dates3=document.getElementById('Dates3');

 //alert(i);
	if (i=="Monthly3")
		{
		
		monthly3.style.display='';
		weekly3.style.display='none';
		daily3.style.display='none';
		dates3.style.display='none';
		
		}
	if (i=="Weekly3")
		{
		monthly3.style.display='none';
		weekly3.style.display='';
		daily3.style.display='none';
		dates3.style.display='none';
		

		}
		if (i=="Daily3")
		{
		monthly3.style.display='none';
		weekly3.style.display='none';
		daily3.style.display='';
		dates3.style.display='none';
				}
		if (i=="Dates3")
		{
		monthly3.style.display='none';
		weekly3.style.display='none';
		daily3.style.display='none';
		dates3.style.display='';
		

		
		}
	
}


function schedule_show4(i)
{
//	alert(i);
	var monthly4=document.getElementById('Monthly4');
	var weekly4=document.getElementById('Weekly4');
	var daily4=document.getElementById('Daily4');
	var dates4=document.getElementById('Dates4');

 //alert(i);
	if (i=="Monthly4")
		{
		
		monthly4.style.display='';
		weekly4.style.display='none';
		daily4.style.display='none';
		dates4.style.display='none';
		
		}
	if (i=="Weekly4")
		{
		monthly4.style.display='none';
		weekly4.style.display='';
		daily4.style.display='none';
		dates4.style.display='none';
		

		}
		if (i=="Daily4")
		{
		monthly4.style.display='none';
		weekly4.style.display='none';
		daily4.style.display='';
		dates4.style.display='none';
				}
		if (i=="Dates4")
		{
		monthly4.style.display='none';
		weekly4.style.display='none';
		daily4.style.display='none';
		dates4.style.display='';
		

		
		}
	
}


function preformer_value2(val1,val2)
{
	var perf_val=document.getElementById(val2).value;
	var val=val1+'|'+perf_val;
	return val;
}

function performer_value3(val1,val2,val3)
{
	var perf_val=document.getElementById(val3).value;
	var val=val1+'|'+val2+'|'+perf_val;
	return val;
}

function event_value(val1,val2)
{
	var new_val=document.getElementById(val2).value;
	var val=val1+'|'+new_val;
	return val;
}

function form_value(val1,val2)
{
	var val=val1+'|'+val2;
	return val;
}

function form_value4(val1,val2,val3,val4)
{
	var val=val1+'|'+val2+'|'+val3+'|'+val4;
	return val;
}

function venue_value2(val1,val2)
{
	var venue_val=document.getElementById(val2).value;
	var val=val1+'|'+venue_val;
	return val;
}


function venue_value3(val1,val2,val3)
{
	var venue_val=document.getElementById(val3).value;
	var val=val1+'|'+val2+'|'+venue_val;
	return val;
}

function venue_value4(val1,val2,val3,val4)
{
	var venue_val3=document.getElementById(val3).value;
	var venue_val4=document.getElementById(val4).value;
	var val=val1+'|'+val2+'|'+venue_val3+'|'+venue_val4;
	return val;
}

function event_date_values(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11)
{
	var date_val1=document.getElementById(val1).value;
	var date_val2=document.getElementById(val2).value;
	var date_val3=document.getElementById(val3).value;
	var date_val4=document.getElementById(val4).value;
	var date_val5=document.getElementById(val5).value;
	var date_val6=document.getElementById(val6).value;
	var date_val7=document.getElementById(val7).value;
	
	var val=date_val1+'|'+date_val2+'|'+date_val3+'|'+date_val4+'|'+date_val5+'|'+date_val6+'|'+date_val7+'|'+val8+'|'+val9+'|'+val10+'|'+val11;
	return val;
}

function multi_id2(val1,val2)
{
	val3 = val1+ '|' + val2; 
	return val3;
}

function multi_id3(val1,val2,val3)
{
	val4 = val1+ '|' + val2+ '|' + val3;
	return val4;
}
function multi_id4(val1,val2,val3,val4)
{
	val = val1+ '|' + val2+ '|' + val3+ '|' + val4;
	return val;
}

function multi_id5(val1,val2,val3,val4,val5)
{
	val6 = val1+ '|' + val2+ '|' + val3+ '|' + val4+ '|' + val5;
	return val6;
}
function multi_id6(val1,val2,val3,val4,val5,val6)
{
	val7 = val1+ '|' + val2+ '|' + val3+ '|' + val4+ '|' + val5+ '|' + val6;
	return val7;
}
function multi_id10(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10)
{
	val10 = val1+ '|' + val2+ '|' + val3+ '|' + val4+ '|' + val5+ '|' + val6+ '|' + val7+ '|' + val8+ '|' + val9+ '|' + val10;
	return val10;
}


//////////////////////////////////////FUNCTION FOR ADD MORE/////////////////////////////////////////
function multiple_files(k)
{  

	var j=parseInt(k)+1;
 	var i;
	document.getElementById('addMore').innerHTML = '&nbsp;';

	for(i=j;i<=6;i++)
	{
	//alert(i);
	var add_files=document.getElementById(i);

	if(i==6)
		{
		var hiddn=document.getElementById('addMoreLink5');
		hiddn.innerHTML="&nbsp;";
		document.getElementById('addMoreLink5').innerHTML = "&nbsp;";
		//alert(document.getElementById('addMoreLink5').innerHTML);
		}
	else
	{
		if(add_files.style.display=='none')
		{
		add_files.style.display='';
		if(i>j)
		{
			document.getElementById('addMoreLink'+(i-1)).innerHTML = "&nbsp;";
			//alert(document.getElementById('addMoreLink'+(i-1)).innerHTML);
		}
		else if(i==j)	
		{
			document.getElementById('addMore').innerHTML = "&nbsp;";
			//alert(document.getElementById('addMore').innerHTML);
		}
		break;
		}
	}
	
	}	

}
/////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////FUNCTION FOR ADD MORE2/////////////////////////////////////////
function multiplefiles(k)
{  

	var j=parseInt(k)+1;
 	var i;
	
	document.getElementById('add_More').innerHTML = '&nbsp;';

	for(i=j;i<=11;i++)
	{
	
	var add_files=document.getElementById(i);
	document.getElementById('vali').value=i;
	if(i==11)
		{
		var hiddn=document.getElementById('add_MoreLink11');
		hiddn.innerHTML="&nbsp;";
		document.getElementById('add_MoreLink11').innerHTML = "&nbsp;";
		//alert(document.getElementById('add_MoreLink11').innerHTML);
		}
	else
	{
		if(add_files.style.display=='none')
		{
		add_files.style.display='';
		if(i>j)
		{
			document.getElementById('add_MoreLink'+(i-1)).innerHTML = "&nbsp;";
			//alert(document.getElementById('add_MoreLink'+(i-1)).innerHTML);
		}
		else if(i==j)	
		{
			document.getElementById('add_More').innerHTML = "&nbsp;";
			//alert(document.getElementById('add_More').innerHTML);
		}
		break;
		}
	}
	
	}	

}
/////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////FUNCTION FOR ADD MORE3/////////////////////////////////////////
function MultipleFiles(c,k)
{  

	var j=parseInt(k)+1;
 	var i;
	//alert(i+''+j);
	document.getElementById('Add_More'+c).innerHTML = '&nbsp;';

	for(i=j;i<=11;i++)
	{
	//alert(i+''+j);
	var add_files=document.getElementById('pfile'+c+''+i);
	document.getElementById('vali'+c).value=i;
	if(i==11)
		{
		var hiddn=document.getElementById('Add_MoreLink'+c+''+i);
		hiddn.innerHTML="&nbsp;";
		document.getElementById('Add_MoreLink'+c+''+i).innerHTML = "&nbsp;";
		//alert(document.getElementById('add_MoreLink11').innerHTML);
		}
	else 
	{
		if(add_files.style.display=='none')
		{
		add_files.style.display='';
		if(i>j)
		{ //alert('Add_MoreLink'+c+''+(i-1));
			document.getElementById('Add_MoreLink'+c+''+(i-1)).innerHTML = "&nbsp;";
			//alert(document.getElementById('add_MoreLink'+(i-1)).innerHTML);
		}
		else if(i==j)	
		{
			document.getElementById('Add_More'+c).innerHTML = "&nbsp;";
			//alert(document.getElementById('add_More').innerHTML);
		}
		break;
		}
	}
	
	}	

}
/////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////FUNCTION FOR ADD MORE4/////////////////////////////////////////
function MultipleFilesDiff(k,valsch)
{  

	var j=parseInt(k)+1;
 	var i;
	
	document.getElementById('Add_MoreDiff').innerHTML = '&nbsp;';

	for(i=j;i<=16;i++)
	{
	
	var add_files=document.getElementById('diffsche'+i);
	document.getElementById('dif_sch').value=valsch;
	if(i==16)
		{
		var hiddn=document.getElementById('Add_MoreLinkDiff16');
		hiddn.innerHTML="&nbsp;";
		document.getElementById('Add_MoreLinkDiff16').innerHTML = "&nbsp;";
		//alert(document.getElementById('add_MoreLink11').innerHTML);
		}
	else
	{
		if(add_files.style.display=='none')
		{
		add_files.style.display='';
		if(i>j)
		{
			document.getElementById('Add_MoreLinkDiff'+(i-1)).innerHTML = "&nbsp;";
			//alert(document.getElementById('add_MoreLink'+(i-1)).innerHTML);
		}
		else if(i==j)	
		{
			document.getElementById('Add_MoreDiff').innerHTML = "&nbsp;";
			//alert(document.getElementById('add_More').innerHTML);
		}
		break;
		}
	}
	
	}	

}
/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////CHECK EVENT DATES///////////////////////////////////////
function check_date(sid,eid,tdid)
{ 
var sdate=document.getElementById(sid).value.split('/'); 
var edate=document.getElementById(eid).value.split('/'); 
var val1=sdate[2]+sdate[0]+sdate[1];
var val2=edate[2]+edate[0]+edate[1];
	if(document.getElementById(eid).value!='' && document.getElementById(sid).value=='')
	{
		alert('Please enter start date!');
		return false;
	}
	/*else if(document.getElementById(sid).value!='' && document.getElementById(eid).value=='')
	{
		alert('Please enter end date!');
		return false;
	}*/
	else if(parseInt(val1)>parseInt(val2))
		{
			alert("Invalid end date!");
			document.getElementById(eid).value='';
			return false;
		}
	else
	{
		if(document.eve.eventSchedule[0].checked==true)
			showContent('adm_add_event.php',document.getElementById(sid).value+'|'+document.getElementById(eid).value,5,tdid,'');
		else if(document.eve.eventSchedule[1].checked==true)
		{ //alert()
			showContent('adm_add_event.php',document.getElementById(sid).value+'|'+document.getElementById(eid).value+'|'+document.getElementById('dif_sch').value,5,tdid,'');
		}
	}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
sid is start_date's id
eid is end_dates id 
iid is hidden field named vali's id 
tdid is td id in which ajax result go
*/
function check_time(sid,eid,iid,tdid)
{
	if(document.getElementById('allevenddate').checked==false)
	{
		var ajax_val=document.getElementById(sid).value+'|'+document.getElementById(eid).value+'|'+document.getElementById(iid).value;
	if(document.getElementById('same_start_hour6').value!='')
	{
		var date6=document.getElementById('same_start_hour6').value+':'+document.getElementById('same_start_min6').value+' '+document.getElementById('same_start_type6').value+'-'+document.getElementById('same_end_hour6').value+':'+document.getElementById('same_end_min6').value+' '+document.getElementById('same_end_type6').value;
		var ajax_val=ajax_val+'|'+date6;
		
	}
	if(document.getElementById('same_start_hour7').value!='')
	{
		var date7=document.getElementById('same_start_hour7').value+':'+document.getElementById('same_start_min7').value+' '+document.getElementById('same_start_type7').value+'-'+document.getElementById('same_end_hour7').value+':'+document.getElementById('same_end_min7').value+' '+document.getElementById('same_end_type7').value;
		var ajax_val=ajax_val+'|'+date7;
	}
	if(document.getElementById('same_start_hour8').value!='')
	{
		var date8=document.getElementById('same_start_hour8').value+':'+document.getElementById('same_start_min8').value+' '+document.getElementById('same_start_type8').value+'-'+document.getElementById('same_end_hour8').value+':'+document.getElementById('same_end_min8').value+' '+document.getElementById('same_end_type8').value;
		var ajax_val=ajax_val+'|'+date8;
	}
	if(document.getElementById('same_start_hour9').value!='')
	{
		var date9=document.getElementById('same_start_hour9').value+':'+document.getElementById('same_start_min9').value+' '+document.getElementById('same_start_type9').value+'-'+document.getElementById('same_end_hour9').value+':'+document.getElementById('same_end_min9').value+' '+document.getElementById('same_end_type9').value;
		var ajax_val=ajax_val+'|'+date9;
	}
	if(document.getElementById('same_start_hour10').value!='')
	{
		var date10=document.getElementById('same_start_hour10').value+':'+document.getElementById('same_start_min10').value+' '+document.getElementById('same_start_type10').value+'-'+document.getElementById('same_end_hour10').value+':'+document.getElementById('same_end_min10').value+' '+document.getElementById('same_end_type10').value;
		var ajax_val=ajax_val+'|'+date9;
	}
	

	//alert(ajax_val);
		showContent('adm_add_event.php',ajax_val,6,tdid,'');
	}
	else
	{
		showContent('adm_add_event.php','',7,tdid,'');	
	}
	
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function diff_check_time(sid,eid,iid,tdid,va)
{ 

	if(document.getElementById('allevenddate_diff'+va).checked==false)
	{
			document.getElementById('allevenddate_diff'+va).value = 2;
		var ajax_val=document.getElementById(sid).value+'|'+document.getElementById(eid).value+'|'+document.getElementById(iid).value;
		
	var ajax_val=ajax_val+'|'+va;
	if(document.getElementById('diff_start_hour'+va+'6').value!='')
	{
		var date6=document.getElementById('diff_start_hour'+va+'6').value+':'+document.getElementById('diff_start_min'+va+'6').value+' '+document.getElementById('diff_start_type'+va+'6').value+'-'+document.getElementById('diff_end_hour'+va+'6').value+':'+document.getElementById('diff_end_min'+va+'6').value+' '+document.getElementById('diff_end_type'+va+'6').value;
		var ajax_val=ajax_val+'|'+date6;
	}
	if(document.getElementById('diff_start_hour'+va+'7').value!='')
	{
		var date7=document.getElementById('diff_start_hour'+va+'7').value+':'+document.getElementById('diff_start_min'+va+'7').value+' '+document.getElementById('diff_start_type'+va+'7').value+'-'+document.getElementById('diff_end_hour'+va+'7').value+':'+document.getElementById('diff_end_min'+va+'7').value+' '+document.getElementById('diff_end_type'+va+'7').value;
		var ajax_val=ajax_val+'|'+date7;
	}
	if(document.getElementById('diff_start_hour'+va+'8').value!='')
	{
		var date8=document.getElementById('diff_start_hour'+va+'8').value+':'+document.getElementById('diff_start_min'+va+'8').value+' '+document.getElementById('diff_start_type'+va+'8').value+'-'+document.getElementById('diff_end_hour'+va+'8').value+':'+document.getElementById('diff_end_min'+va+'8').value+' '+document.getElementById('diff_end_type'+va+'8').value;
		var ajax_val=ajax_val+'|'+date8;
	}
	if(document.getElementById('diff_start_hour'+va+'9').value!='')
	{
		var date9=document.getElementById('diff_start_hour'+va+'9').value+':'+document.getElementById('diff_start_min'+va+'9').value+' '+document.getElementById('diff_start_type'+va+'9').value+'-'+document.getElementById('diff_end_hour'+va+'9').value+':'+document.getElementById('diff_end_min'+va+'9').value+' '+document.getElementById('diff_end_type'+va+'9').value;
		var ajax_val=ajax_val+'|'+date9;
	}
	if(document.getElementById('diff_start_hour'+va+'10').value!='')
	{
		var date10=document.getElementById('diff_start_hour'+va+'10').value+':'+document.getElementById('diff_start_min'+va+'10').value+' '+document.getElementById('diff_start_type'+va+'10').value+'-'+document.getElementById('diff_end_hour'+va+'10').value+':'+document.getElementById('diff_end_min'+va+'10').value+' '+document.getElementById('diff_end_type'+va+'10').value;
		var ajax_val=ajax_val+'|'+date9;
	}
	
	
	showContent('adm_add_event.php',ajax_val,8,tdid,'');
	}
	else
	{
	showContent('adm_add_event.php','',9,tdid,'');	
	}
	
}
/////////////////////////////////////////////////////////////////////////////////////////////////
function valid_event_1()
{
	if((document.getElementById('display_tag').innerHTML=='' || document.getElementById('display_tag').innerHTML=='&nbsp;') && document.eve.tag_name.value=='')
	{
		alert("Please add tag!");
		document.getElementById('tag_name').select();
		return false;
	}
	else if(document.getElementById('tag_name').value!='' && document.getElementById('hidd_tag').value==0)
	{
		alert("Please click add button to add the tag!");
		document.getElementById('tag_name').select();
		return false;
		
	}
	
}
function valid_event()
{
	var when = document.getElementById('when').value; 
	var eventSchedule = document.getElementById('schedule').value
	if(document.getElementById('city_zip').value!='' && document.getElementById('city_zip').value==0)
	{
		alert("Please Enter Correct City, State or Zip !");
		document.getElementById('s_state').value='';
		document.getElementById('s_state').focus();
		return false;
	}
	if(when=="one_time")
	{
		var num_dates = document.getElementById('occ_0_num_dates').value;
		for(var i=1;i<=num_dates;i++)
		{
			if(document.getElementById('date_start_1_'+i).value=='')
			{
				alert("Please Select Start Date for Date "+i+".");
				document.getElementById('date_start_1_'+i).focus();
				return false;
			}
		}
	}
	else if(when=="daily")
	{
		
		if(document.getElementById('date_start_2').value=='')
		{
			alert("Please Select Start Date.");
			document.getElementById('date_start_2').focus();
			return false;
		}
		else if(document.getElementById('occ_1_ending_checkbox').type=="checkbox" && document.getElementById('occ_1_ending_checkbox').checked==true && document.getElementById('date_end_2').value=='')
		{
			alert("Please Select End Date.");
			document.getElementById('date_end_2').focus();
			return false;

		}
		else if(document.getElementById('occ_1_ending_checkbox').type=="checkbox" && document.getElementById('occ_1_ending_checkbox').checked==true && document.getElementById('date_end_2').value!='' && document.getElementById('date_start_2').value > document.getElementById('date_end_2').value)
		{
			alert("End Date Should be greater than or equal to Start Date.");
			document.getElementById('date_end_2').focus();
			return false;

		}
	}
	else if(when=="weekly")
	{
		//alert(document.getElementById('occ_2[start_date]'));
		if(document.getElementById('occ_2[start_date]').value=='')
		{
			alert("Please Select Start Date.");
			document.getElementById('occ_2[start_date]').focus();
			return false;
		}
		else if(document.getElementById('occ_2_ending_checkbox').type=="checkbox" && document.getElementById('occ_2_ending_checkbox').checked==true && document.getElementById('occ_2[end_date]').value=='')
		{
			alert("Please Select End Date.");
			document.getElementById('occ_2[end_date]').focus();
			return false;

		}
		else if(document.getElementById('occ_2_ending_checkbox').type=="checkbox" && document.getElementById('occ_2_ending_checkbox').checked==true && document.getElementById('occ_2[end_date]').value!='' && document.getElementById('occ_2[start_date]').value > document.getElementById('occ_2[end_date]').value)
		{
			alert("End Date Should be greater than or equal to Start Date.");
			document.getElementById('occ_2[end_date]').focus();
			return false;

		}
	}
	else if(when=="monthly")
	{
		if(document.getElementById('occ_3[start_date]').value=='')
		{
			alert("Please Select Start Date.");
			document.getElementById('occ_3[start_date]').focus();
			return false;
		}
		else if(document.getElementById('occ_3_ending_checkbox').type=="checkbox" && document.getElementById('occ_3_ending_checkbox').checked==true && document.getElementById('occ_3[end_date]').value=='')
		{
			alert("Please Select End Date.");
			document.getElementById('occ_3[end_date]').focus();
			return false;

		}
		else if(document.getElementById('occ_3_ending_checkbox').type=="checkbox" && document.getElementById('occ_3_ending_checkbox').checked==true && document.getElementById('occ_3[end_date]').value!='' && document.getElementById('occ_3[start_date]').value > document.getElementById('occ_3[end_date]').value)
		{
			alert("End Date Should be greater than or equal to Start Date.");
			document.getElementById('occ_3[end_date]').focus();
			return false;

		}
	}
	//for same schedule
	if(eventSchedule==1)
	{
		var same_sch = document.getElementById('same_schedule').value;
		for(var i=1;i<=same_sch;i++)
		{
			if(document.getElementById('s_state'+i).value=='')
			{
				alert("Please Enter City & State or Zip.");
				document.getElementById('s_state'+i).focus();
				return false;
			}
			else if(document.getElementById('s_state'+i).value!='' && document.getElementById('city_zip'+i).value==0)
			{
				alert("Please Enter Correct City, State or Zip !");
				document.getElementById('s_state'+i).value='';
				document.getElementById('s_state'+i).focus();
				return false;
			}
		}
		
	}
	else if(eventSchedule==2)
	{
		var diff_sch = document.getElementById('different_schedule').value;
		for(var i=1;i<=diff_sch;i++)
		{
			var k = 5+i;
			//alert(k)
			if(document.getElementById('s_state'+k).value=='')
			{
				alert("Please Enter City & State or Zip.");
				document.getElementById('s_state'+k).focus();
				return false;
			}
			else if(document.getElementById('s_state'+k).value!='' && document.getElementById('city_zip'+k).value==0)
			{
				alert("Please Enter Correct City, State or Zip !");
				document.getElementById('s_state'+k).value='';
				document.getElementById('s_state'+k).focus();
				return false;
			}
			if(when=="one_time")
			{
				var num_dates = document.getElementById('occ_0_num_dates'+i).value;
				for(var j=1;j<=num_dates;j++)
				{
					if(document.getElementById('date_start_1_'+i+j).value=='')
					{
						alert("Please Select Start Date for Date Tab "+i+".");
						document.getElementById('date_start_1_'+i+j).focus();
						return false;
					}
				}
			}
			else if(when=="daily")
			{
				
				if(document.getElementById('date_start_2'+i).value=='')
				{
					alert("Please Select Start Date.");
					document.getElementById('date_start_2'+i).focus();
					return false;
				}
				else if(document.getElementById('occ_1_ending_checkbox'+i).type=="checkbox" && document.getElementById('occ_1_ending_checkbox'+i).checked==true && document.getElementById('date_end_2'+i).value=='')
				{
					alert("Please Select End Date.");
					document.getElementById('date_end_2'+i).focus();
					return false;
		
				}
				else if(document.getElementById('occ_1_ending_checkbox'+i).type=="checkbox" && document.getElementById('occ_1_ending_checkbox'+i).checked==true && document.getElementById('date_end_2'+i).value!='' && document.getElementById('date_start_2'+i).value > document.getElementById('date_end_2'+i).value)
				{
					alert("End Date Should be greater than or equal to Start Date.");
					document.getElementById('date_end_2'+i).focus();
					return false;
		
				}
			}
			else if(when=="weekly")
			{
				//alert(document.getElementById('occ_2[start_date]'));
				if(document.getElementById('occ_2'+i+'[start_date]').value=='')
				{
					alert("Please Select Start Date.");
					document.getElementById('occ_2'+i+'[start_date]').focus();
					return false;
				}
				else if(document.getElementById('occ_2_ending_checkbox'+i).type=="checkbox" && document.getElementById('occ_2_ending_checkbox'+i).checked==true && document.getElementById('occ_2'+i+'[end_date]').value=='')
				{
					alert("Please Select End Date.");
					document.getElementById('occ_2'+i+'[end_date]').focus();
					return false;
		
				}
				else if(document.getElementById('occ_2_ending_checkbox'+i).type=="checkbox" && document.getElementById('occ_2_ending_checkbox'+i).checked==true && document.getElementById('occ_2'+i+'[end_date]').value!='' && document.getElementById('occ_2'+i+'[start_date]').value > document.getElementById('occ_2'+i+'[end_date]').value)
				{
					alert("End Date Should be greater than or equal to Start Date.");
					document.getElementById('occ_2'+i+'[end_date]').focus();
					return false;
		
				}
			}
			else if(when=="monthly")
			{
				if(document.getElementById('occ_3'+i+'[start_date]').value=='')
				{
					alert("Please Select Start Date.");
					document.getElementById('occ_3'+i+'[start_date]').focus();
					return false;
				}
				else if(document.getElementById('occ_3_ending_checkbox_'+i).type=="checkbox" && document.getElementById('occ_3_ending_checkbox_'+i).checked==true && document.getElementById('occ_3'+i+'[end_date]').value=='')
				{
					alert("Please Select End Date.");
					document.getElementById('occ_3'+i+'[end_date]').focus();
					return false;
		
				}
				else if(document.getElementById('occ_3_ending_checkbox_'+i).type=="checkbox" && document.getElementById('occ_3_ending_checkbox_'+i).checked==true && document.getElementById('occ_3'+i+'[end_date]').value!='' && document.getElementById('occ_3'+i+'[start_date]').value > document.getElementById('occ_3'+i+'[end_date]').value)
				{
					alert("End Date Should be greater than or equal to Start Date.");
					document.getElementById('occ_3'+i+'[end_date]').focus();
					return false;
		
				}
			}	
		}
	}
}

///////////////////////////////////////////////////////
function Numcheck(evt)
	{  
	var carCode = (evt.which) ? evt.which : event.keyCode
if (carCode > 31 && (carCode < 47) || (carCode > 57)  && carCode!=8 && carCode!=13 && carCode!=46  && carCode!=9 && carCode!=17 && carCode!=65 && carCode!=97 && carCode!=67 && carCode!=99 && carCode!=118 && carCode!=86 && carCode!=88 && carCode!=120 )
{
	alert("Enter only numbers!");
    return false;
    }
}
//for checking that time should not be greater than 12hr and 59min
function timelimit(id,type)
{
	if(type=='h' && document.getElementById(id).value!='' && (document.getElementById(id).value > 12 || document.getElementById(id).value < 1))
	{
		alert("Please Enter Valid Hour");	
		document.getElementById(id).value='';
		//document.eve.id.focus();
		document.getElementById(id).focus();
		return false;
	}
	else if(type=='m' && document.getElementById(id).value!=''&& (document.getElementById(id).value > 59 || document.getElementById(id).value < 0))
	{
		alert("Please Enter Valid Minute");	
		document.getElementById(id).value='';
		document.getElementById(id).focus();
		return false;
	}
}
//////////////////////////////////////////

function valid_venue()
{

var a=document.frm_addvenue;
if(document.getElementById("city").value==0)
{
	alert('Invalid City, State or Zip!');
	document.getElementById("newcity").focus();
	return false;
}
if((document.frm_addvenue.phone_no_av1.value!='' || document.frm_addvenue.phone_no_av2.value!='' || document.frm_addvenue.phone_no_av3.value!='') && (document.frm_addvenue.phone_no_av1.value.length<3 || document.frm_addvenue.phone_no_av2.value.length<3 || document.frm_addvenue.phone_no_av3.value.length<4))
	{
		alert("Invalid Phone No.!");
		
		if(document.frm_addvenue.phone_no_av1.value.length<3)
		document.frm_addvenue.phone_no_av1.focus();
		else if(document.frm_addvenue.phone_no_av2.value.length<3)
		document.frm_addvenue.phone_no_av2.focus();
		else if(document.frm_addvenue.phone_no_av3.value.length<3)
		document.frm_addvenue.phone_no_av3.focus();
		return false;
	}
}

function tag_check()
{
	var name_regex = /^[a-z,A-Z,0-9,.,_,\-,',#,`, ]+$/;
	var fname = document.getElementById('per_name').value;
	var ch='';
	var str='';
	if(name_regex.test(fname)==false)
	{
		var len = document.getElementById('per_name').value.length
		for(var i=0; i<len; i++)
		{
			ch=document.add_perf.per_name.value.charAt(i);
			if(name_regex.test(ch)==false)
			{
				if(str=='')
				{
					str=ch	
				}
				else
				{
					str+=", "+ch;
				}
				
			}
		}
		alert("Please remove "+str+" from your listing, this character is not allowed");			
		document.getElementById('per_name').select();
		return false;
	}
}

function valid_popvenue()
{
	var a=document.frm_addvenue;
	
	if(document.getElementById("city").value==0)
	{
		alert('Invalid City, State or Zip!');
		document.getElementById("newcity").focus();
		return false;
		
	}
	if((document.frm_addvenue.phone_no_av1.value!='' || document.frm_addvenue.phone_no_av2.value!='' || document.frm_addvenue.phone_no_av3.value!='') && (document.frm_addvenue.phone_no_av1.value.length<3 || document.frm_addvenue.phone_no_av2.value.length<3 || document.frm_addvenue.phone_no_av3.value.length<4))
	{
		alert("Invalid Phone No.!");
		if(document.frm_addvenue.phone_no_av1.value.length<3)
		document.frm_addvenue.phone_no_av1.focus();
		else if(document.frm_addvenue.phone_no_av2.value.length<3)
		document.frm_addvenue.phone_no_av2.focus();
		else if(document.frm_addvenue.phone_no_av3.value.length<3)
		document.frm_addvenue.phone_no_av3.focus();

		return false;
	}
}


function valid_search()
{
	if(document.demoForm.txt_search.value=='')
	{
		alert("Please Enter Search Text");
		document.demoForm.txt_search.focus();
		return false;
	}
}
function call_index()
{
	window.location='index.php';
}
//////////////////////////////////////////////////////
////////////////////////////////////////////////////////
function sendemail()
{
var to=document.getElementById('emailto').value;
alert(document.getElementById('emailto').value);
var mess=document.getElementById('message').value;
alert(to+'|'+mess);
}

function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
}

function img_empty(div_id)
{
	document.getElementById(div_id).innerHTML = document.getElementById(div_id).innerHTML;
	//return true;
}

function validate_img_ext(img_id,div_id)
{
	var doc_img=document.getElementById(img_id);
	if(doc_img.value!="")
	{
		var image_ext1=doc_img.value.substring(doc_img.value.lastIndexOf('.')+1,doc_img.value.length);	
		var image_ext1=image_ext1.toLowerCase();
		if(image_ext1!="" && image_ext1!="gif" && image_ext1!="jpg" && image_ext1!="png")
		{   
			
			alert("Please upload only .gif , .jpg and .png file!");
			img_empty(div_id);
			return false;		
		}
	}
}
 
 
// For image Mouserover and Mouseout effect


function img_mouseover(gid)
{
	var doc=document.getElementById(gid).style.border="3px solid #006699";
}
function img_mouseout(gid)
{
	var doc=document.getElementById(gid).style.border="3px solid #CCCCCC";
}


// For Mouserover and Mouseout effect on Voting Images
function vote_mouseover(id)
{
	var str=document.getElementById(id);
	if(id=="vote_up")
	{
		str.src="images_new/arrow_up_over.gif";
	}
	else if(id=="vote_down")
	{
		str.src="images_new/arrow_down_over.gif";
	}
}
function vote_mouseout(id)
{
	var str=document.getElementById(id);
	
	if(id=="vote_up")
	{
		str.src="images_new/arrow_up_on.gif";
	}
	else if(id=="vote_down")
	{
		str.src="images_new/arrow_down_on.gif";
	}
}

//SAVE TO MYBOONDOGGLEN FUNCTION
function save_event(eid,uid)
{
	showContent('saveevent.php',eid+'|'+uid,'1','save'+eid,'ajax_loading');
}

//FEEDBACK FORM VALIDATION
function validateformfeed()
{
	
	var regex = /^[a-z,A-Z,.,_,\-,',`, ]+$/;
	var uname_regex = /^[a-z,A-Z,0-9,.,_,\-,',`, ]+$/;
	var fname = document.getElementById('fname').value;
	var lname = document.getElementById('lname').value
	
	if(document.getElementById('fname').value == "")
	{
			alert("Please enter first name. ");
			document.getElementById('fname').focus();
			return false;			
	}
	else if(regex.test(fname)==false)
	{
		alert("Invalid first name!");
		document.getElementById('fname').focus();
		return false;
	}
	else if(document.getElementById('lname').value == "")
	{
			alert("Please enter last name. ");
			document.getElementById('lname').focus();
			return false;			
	}
	else if(regex.test(lname)==false)
	{
		alert("Invalid last name!");
		document.getElementById('lname').focus();
		return false;
	}
	else if(document.getElementById('emailoffriend').value == "")
	{
			alert("Please enter e-mail address. ");
			document.getElementById('emailoffriend').focus();
			return false;			
	}
	else if(!isValidEmail(document.getElementById('emailoffriend').value))
	{
        alert("Please enter valid e-mail id.");
		document.getElementById('emailoffriend').select();
		return false;
	}
	if(document.getElementById('what').value == "1")
	{
		if(document.getElementById('genfeed').value == "")
		{
			alert("Please enter message for general feedback. ");
			document.getElementById('genfeed').focus();
			return false;
		}
	}
	else if(document.getElementById('what').value == "2")
	{
		if(document.getElementById('ctype').value == "")
		{
			alert("Please select connection type. ");
			document.getElementById('ctype').focus();
			return false;
		}
		else if(document.getElementById('os').value == "")
		{
			alert("Please select operating system. ");
			document.getElementById('os').focus();
			return false;
		}
		else if(document.getElementById('browser').value == "")
		{
			alert("Please select browser. ");
			document.getElementById('browser').focus();
			return false;
		}
		else if(document.getElementById('bugfeed').value == "")
		{
			alert("Please enter problem description. ");
			document.getElementById('genfeed').focus();
			return false;
		}
	}
	else if(document.getElementById('what').value == "3")
	{
		if(document.getElementById('ideafeed').value == "")
		{
			alert("Please enter your idea. ");
			document.getElementById('ideafeed').focus();
			return false;
		}
		
	}
	else if(document.getElementById('what').value == "4")
	{
		if(document.getElementById('quesfeed').value == "")
		{
			alert("Please enter your question. ");
			document.getElementById('quesfeed').focus();
			return false;
		}
		
	}
	else if(document.getElementById('what').value == "5")
	{
		if(document.getElementById('ename').value == "")
		{
			alert("Please enter related event or venue name. ");
			document.getElementById('ename').focus();
			return false;
		}
		else if(document.getElementById('uname').value == "")
		{
			alert("Please enter user name. ");
			document.getElementById('uname').focus();
			return false;
		}
		else if(uname_regex.test(document.getElementById('uname').value)==false)
		{
			alert("Invalid user name!");
			document.getElementById('uname').focus();
			return false;
		}
		else if(document.getElementById('listfeed').value == "")
		{
			alert("Please describe the incorrect information. ");
			document.getElementById('listfeed').focus();
			return false;
		}
	}
	else if(document.getElementById('what').value == "6")
	{
		if(document.getElementById('mylisting').value == "")
		{
			alert("Please enter claimed list. ");
			document.getElementById('mylisting').focus();
			return false;
		}
		else if(document.getElementById('claimfeed').value == "")
		{
			alert("Please enter comments. ");
			document.getElementById('claimfeed').focus();
			return false;
		}
		
	}
	else if(document.getElementById('what').value == "7")
	{
		if(document.getElementById('otherfeed').value == "")
		{
			alert("Please enter your comments.");
			document.getElementById('otherfeed').focus();
			return false;
		}
		
	}
	if(document.getElementById('capval').value=='')
	{
		alert("Please enter captcha code.");
		document.getElementById('capval').focus();
		return false;
		
	}
	//	return true;
	
}

//FUNCTION FOR VALID EMAIL
function isValidEmail(emailStr)
{
			/* The following pattern is used to check if the entered e-mail address
			   fits the user@domain format.  It also is used to separate the username
			   from the domain. */
			var emailPat=/^(.+)@(.+)$/
			/* The following string represents the pattern for matching all special
			   characters.  We don't want to allow special characters in the address. 
			   These characters include ( ) < > @ , ; : \ " . [ ]    */
			//var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
			var specialChars="\\(\\)<>@,`';:~!#$%^&*+=|{}?\\\\\\\"\\.\\[\\]"
			
			/* The following string represents the range of characters allowed in a 
			   username or domainname.  It really states which chars aren't allowed. */
			var validChars="\[^\\s" + specialChars + "\]"
			/* The following pattern applies if the "user" is a quoted string (in
			   which case, there are no rules about which characters are allowed
			   and which aren't; anything goes).  E.g. "sg cricket"@disney.com
			   is a legal e-mail address. */
			var quotedUser="(\"[^\"]*\")"
			/* The following pattern applies for domains that are IP addresses,
			   rather than symbolic names.  E.g. sg@[123.124.233.4] is a legal
			   e-mail address. NOTE: The square brackets are required. */
			var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
			/* The following string represents an atom (basically a series of
			   non-special characters.) */
			var atom=validChars + '+'
			/* The following string represents one word in the typical username.
			   For example, in sg.sg@somewhere.com, sg and sg are words.
			   Basically, a word is either an atom or quoted string. */
			var word="(" + atom + "|" + quotedUser + ")"
			// The following pattern describes the structure of the user
			var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
			/* The following pattern describes the structure of a normal symbolic
			   domain, as opposed to ipDomainPat, shown above. */
			var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


			/* Finally, let's start trying to figure out if the supplied address is
			   valid. */

			/* Begin with the coarse pattern to simply break up user@domain into
			   different pieces that are easy to analyze. */
			var matchArray=emailStr.match(emailPat)
			if (matchArray==null) {
			  /* Too many/few @'s or something; basically, this address doesn't
			     even fit the general mould of a valid e-mail address. */
				//alert("Email address seems incorrect (check @ and .'s)")
				return false
			}
			var user=matchArray[1]
			var domain=matchArray[2]

			// See if "user" is valid 
			if (user.match(userPat)==null) {
			    // user is not valid
			    //alert("The username doesn't seem to be valid.")
			    return false
			}

			/* if the e-mail address is at an IP address (as opposed to a symbolic
			   host name) make sure the IP address is valid. */
			var IPArray=domain.match(ipDomainPat)
			if (IPArray!=null) {
			    // this is an IP address
				  for (var i=1;i<=4;i++) {
				    if (IPArray[i]>255) {
				        //alert("Destination IP address is invalid!")
					return false
				    }
			    }
			    return true
			}

			// Domain is symbolic name
			var domainArray=domain.match(domainPat)
			if (domainArray==null) {
			//alert("The domain name doesn't seem to be valid.")
			    return false
			}

			/* domain name seems valid, but now make sure that it ends in a
			   three-letter word (like com, edu, gov) or a two-letter word,
			   representing country (uk, nl, no), and that there's a hostname preceding 
			   the domain or country. */

			/* Now we need to break up the domain to get a count of how many atoms
			   it consists of. */
			var atomPat=new RegExp(atom,"g")
			var domArr=domain.match(atomPat)
			var len=domArr.length
			if (domArr[domArr.length-1].length<2 || 
			    domArr[domArr.length-1].length>3) {
			   // the address must end in a two letter or three letter word.
			   //alert("The address must end in a three-letter domain, or two letter country.")
			   return false
			}

			// Make sure there's a host name preceding the domain.
			if (len<2) {
			   var errStr="This address is missing a hostname!"
			   //alert(errStr)
			   return false
			}

			// If we've gotten this far, everything's valid!
			return true;
}

