﻿// JScript File
function OpenExt(obj)
{
  window.open(obj.href);
  return false;
}

function BookMark(obj)
{
  if(document.all && !window.opera)
  { window.external.AddFavorite(location.href, document.title);return false; }
  else{ obj.title = document.title; return true; }
}

var newWindow = null;

function popUpWin(url){	
	newWindow = window.open(url, 'newWin');
	newWindow.focus();
}

function doPopUp(e)
{

popUpWin(this.href);
//cancel the default link action if pop-up activated
if (window.event) 
	{
	window.event.returnValue = false;
	window.event.cancelBubble = true;
	} 
else if (e) 
	{
	e.stopPropagation();
	e.preventDefault();
	}
}
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function findPopUps(linkTitle)
{
var popups = document.getElementsByTagName("a");
for (i=0;i<popups.length;i++)
	{
	if (popups[i].rel.indexOf("popup")!=-1)
		{
		// attach popup behaviour
		popups[i].onclick = doPopUp;
		// add info to title attribute to alert fact that it's a pop-up window
		popups[i].title = trim(popups[i].title + " [" + linkTitle + "] ");
		
		//if the first child is an image, set the same title
		if(popups[i].childNodes)
  		if(popups[i].childNodes[0].nodeName == "IMG")
	  	  popups[i].childNodes[0].title = popups[i].title;
		}
	}
}


