window.onload = function () { setOnClick(); }

function setOnClick() {
	if (!document.getElementsByTagName) return;
	var i;
	var anchors = document.getElementsByTagName("a");	
	for (i = 0; anchors.length > i; i++) {
		if ( anchors[i] ) {
		switch(anchors[i].rel.toUpperCase()) {
			case "EXTERNAL" : anchors[i].target = "_blank"; break;
			case "PHONE" : anchors[i].onclick = function () { popNewWin(this.href,310,385,0); return false; }; break;			
			case "PHONE3D" : anchors[i].onclick = function () { popNewWin(this.href,310,385,0); return false; }; break;
			case "PHONE3DLARGE" : anchors[i].onclick = function () { popNewWin(this.href,370,480,0); return false; }; break;
			case "FORM" : anchors[i].onclick = function () { popNewWin(this.href,690,600,1,1); return false; }; break;
			case "FORM" : anchors[i].onclick = function () { popNewWin(this.href,610,600,1,1); return false; }; break;	
			case "MAP" : anchors[i].onclick = function () {
					var oImage = new Image;
					var oWidth = 620;
					var oHeight = 570;
					oImage.src = this.href;
					oImage.onload = function(){
						oWidth = oImage.width + 20;
						oHeight = oImage.height + 20;
						}
					//newWin = popNewWin(oImage.src,oWidth,oHeight,1,1);
					imgWin = popNewWin('about:blank',oWidth,oHeight,1,1);
					imgWin.document.writeln('<img src="' + oImage.src + '">');

					
					return false;
					}; break;	
		}
		
	}}

}



function popNewWin(popurl,width,height,scroll,resize){
	thisURL = popurl;
	thisWidth = width;
	thisHeight = height;
	thisScroll = scroll;
	if(thisScroll == 1)	{
		thisWidth = thisWidth + 14;
	}
	thisNewWindow=window.open(thisURL,"","width=" + thisWidth + ",height=" + thisHeight + ",scrollbars=" + thisScroll + ",resizable=" + resize + ",");
	return thisNewWindow;
}