// disable the script in case of offline browsing

 if (window.location.host.indexOf('plasmaphysics.org.uk')!=-1)  {




 // *****page logging script****



//set cookie and call function callphp()

function setCookie(page) {
today = new Date();
expiry = new Date(today.getTime() + 30*60*1000);   // cookie expires after 30 min (no re-logging within this time)
document.cookie='pages='+page+'; expires='+expiry.toGMTString()+'; path=/'; 
cook='yes';
callphp(); 
}



//send variables to PHP script

function callphp() {
statstring = 'url='+url+'&ref='+ref+'&agent='+agent+'&screenwidth='+screenwidth+'&cookie='+cook;
document.write('<img border="0" height="1" width="1" src="/scripts/stats.php?'+statstring+'">');
}



//get cookies and check if page has been reloaded; if not call function setCookie() and add page-url to list

 if (navigator.cookieEnabled) {
    if (document.cookie) {
      if ( document.cookie.indexOf('pages=') !=-1 ) {
         cookiestring=document.cookie.split('pages=');
         match=cookiestring[1].indexOf(page);
         if (match==-1) { page=cookiestring[1]+', '+page;   setCookie(page); }
      } 
      else { setCookie(page); }
    }
    else { setCookie(page); } 
 }
 else { callphp(); }





 // *****print footer bar****


if (footer==1) {

document.write('</DIV>');
     
document.write('<TABLE width="100%"cellpadding="10" cellspacing="0" border="0"> <TR><FORM name="form1" method=GET action="&#72;&#116;&#116;&#80;&#58;&#47;&#47;&#87;&#87;&#87;&#46;&#71;&#79;&#111;&#103;&#108;&#69;.com/custom"><TD height="50" style="'+nav+'"align="center" width="33%"><A class="nav" style="'+a_nav2+'" HREF="#" onClick="backward(); return false;" title="'+backtitle+'">'+back_b+'</A> &nbsp; <A class="nav" style="'+a_nav+'" HREF="'+index_link+'">'+index+'</A> &nbsp;  <A class="nav" style="'+a_nav2+'" HREF="#" onClick="forward(); return false;" title="'+forwtitle+'">'+forw_b+'</A></TD><TD style="'+nav+'"align="center"><INPUT TYPE=text name=q size=20 maxlength=255 style="'+searchfield+'" onFocus="clear_input();" value="Search this Site"><INPUT type=hidden name=hl VALUE="en"><INPUT type=hidden name=cof VALUE="GALT:#000000;S:http://www.plasmaphysics.org.uk;GL:1;VLC:#000080;AH:center;BGC:#B9AF9B;LC:#000080;GFNT:#660033;ALC:#330080;T:#000000;GIMP:#663300;AWFID:e918e740ed5cc5ca;"><input type=hidden name=domains value="www.plasmaphysics.org.uk"><input type=hidden name=sitesearch value="www.plasmaphysics.org.uk"><INPUT type=submit name=sa VALUE="Search" style="'+searchbutton+'"></TD><TD style="'+nav+'"align="center" width="33%"><A class="nav" style="'+a_nav+'" HREF="/download.htm">'+download_b+'</A>  &nbsp; &nbsp; <A class="nav" style="'+a_nav+'" HREF="print/'+printpage+'">'+printversion_b+'</A></TD></FORM></TR></TABLE>');

}


 function reload_window() { 
	 
	   firefox=-1;
       if (navigator.userAgent) { firefox=navigator.userAgent.search(/Firefox/);  } 
	   if (firefox==-1) { window.location.reload(); }
	      else { 
		      if (navigator.cookieEnabled) {
                 if ( document.cookie.indexOf('resize=') ==-1 ) {
                  alert('For best display, please reload the page after resizing your window');  
                  today = new Date();
                  expiry = new Date(today.getTime() + 24*60*60*1000);   // cookie expires after 1 day
                  document.cookie='resize=yes; expires='+expiry.toGMTString()+'; path=/'; 
				 }
			  }
			  else { alert('Please reload this page'); }
				
          }
		  
}
 
window.onresize=reload_window;

}













