function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_openBrWindowPopUp(theURL,winName,w,h) { //v2.0

   var availHeight = screen.availHeight;
   var availWidth = screen.availWidth;
 
   var x = 0, y = 0; 
   if (document.all) {
        x = window.screenTop; 
        y = window.screenLeft;
   }
   else if (document.layers) {  
        x = window.screenX;
        y = window.screenY;
   }
   
 
   t = (screen.height / 2) - (h / 2);
   l = (screen.width /2) - (w / 2);
 

   var arguments = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width='+w+',height='+h+',left='+l+',top='+t;
   var newWindow = window.open(theURL,'popup','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width='+w+',height='+h+',left='+l+',top='+t);
 
   newWindow.focus();
}


function MM_openBrWindowPopUp2(theURL,winName,w,h) { //v2.0

   var availHeight = screen.availHeight;
   var availWidth = screen.availWidth;
 
   var x = 0, y = 0; 
   if (document.all) {
        x = window.screenTop; 
        y = window.screenLeft;
   }
   else if (document.layers) {  
        x = window.screenX;
        y = window.screenY;
   }
   
 
   t = (screen.height / 2) - (h / 2);
   l = (screen.width /2) - (w / 2);
 

   var arguments = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width='+w+',height='+h+',left='+l+',top='+t;
   var newWindow = window.open(theURL,'popup','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width='+w+',height='+h+',left='+l+',top='+t);
 
   newWindow.focus();
}

   
function openTargetBlank(e){
   
   var className = 'external';
   var className2 = 'external2';
   var className3 = 'print';
   var className4 = 'external3';
   var className5 = 'external4';
   
   
   if (!e) var e = window.event;
   var clickedObj = e.target ? e.target : e.srcElement;
   
   if(clickedObj.nodeName == 'A' )
    {
      r=new RegExp("(^| )"+className+"($| )");
	  r2=new RegExp("(^| )"+className2+"($| )");
	  r3=new RegExp("(^| )"+className3+"($| )");
	  r4=new RegExp("(^| )"+className4+"($| )");
	  r5=new RegExp("(^| )"+className5+"($| )");
	  
      if(r.test(clickedObj.className)){
		 MM_openBrWindowPopUp2(clickedObj.href,'popup','500','300');
		 return false;
       }
	  
	  if(r2.test(clickedObj.className)){
		 MM_openBrWindow(clickedObj.href,'newWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=400');
        return false;
      }
	  
	  if(r3.test(clickedObj.className)){
		window.print();
        return false;
      }
	  
	  if(r4.test(clickedObj.className)){
		MM_openBrWindow(clickedObj.href,'','scrollbars=no,width=600,height=373');
        return false;
      }
	  
	  if(r5.test(clickedObj.className)){
		MM_openBrWindow(clickedObj.href,'','scrollbars=yes,width=550,height=550');
        return false;
      }
	  
	 
	  
    }
}
   
document.onclick = openTargetBlank;


