var ratinDecrsp=new Array("&#2357;&#2366;&#2312;&#2335;"," &#2348;&#2352;&#2366;"," &#2331;&#2366;&#2344;","&#2313;&#2340;&#2381;&#2340;&#2350;","&#2309;&#2346;&#2381;&#2352;&#2340;&#2367;&#2350; !")

var win=null;
		function NewWindow(mypage,myname,w,h,scroll,pos){
		if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
		if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
		else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
		settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
		win=window.open(mypage,myname,settings);}

function countit(what){
var maxChar=1024-what.value.length
	if(maxChar<0)
	{
		what.value=what.value.substring(0,1024)
		maxChar=0
	}
document.getElementById('charCount').innerHTML="Remaining Characters : "+ maxChar
}

function deleteComment(id){
	document.commentform.commentId.value=id
	document.commentform.action="deleteComment.do"
	document.commentform.submit()
}
function replaceImage(no)
{
var tdName='star'
document.commentform.rating.value=no
for(i=1;i<=no;i++)
	{
	tdName='star'+i
	document.getElementById(tdName).innerHTML=' <img border="0" style="cursor:pointer" src="images/yellow_star.gif"    onclick="replaceImageAgain('+i+',true)"></td>'

	document.getElementById('rateingInfo').innerHTML="    [ "+ratinDecrsp[i-1]+" ]"
	}

}

function replaceImageAgain(no)
{
var tdName='star'
document.commentform.rating.value=no

for(i=5;i>no;i--)
	{
	tdName='star'+i
	document.getElementById(tdName).innerHTML=' <img border="0" style="cursor:pointer" src="images/grey_star.gif"  onclick="replaceImage('+i+',true)"></td>'
	document.getElementById('rateingInfo').innerHTML="    [ "+ratinDecrsp[i-2]+" ]"
	}

}

function countit(what){
var maxChar=1024-what.value.length
	if(maxChar<0)
	{
		what.value=what.value.substring(0,1024)
		maxChar=0
	}
document.getElementById('charCount').innerHTML="Remaining Characters : "+ maxChar
}


function open_win(url)
{
window.open(url,"_blank","toolbar=no,left=280px,width=440,top=300px,height=300px, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes")
}
function showKeyBord()
{
document.getElementById('iframetr').style.display="block"
document.getElementById('iframeKBD').src='keyboard.html'
document.getElementById('kbdDescription').innerHTML='<INPUT TYPE="text" NAME="X1" id="X2" size="20" style="visibility=hidden"><br>&#2333;&#2366;&#2354;&#2306; &#2325;&#2366;&#2350;! <a href="javascript:;" onclick="hideKeyBord()">&#2325;&#2367;&#2348;&#2379;&#2352;&#2381;&#2337; &#2348;&#2306;&#2342; &#2325;&#2352;&#2366;..</a>'
}
function hideKeyBord()
{
document.getElementById('iframetr').style.display="none"
document.getElementById('kbdDescription').innerHTML='<INPUT TYPE="text" NAME="X1" id="X2" size="20" style="visibility=hidden"><br>[ &#2319;&#2326;&#2366;&#2342;&#2366; &#2358;&#2348;&#2381;&#2342; &#2309;&#2337;&#2340;&#2379;&#2351;? <a href="javascript:;" onclick="showKeyBord()">&#2325;&#2367;&#2348;&#2379;&#2352;&#2381;&#2337; &#2346;&#2361;&#2366;</a> ]'
}
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

function verifyForm()
{
	var comment=document.commentform.comment
	var user=document.commentform.userName
	var email=document.commentform.userEmail
	if(document.commentform.userId.value=='')
	{
		if (trim(user.value)=="")
		{
			alert("Please enter your Name.")
			user.focus()
			return false
		}
		if (trim(email.value)!="")
		{
			if (!echeck(email.value)){
			email.value=""
			email.focus()
			return false
			}
		}
	document.commentform.first_name.value=user.value
	document.commentform.email_id.value=email.value
	}
	if(trim(comment.value)=="")
	{
		alert("Please enter your comment.")
		comment.focus();
		return false
	}
	if(comment.value.indexOf('<') != -1 || comment.value.indexOf('>') != -1)
	{
		alert("Please do not include any HTML content in your comment.")
		comment.focus();
		return false
	}
	if(document.commentform.rating.value=="0")
	{
	var x=confirm("You have not rated this page ! Do you really wish to submit without rating it?")
	if(!x){
		document.getElementById('arrow').innerHTML='<img src="images/arrow.gif" height="25" width="35">'
		return false
	}
	}
	document.commentform.submit()
	}

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

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					
	}
