<!-- hide from old browsers
/* THIS IS A COMMENT LINE WITHIN A SCRIPT 
 ###################################################################################################
 this script only works on the internet. Any html file calling this function must pass an index
 frame loader eg indexmag.html in the body load tag. The calling page will be loaded into the 
 child frame.  c mol smith 2003 (in part)
 ####################################################################################################*/


/* THIS function loads the named index page and common menu page. */
/* ============================================================== */
    function callanindex(indexpage){
             var thispage = document.URL;
             var newtitle = document.title;
             var pretitle = "Mic-UK [site A]: ";
 
             if (document.URL.indexOf(".net",0) != -1){
             pretitle="Mic-UK [site B]: ";
 

         } 

             /* if not running on local pc */
             if (document.URL.indexOf('http:',0) != -1) {

                 if (top.location == self.location) {
                     self.location.replace(indexpage + "?" + thispage)
                 }
                 
                 
              }

    parent.top.document.title=pretitle+newtitle;
     }

/* THIS function switches to exact page on mirror to site a or b  */
/* ============================================================== */
      function switchSite(){
      var siteURL=parent.Body_frame.location.href;
      var toDomain="http://www.microscopy-uk.net/";
      var gotoPage="index.html";
      var whatPage="";
          whatPage=siteURL.split(".org.uk/");

         if (document.URL.indexOf(".net",0) != -1){
             toDomain="http://www.microscopy-uk.org.uk/";
             whatPage=siteURL.split(".net/");

         } 
     gotoPage=toDomain+whatPage[1];
     top.location.replace(gotoPage);


}

/* THIS function determines local calls to library, micscape, and mic-uk home pages */
/* It directs the call to the correct server independent of the page called       */
/* If any error occurs - visitor is taken to mic-uk.org index page as a default   */
/* When invoked from local pc, all 4 calls will result in net call to org index   */
/* ============================================================================== */
   function local(pagex){
    var whatpage = pagex;
    var gotopage = "index.html";
    var siteURL = document.URL;
    var domain = "http://www.microscopy-uk.org.uk/";
    var gotoURL = "http://www.microscopy-uk.org.uk/";

    if (siteURL.indexOf(".net",0) != -1){
             domain="http://www.microscopy-uk.net/";
             check=siteURL.indexOf(".net",0)
         }


 /*    if (siteURL.substring(0,24) == "http://www.microscopy-uk.n"){
             domain="http://www.microscopy-uk.net/"
         }
 */ 



         if ((whatpage == "mag") || (whatpage == "micscape")) {

            gotopage = "mag/indexmag.html"

         }

  
         if ((whatpage == "lib") || (whatpage == "library")) {

            gotopage = "mag/libindex.html"

         }


         if ((whatpage == "home") || (whatpage == "index")) {

            gotopage = "index.html"

         }

         
         if ((whatpage == "contact") || (whatpage == "email")) {

            gotopage = "mag/econtact.html"

         }



            gotoURL = domain + gotopage;
            self.location.replace(gotoURL);

         /*alert(gotoURL + check)*/

   }



/* THIS function in mols email decryptor */
/* ===================================== */

function bend(absorption,art,seat) {
absorption += ' ';
var circumstance = absorption.length;
var companion = 0;
var contact = '';
for(var corporation = 0; corporation < circumstance; corporation++) {
companion = 0;
while(absorption.charCodeAt(corporation) != 32) {
companion = companion * 10;
companion = companion + absorption.charCodeAt(corporation)-48;
corporation++;
}
contact += String.fromCharCode(forgive(companion,art,seat));
}
parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+contact;
}

function bring(courtesy,debate,goodbye) {
courtesy += ' ';
var speech = courtesy.length;
var design = 0;
for(var age = 0; age < speech; age++) {
design = 0;
while(courtesy.charCodeAt(age) != 32) {
design = design * 10;
design = design + courtesy.charCodeAt(age)-48;
age++;
}
document.write('&');
document.write('#');
document.write(forgive(design,debate,goodbye));
}
}

function forgive(people,government,human) {
if (human % 2 == 0) {
insect = 1;
for(var place = 1; place <= human/2; place++) {
law = (people*people) % government;
insect = (law*insect) % government;
}
} else {
insect = people;
for(var microorganism = 1; microorganism <= human/2; microorganism++) {
law = (people*people) % government;
insect = (law*insect) % government;
}
}
return insect;
}
// End hiding script from old browsers -->