/*****************************************
* Open links in new window Script- By spk100 (spk100@yahoo.com)
* Script featured on/available at Dynamic Drive- http://www.dynamicdrive.com/
* Modified by DD. This notice must stay intact for use
*****************************************/

//Enter "_blank" for new window (each time), "window2" for a set secondary window
var newwindow="_blank";

function hyperlinks(target){
  if (target) where = newwindow;
  else where = "_self";
  where = "_self";
  for (var i=0; i<=(document.links.length-1); i++){
    var linkobj=document.links[i].href
      if ( linkobj.indexOf("javascript:") ==-1 && linkobj.indexOf("#") ==-1 && document.links[i].className == "popupLink"){
   	if (target && where!="_blank") //DynamicDrive.com added routine- open window in set secondary window
	  document.links[i].onclick=function(){

		//		   	window2=window.open(this.href, "Capoeira Haarlem")
	    window2=window.open("");
	    window2.document.open();

// Text of the new document
// Replace your " with ' or \" or your document.write statements will fail
	    window2.document.write("<html><head><title>Capoeira Haarlem</title>");
	    window2.document.write("<link href=\"capoeira2007.css\" rel=\"stylesheet\" type=\"text/css\" />");
	    window2.document.write("</head>");
	    window2.document.write("<body oncontextmenu=\"return false\" ondragstart=\"return false\" onselectstart=\"return false\">");
	    window2.document.write("<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'><tr align='center'><td valign='middle'>")
	    window2.document.write("<p align='center'><table><tr><td><div class='whiteBorder'>");
	    window2.document.write("<img src=\"");
	    window2.document.write(this.href);
	    window2.document.write("\" /></div></td></tr></table></p>");
	    window2.document.write("</td></tr></table>")
	    window2.document.write("</body></html>");

	    // close the document
	    window2.document.close(); 

	    window2.focus()
	    return false
	  }
   	else{
	  if (newwindow=="window2") document.links[i].onclick = "";    
	  //  document.links[i].target = where;
       	}
      }
  }
}

function inithyperlinks(){    //DynamicDrive.com added routine
  hyperlinks(true);
}

window.onload=inithyperlinks
