// Function for bookmarks
function bookmark(){
  var MyURL = document.location.href;
  var MyTITLE = document.title;
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(MyURL,MyTITLE);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(MyTITLE,MyURL,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}


// Code for popup windows  - XHTML 1.0 Strict does not allow target attribute in <a> tag.
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external") {
     anchor.target = "_blank";
	 anchor.title = "This link opens in a new window";
   }
 }
}
window.onload = externalLinks;


// function for replacing the text in input fields onClick
function replaceText(){
  if( document.getElementById &&
      document.getElementsByTagName ){
    if( document.getElementById( 'emailField' ) ){
      var gallery = document.getElementById( 'emailField' );
      var links = gallery.getElementsByTagName( 'input' );
      for( var i=0; i < links.length; i++ ){
        links[i].onclick = function(){
          return showPic(this);
        };
      }
    }
  }
}



function popUpBox(INurl,INheight,INwidth,INscroll){

  newWindow = null;

  winprops = 'height='+INheight+',width='+INwidth+',scrollbars='+INscroll+',resizable';

        if (newWindow && newWindow.closed==false){
             newWindow.close();
	setTimeout("newWindow = window.open(INurl,'newWindow',winprops)",1000);
  	newWindow.focus();
         }
	else {
  	newWindow = window.open(INurl, 'newWindow', winprops);
  	newWindow.focus();
	}
}  



  
