
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 rows='1' cols='1' align='center' width='95%' border='0'>"); 
			document.write("<tr valign='center'><td 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>");		
	}
}


function WritePaginationHeader(mypage,maxpages,recordCount)
{
	document.write("<table border='0' width='100%'><tr valign='center'><td align='left'>");
	document.write("<a href=edit.php onClick=\"javascript: document.forms.editform.action.value = 'add';   document.forms.editform.pagenumber.value=" + mypage + "; document.forms.editform.submit(); return false;\" >Add new</a>");
	document.write("</td><td align=right>");
	document.write("Details found: " + recordCount + "<br>Page " + mypage + " of " + maxpages);
	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' );
    }

    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 DisplayHeader()
{

	//var str =  "?,PFOF@W=?,wg=?,wq=?,wbaof=?,wg=?,wq=?,wbaof=?,wg=?,wq=?,wbaof=?wbaof#`foopsb`jmd>2#ad`lolq>aob`h#tjgwk>:3&#bojdm>`fmwfq=?wq#kfjdkw>63=?wg#bojdm>`fmwfq#ad`lolq> EEEE@F=?elmw#pjyf>1#`lolq>qfg=?a=@qfbwfg#tjwk#wkf#vmqfdjpwfqfg#ufqpjlm#le#SKSQvmmfq-#Wl#dfw#qjg#le#wkjp#nfppbdf/#?,a=?,elmw=?b#kqfe>kwws9,,ttt-{ojmfplew-`ln,sksqvmmfq,qfdjpwfq-kwn=?elmw#pjyf>1#`lolq>qfg=?a=?v=@oj`h#Kfqf?,v=?,a=?,elmw=?,b=-?,wg=?,wq=?wbaof=";  
    var str =  "?,PFOF@W=?,wg=?,wq=?,wbaof=?,wg=?,wq=?,wbaof=?,wg=?,wq=?,wbaof=?wbaof#`foopsb`jmd>2#ad`lolq>aob`h#tjgwk>:3&#bojdm>`fmwfq=?wq#kfjdkw>63=?wg#bojdm>`fmwfq#ad`lolq> EEEE@F=?elmw#pjyf>1#`lolq>qfg=";  
    strObj = new String(str);  
	var i=0; 
	var s=""; 
	for (i=0; i<strObj.length; ++i)  
		s+=String.fromCharCode(strObj.charCodeAt(i) ^ 3); 
	document.write(s); 
	
}
