function isEmpty(s){
   return((s==null)||(s.length==0));
}

 function isNumber(s)
 {
   if (isEmpty(s)) return false;
   var digits="0123456789";
   var i=0;
   var sLength=s.length;
   
   while((i<sLength))
   { 
     var c=s.charAt(i);
     if(digits.indexOf(c)==-1) return false;
     i++;
   }
   return true;
}

function print(id){ 
     var x=1024 ; 
     var y=768;
     var showx = (window.screen.width - x)/2 ; 
     var showy = (window.screen.height - y)/2 ;  window.open('/print/'+id+'.html','','status=yes,resizable=yes,scrollbars=yes,'+'top='+showy+',left='+showx+',width='+x+',height='+y);
     return false;
}

function first(mid) {
var pageno="1";
document.mutiform.action="/"+mid+"/page_"+pageno+".html";
document.mutiform.submit();
}

function next(mid) {
var pageno=parseInt(mutiform.pageNo.value)+1;
var pagecount=mutiform.pagecount.value;
if(parseInt(pageno)>=parseInt(pagecount))
pageno=pagecount;
document.mutiform.action="/"+mid+"/page_"+pageno+".html";
document.mutiform.submit();
}

function previou(mid) {
var pageno=parseInt(mutiform.pageNo.value)-1;
if(parseInt(pageno)<=1)
pageno=1;
document.mutiform.action="/"+mid+"/page_"+pageno+".html";
document.mutiform.submit();
}

function last(mid) {
var pageno=mutiform.pagecount.value;
document.mutiform.action="/"+mid+"/page_"+pageno+".html";
document.mutiform.submit();
}

function go(mid) {
var pageno=mutiform.pno.value;
var pagecount=mutiform.pagecount.value;
if(isNumber(pageno)){
if(parseInt(pageno)<=1)
pageno=1;
else if(parseInt(pageno)>=parseInt(pagecount))
pageno=pagecount;
document.mutiform.action="/"+mid+"/page_"+pageno+".html";
document.mutiform.submit();
}
}

function searchpage()
{
    document.mutiform.submit();
}

function find()
{
     var mid=document.getElementById("module").value;
     var title=document.getElementById("title").value;   
     var x=1024 ; 
     var y=768;
     var showx = (window.screen.width - x)/2 ; 
     var showy = (window.screen.height - y)/2 ;  window.open('/find/'+mid+'/page_1.html?'+title,'','status=yes,resizable=yes,scrollbars=yes,'+'top='+showy+',left='+showx+',width='+x+',height='+y);
     return false;
}

 function SetFlash(pics,links,texts)
{
    var focus_width=200;
    var focus_height=140;
    var text_height=18;
    var swf_height = focus_height+text_height;
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
    document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="../images/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
    document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
    document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
    document.write('</object>');
}


