var i;
var k;
var base_url;
var stringValue;
var strLength;
var ch;
var display_ch;
var baseurl = base_url;function trimSpaces(stringValue){if(stringValue!==''){for(i=0;i<stringValue.length;i++){if(stringValue.charAt(i)!==" "){break;}}
if(i>0){stringValue=stringValue.substring(i);}
strLength=stringValue.length-1;for(i=strLength;i>=0;i--){if(stringValue.charAt(i)!==" "){break;}}
if(i<strLength){stringValue=stringValue.substring(0,i+1);}
stringValue=stringValue.split(' ').join('');}
return stringValue;}
function echeck(str){var at="@";
var dot=".";
var lat=str.indexOf(at);
var lstr=str.length;
var ldot=str.indexOf(dot);
if(str.indexOf(at)==-1){alert("Invalid E-mail ID");
return false;}
if(str.indexOf(at)==-1||str.indexOf(at)===0||str.indexOf(at)==lstr){alert("Invalid E-mail ID");
return false;}
if(str.indexOf(dot)==-1||str.indexOf(dot)===0||str.indexOf(dot)==lstr){alert("Invalid E-mail ID");
return false;}
if(str.indexOf(at,(lat+1))!==-1){alert("Invalid E-mail ID");
return false;}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){alert("Invalid E-mail ID");
return false;}
if(str.indexOf(dot,(lat+2))==-1){alert("Invalid E-mail ID");
return false;}
if(str.indexOf(" ")!==-1){alert("Invalid E-mail ID");
return false;}
return true;}
(function($){$.fn.validation=function(){var error=0;$('.required',this).each(function(){var input=$(':input',this).attr("value");var display_name=$(':input',this).attr("id");input=jQuery.trim(input);
if(input==""){
	$(':input',this).addClass("error-highlight");display_name=((display_name.replace('_',' ')).replace('_',' ')).replace('_',' ');error++;display_ch='';var the_length=display_name.length;for(k=0;k<the_length;k++){ch=display_name.charAt(k);if(ch==ch.toUpperCase()){ch=' '+ch;}display_ch=display_ch+ch;}$(':input',this).val('');$(':input',this).focus();alert(display_ch+' is a required field');return false;
}else if(display_name.indexOf('Email')!==(-1)){
	if(!JcheckEmail(input)){
		$(':input',this).addClass("error-highlight");display_name=((display_name.replace('_','')).replace('_','')).replace('_','');display_ch='';var the_length=display_name.length;for(k=0;k<the_length;k++){ch=display_name.charAt(k);if(ch==ch.toUpperCase()){ch=' '+ch;}display_ch=display_ch+ch;}error++;$(':input',this).focus();alert('Please enter a valid'+display_ch);return false;
	}else{
		$('span.error-message', this).remove();
		$(':input',this).removeClass("error-highlight");
	}
}else{
	$('span.error-message',this).remove();$(':input',this).removeClass("error-highlight");}
});
if(error==0){return true;}else{return false;}};})(jQuery);
function dismisserror(){$(document).ready(function(){$("#aerrordiv").slideToggle("slow");});}setTimeout(function(){$('#aerrordiv').fadeOut('slow');},50000);
function loadSearchBox(){$(document).ready(function(){$('#searchdiv').slideToggle("slow");return false;});}

function follow(){
	document.getElementById('followsfrm').submit();
}

function unfollow(){
	document.getElementById('unfollowsfrm').submit();
}

function loadSearchBox(){
	$(document).ready(function(){
		$('#searchdiv').slideToggle("slow");
		return false;
	});
}

function rating(rating){document.getElementById('rating').value=rating;value=rating*16;document.getElementById('rat1').style.width=value+'px';}
