function checkRadio()
{
	document.frmLocation.locationType[1].checked=true;
}
function focusTextLocation()
{
	if(document.frmLocation.locationType[1].checked==true)
		document.frmLocation.cityLocation.select();
}
function generateTipData(tipid)
{
	var val='<div class="DvMnToolTip"><div class="tooltip"><div class="DvCurImgTop">&nbsp;</div><div class="DvCurImgmid"><div class="tooltipmntxt">Just Reviewed:<br />';

	val+='<a href='+HTTP_LOCATION+'biz/'+tipArray[tipid][6]+'/'+tipArray[tipid][7]+'/'+tipArray[tipid][9]+'/'+tipArray[tipid][8]+'/'+tipArray[tipid][0]+'" title="'+tipArray[tipid][1]+'">'+tipArray[tipid][1]+'</a><br /><span >'+tipArray[tipid][2]+','+tipArray[tipid][4]+'</span><br />';

	val+='<div class="DvThumbs">';
	if(parseFloat(tipArray[tipid][5])>=1 && parseFloat(tipArray[tipid][5])<=1.2)
	{
		val+='<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />';
	}

	if(parseFloat(tipArray[tipid][5])>1.2 && parseFloat(tipArray[tipid][5])<=1.6)
	{
		val+='<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/Icon_ThumbBluGry_15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />';
	}

	if(parseFloat(tipArray[tipid][5])>1.6 && parseFloat(tipArray[tipid][5])<=2.2)
	{
		val+='<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />';
	}

	if(parseFloat(tipArray[tipid][5])>2.2 && parseFloat(tipArray[tipid][5])<=2.6)
	{
		val+='<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/Icon_ThumbBluGry_15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />';
	}
	if(parseFloat(tipArray[tipid][5])>2.6 && parseFloat(tipArray[tipid][5])<=3.2)
	{
		val+='<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />';
	}


	if(parseFloat(tipArray[tipid][5])>3.2 && parseFloat(tipArray[tipid][5])<=3.6)
	{
		val+='<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/Icon_ThumbBluGry_15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />';
	}
	if(parseFloat(tipArray[tipid][5])>3.6 && parseFloat(tipArray[tipid][5])<=4.2)
	{
		val+='<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_grey15x15.gif" />';
	}

	if(parseFloat(tipArray[tipid][5])>4.2 && parseFloat(tipArray[tipid][5])<=4.6)
	{
		val+='<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/Icon_ThumbBluGry_15x15.gif" />';
	}
	if(parseFloat(tipArray[tipid][5])>4.6 && parseFloat(tipArray[tipid][5])<=5)
	{
		val+='<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />&nbsp;<img src="ImgNew/img_thumb_blu15x15.gif" />';
	}

	val+='</div></div></div><div class="DvCurImgBtm">&nbsp;</div></div></div>';
	return val;
}
function checkLocation()
{
	if(document.frmLocation.locationType[0].checked==true)
		return true;

	if(document.frmLocation.cityLocation.value.match(/^\s*$/))
	{
		alert("Please enter the location as City, State");
		document.frmLocation.cityLocation.focus();
		return false;
	}

	searchLocation=trimAll(document.frmLocation.cityLocation.value);
	if(searchLocation.length<5){
		alert("Search location should be more than 4 characters.\nEnter your location in one of the following formats.\nCity, State (San Diego, CA)");
		return false;
		document.frmLocation.cityLocation.focus();
	}
	locationArray=searchLocation.split(",");
	if(locationArray.length==1){ 
		// User has enteredeither city or zipcode only
		if(isNaN(locationArray[0])){
			// If city only
			if(locationArray[0].match(/[0-9]+/)){
				//alert("Please enter proper city name i.e. San Diego");
				alert("Enter your location in one of the following formats.\nCity, State (San Diego, CA)");
				document.frmLocation.cityLocation.focus();
				return false;
			} 

			alert("Enter your location in one of the following formats.\nCity, State (San Diego, CA)");
			document.frmLocation.cityLocation.focus();
			return false;

		}else if(locationArray[0].length>5){
			// If zip code only			
			alert("Entered zip code should be of five charaters");
			document.frmLocation.cityLocation.focus();
			return false;					
		}
	}else if(locationArray.length==2){
		// location is having more than one element
		locationArray[0]=trimAll(locationArray[0]);
		locationArray[1]=trimAll(locationArray[1]);
		if(locationArray[0].match(/[0-9]+/)){
				//alert("Please enter proper city name i.e. San Diego, CA");
				alert("Enter your location in one of the following formats.\nCity, State (San Diego, CA)");
				document.frmLocation.cityLocation.focus();
				return false;
		}else {			
			stateArray=locationArray[1].split(" ");
			if(stateArray.length>2){
				alert("Enter your location in one of the following formats.\nCity, State (San Diego, CA)");
				document.frmLocation.cityLocation.focus();
				return false;
			}
			stateArray[0]=trimAll(stateArray[0]);
			if(stateArray[0].match(/[0-9]+/)){
				//alert("Please enter proper State name.");
				alert("Enter your location in one of the following formats.\nCity, State (San Diego, CA)");
				document.frmLocation.cityLocation.focus();
				return false;
			} 
			if(stateArray[0].length<2){				
				alert("Enter your location in one of the following formats.\nCity, State (San Diego, CA)");
				document.frmLocation.cityLocation.focus();
				return false;
			}	
			if(stateArray.length==2){		
				stateArray[1]=trimAll(stateArray[1]);
				if(!stateArray[1].match(/^[0-9]{5}$/)){				
					//alert("Please enter proper Zipecode after state name, Entered zip code should be of five charaters");
					alert("Enter your location in one of the following formats.\nCity, State (San Diego, CA)");
					document.frmLocation.cityLocation.focus();
					return false;
				}
			}
		}
	}else{
		alert("Enter your location in one of the following formats.\nCity, State (San Diego, CA)");
		document.frmLocation.cityLocation.focus();
		return false;
	}
}
