
// Instead of using target="_blank" on a link, use rel="external" and then have javascript that performs a little miracle.

// Plainly put if the visitor's browser is javscript enabled the link with rel="external" will behave like target="_blank", otherwise it's inert.

// See it here: http://www.sitepoint.com/article/standards-compliant-world/3

// From: http://forum.statcounter.com/vb/archive/index.php/t-24590.html

function externalLinks() {

if (!document.getElementsByTagName) return;

var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
var relvalue = anchor.getAttribute("rel");

if (anchor.getAttribute("href")) {
var external = /external/;
var relvalue = anchor.getAttribute("rel");
if (external.test(relvalue)) { anchor.target = "_blank"; }
}
}
}
window.onload = externalLinks;









// this function is used with google translator to separate the original URL so that we can link back to it later

function revertIt() {
  var ipaddy = document.location;
  ipaddy = String(ipaddy)
  var addyarray = ipaddy.split('u=');
  var orig_ip = addyarray[1];
  if(ipaddy.indexOf('translate_c') != -1) {
    document.location = orig_ip;
  }
}

//






// used to break out of other people's frames 
// any page that calls this common.js file should always get 'unframed'
if (parent.frames.length > 0) 
{
self.top.location.href=self.location.href;
}
// end:  used to break out of other people's frames 






// used to fix IE 6 Windows CSS bug.  see http://www.zeldman.com/daily/0802d.html#csslayoutrevisited
/*
	if (document.all && window.attachEvent) window.attachEvent("onload", fixWinIE);
	
	function fixWinIE() 
	{
		if (document.body.scrollHeight < document.all.content.offsetHeight) 
		{
			document.all.content.style.display = 'block';
		}
	}
*/
// end ie 6 windows css bug fix








// function that displays status bar message

function dm(msgStr) 
{
  document.returnValue = false;
  if (document.images) 
  { 
     window.status = msgStr;
     document.returnValue = true;
  }

}

var showMsg = navigator.userAgent != "Mozilla/4.0 (compatible; MSIE 4.0; Mac_PowerPC)";

function dmim(msgStr) 
{
  document.returnValue = false;
  if (showMsg) 
  { 
    window.status = msgStr;
    document.returnValue = true;
  }
}

// end: function that displays status bar message








// launchWindow used to open new window with properties


browserType=navigator.appName.charAt(0)+navigator.appVersion.charAt(0)
function launchWindow(myURL,myWidth,myHeight) {

        if (browserType=="N2") {
siteWindow=window.open("","","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+myWidth+",height="+myHeight);

                siteWindow.opener=self;
                siteWindow=myURL
        }
        if (browserType.charAt(0)=="M") {

siteWindow=window.open(myURL,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+myWidth+",height="+myHeight);
                siteWindow.opener=self;
        }
        else {

siteWindow=window.open(myURL,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+myWidth+",height="+myHeight);

                siteWindow.opener=self;
        }
	setTimeout("siteWindow.focus();",200);
}

// end: launchWindow used to open new window with properties








