/* 
   BWY LONDON REGION :: javascript 
   LyndworthDesign May 2009
*/

defaultStatus = "BWY London Region | the main Yoga resource site for London and Middlesex"; 
function statbar() {
    window.status = "BWY London Region | the main Yoga resource site for London and Middlesex"; 
}

function go2(f) { 
    window.location.hash=f; 
}

/*** script to prevent framing of website ***/
if (parent.frames.length > 0) {
    parent.location.href = self.document.location;
}


function win_close() { 
   setTimeout('window.close()', 600); 
} 


/*** anti-spam script ***/
var show, name, dom, m;
function ns(show, name, dom) { 
   m = "<a class=\"eml\" href=\"mailto:" +name+"@"+dom+"\" title=\"send mail to "+show+"\"  ";
   m += "onmouseover=\"window.status='Send mail to "+ show+"'; return true;\" ";
   m += "onmouseout=\"window.status=''; return true;\" ";
   m += "onfocusout=\"window.status='opening e-mail program'; return true;\">";
   m += show+"</a>";
   document.write(m);
}
var show, name, dom, m;
function ns2(show, name, dom) { 
   m = "<a class=\"link\" href=\"mailto:" +name+"@"+dom+"\" title=\"send mail to "+show+"\"  ";
   m += "onmouseover=\"window.status='Send mail to "+ show+"'; return true;\" ";
   m += "onmouseout=\"window.status=''; return true;\" ";
   m += "onfocusout=\"window.status='opening e-mail program'; return true;\">";
   m += show+"</a>";
   document.write(m);
}
var show, name, dom, m;
function ns3(show, name, dom) { 
   m = "<a class=\"email\" href=\"mailto:" +name+"@"+dom+"\" title=\"send mail to "+show+"\"  ";
   m += "onmouseover=\"window.status='Send mail to "+ show+"'; return true;\" ";
   m += "onmouseout=\"window.status=''; return true;\" ";
   m += "onfocusout=\"window.status='opening e-mail program'; return true;\">";
   m += show+"</a>";
   document.write(m);
}

/* *** OPEN NEW WINDOW SCRIPTS *** */
        function bkform(data) {
           visit = 'http://www.bwylondon.org.uk/booking-info.htm';
           theURL = visit + data;
           newwindow = window.open(theURL, 'booking_form', 'width=560,height=610,resizable=0,status=1,left=25, top=25, menubar=0, toolbar=0, sName=_blank, location=0,scrollbars=1'); 
           if ( window.focus ) { newwindow.focus(); }
        }
        function bkform2(data) {
           visit = 'http://www.bwylondon.org.uk/booking-info.htm';
           theURL = visit + data;
           newwindow = window.open(theURL, 'booking_form', 'width=560,height=610,resizable=0,status=1,left=25, top=25, menubar=0, toolbar=0, sName=_blank, location=0,scrollbars=1'); 
           if ( window.focus ) { newwindow.focus(); }
        }


/*** toggle div ***/
   function toggle(d)
   { 
      style = document.getElementById(d).style ; 
      if(style.display == "block") 
      { 
         style.display = "none"; 
      } else { 
         style.display = "block"; 
      } 
   } 


/*** rewrite external links to open in new window ***/
   function externalLinks() 
   { 
      if (!document.getElementsByTagName) 
      {
         return; 
      }
      var anchors = document.getElementsByTagName("a"); 
      for (var i=0; i<anchors.length; i=i+1) 
      { 
         var anchor = anchors[i]; 
         if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") 
         { 
            anchor.target = "_blank"; 
         }
      } 

      var forms = document.getElementsByTagName("form"); 
      for(var i = 0; i < forms.length; i=i+1) 
      { 
         var form = forms[i]; 
         if(form.getAttribute("action").substring(0, 4) == "http") 
         {
            form.target = "_blank"; 
         } 
      } 
   } 

/*** script to initiate javascripts  ***/
   function setup() 
   {
      externalLinks();
   }
   window.onload=setup;



