//<![CDATA[
//
// External links script
// 
// Place this script directly before your </body> tag
//
// To use add class="ext" to the link you want to open externally
// To use a custom setting add it as an aditional class name seperated by a space
// If javascript is not enabled then the links will open in the current window
// To add a custom setting use :-
//
// ygSetting["class_name"]="custom_settings";
//
// example: 
//   ygSetting["more"]="width=250px,height=100px,scrollbars=yes,rsizable=no";
//
//   The corresponding link would be :-
//   <a href="http://www.yoursite.com" class="ext more whatever">your text</a>
//

function doLinks(){
  var yLinks=document.getElementsByTagName('a');
  for(i=0;i<yLinks.length;i++){
    ytClass=yLinks[i].className.split(" ")
    ytExternal=false;
    for (a=0;a<ytClass.length;a++){
      if (ytClass[a].slice(0,3)=="ext") {
        ytExternal=true;
      break;
      }
    }
    if (ytExternal) {
      //yLinks[i].style.color="#f00";
      yLinks[i].onclick=function(x){return yOpen(this)}
    }  
  }
}

function yOpen(ypLink){
  ytClass=ypLink.className.split(" ")
  ytSettings="";
  for (a=0;a<ytClass.length;a++){
    if (ytClass[a]!="ext"){
      if (ygSetting[ytClass[a]]) ytSettings=ygSetting[ytClass[a]];
    }
  }
  if (!ytSettings) ytSettings=ygSetting["ext"];
    window.open(ypLink.href,"",ytSettings,false);
    return false;
}

doLinks();
//]]>
