
function GetGotoPageUrlString (nPageNumber,sUrlText)
{
	return "<a href='JavaScript:GotoPage(" + nPageNumber + ");' style='TEXT-DECORATION: none;'>" + sUrlText 
	+ "</a>";
}

function WritePagination(mypage,maxpages)
{
	if (maxpages > 1 && mypage <= maxpages)
	{
			document.write("<table   align='center' width='95%' border='0'>"); 
			document.write("<tr valign='center'><td class='di' align='center'>"); 
			var counterstart = mypage - 9; 
			if (mypage%10) counterstart = mypage - (mypage%10) + 1; 
 
			var counterend = counterstart + 9; 
			if (counterend > maxpages) counterend = maxpages; 
 
			if (counterstart != 1) document.write(GetGotoPageUrlString(1,"First")+"&nbsp;:&nbsp;"+GetGotoPageUrlString(counterstart - 1,"Previous")+"&nbsp;"); 
 
			document.write("<b>[</b>"); 
		
		var pad="";
		var counter	= counterstart;
		for(;counter<=counterend;counter++)
		{
			if (counter != mypage) document.write("&nbsp;" + GetGotoPageUrlString(counter,pad + counter));
			else document.write("&nbsp;<b>" + pad + counter + "</b>");
		}
		document.write("&nbsp;<b>]</b>");
		if (counterend != maxpages) document.write("&nbsp;" + GetGotoPageUrlString (counterend + 1,"Next") + "&nbsp;:&nbsp;" + GetGotoPageUrlString(maxpages,"Last"))
			
		document.write("</td></tr></table>");		
	}
}
    var rowWithMouse = null;

    function gGetElementById(s) {
      var o = (document.getElementById ? document.getElementById(s) : document.all[s]);
      return o == null ? false : o;
    }

    function rowUpdateBg(row, myId) 
    {
        row.className = (row == rowWithMouse) ? 'rowselected' : ( (myId&1) ? '' : 'shade' );
        row.className = (row == rowWithMouse) ? 'rowselected' : ( (myId&0) ? '' : 'shade' );
	}
    function rowRollover(myId, isInRow) {
      // myId is our own integer id, not the DOM id
      // isInRow is 1 for onmouseover, 0 for onmouseout
      var row = document.getElementById('tr_' + myId);
      rowWithMouse = (isInRow) ? row : null;
      rowUpdateBg(row, myId);
    }

function submitSubscription(frmAdmin)
{
	var check1,check2,flag;
flag=true;
var searchfor= 	frmAdmin.SearchFor.value;
var iChar=" ";
for (var i = 0; i < searchfor.length; i++) 
{
     if (iChar.indexOf(searchfor.charAt(i)) != -1)
   	{
		searchfor = searchfor.replace(" ","");
		i=0;
	}
}
searchfor = searchfor.replace(" ","");

var invalidChar = "~!@^*|,\:<>/[]{}`\';()&$#%0123456789";
for (var i = 0; i < searchfor.length; i++) 
{
     if (invalidChar.indexOf(searchfor.charAt(i)) != -1)
   	{
		window.location="http://www.indiatourplanner.com"
		flag=false;
		frmAdmin.SearchFor.focus();
     }
  }
if(searchfor=="")
{
		window.location="http://www.indiatourplanner.com"
		frmAdmin.SearchFor.focus();
		return;
}
if(flag==true)
{
frmAdmin.submit();
frmAdmin.reset();
}
}
var speed=200
var hex=new Array("00","14","28","3C","50","64","78","8C","A0","B4","C8","DC","F0")
var r=1
var g=1
var b=1
var seq=1;
var rainbow;
function changetext(){
rainbow="#"+hex[r]+hex[g]+hex[b]
}
function change(){
if (seq==6){
b--
if (b==0)
seq=1
}
if (seq==5){
r++
if (r==12)
seq=6
}
if (seq==4){
g--
if (g==0)
seq=5
}
if (seq==3){
b++
if (b==12)
seq=4
}
if (seq==2){
r--
if (r==0)
seq=3
}
if (seq==1){
g++
if (g==12)
seq=2
}
changetext()
}
function starteffect()
{
if (document.all||document.getElementById)
flash=setInterval("change()",speed)
frmAdmin.SearchButton.style.color=rainbow
}
function stopeffect()
{
frmAdmin.SearchButton.style.color="#FFFFFF";
}



