// Total Tennis template scripts
// version 1.0
// created by: Robert Gilks
// date: 31/8/00
// modified:

var loadTemplateScripts = true;

window.onresize = function() { 
	nn4Resize();
	if (largeLinkImg) positionLayer('largePhoto');
}

function showTopGfx() {	
	if (isDom) {
		document.getElementById('topCurve').style.visibility = "visible";
		document.getElementById('topPhoto').style.visibility = "visible";
		return;
	}
	if (isIE) {
		document.all['topCurve'].style.visibility = "visible";
		document.all['topPhoto'].style.visibility = "visible";
		return;
	}
	if (isNN4) {
		document.layers['topCurve'].visibility = "visible";
		document.layers['topPhoto'].visibility = "visible";
		return;
	}
}


function printFormat(theDiv) {	
	var theWidth = 600;
	var theHeight = screen.availHeight-200;
	var theLeft = (screen.availWidth - theWidth)/2;
	var theTop = (screen.availHeight - theHeight)/2; 
	var win = window.open("/print.htm", "", 'top='+theTop+',left='+theLeft+',menubar=1,toolbar=1,location=0,directories=0,status=0,scrollbars,resizable,width='+theWidth+',height='+theHeight);
	win.document.write("<html>");
	win.document.write("<head>");
	win.document.write('<link rel="STYLESHEET" type="text/css" href="/interfaces/html/common/main.css"/>');
	win.document.write('<link rel="STYLESHEET" type="text/css" href="/interfaces/html/common/print.css"/>');
	win.document.write('<script>var flashPlugin = false; var popUp = true;</script>');
	win.document.write("</head>");				
	win.document.write("<body>");
	if (isDom) {
		win.document.write(document.getElementById(theDiv).innerHTML);
	} else if (isIE) {
		win.document.write(document.all[theDiv].innerHTML);
	} else if (isNN4) {
		win.document.write(document.layers['pageBody'].toString());
	}
	win.document.write("</body>");
	win.document.write("</html>");
	win.document.close();
}



function positionLayer(theLayer) {	
	
	if (isIE) {
		var ref = document.all[theLayer].style;
		ref.visibility = "hidden";
		ref.filter = "blendTrans(duration=.5)";
		ref.pixelLeft = document.body.clientWidth - ref.pixelWidth - 20;
		if (ref.pixelLeft <= 480) ref.pixelLeft = 480;
		fade(document.all[theLayer]);
		return true;
	}
	if (isDom) {
		var ref = document.getElementById(theLayer).style;	
		ref.visibility = "hidden";
		ref.left = (parseInt(document.width) - parseInt(ref.width) - 20) + "px";
		if (parseInt(ref.left) <= 480) ref.left = 480 + "px";
		ref.visibility = "visible";
		return true;
	}
	if (isNN4) {
		var ref = document.layers[theLayer];
		ref.visibility = "hidden";
		ref.left = document.width - ref.document.width - 2;
		if (ref.left <= 480) ref.left = 480;
		ref.visibility = "visible";
		return true;
	}
	return false;
}


function fade(theLayer, vis) {
	var vis = "hidden";
	if (theLayer.style.visibility == "hidden") vis = "visible";			
	if (isIE && navigator.userAgent.indexOf("Windows 95") == -1 && navigator.userAgent.indexOf("Win95") == -1 ) {
		if (theLayer.filters.length > 0) {
			if (typeof(theLayer.filters[0]) == "object") {
				theLayer.filters.blendTrans.Apply();
				theLayer.style.visibility = vis;
				theLayer.filters.blendTrans.Play();
			} else { theLayer.style.visibility = vis; }
		} else { theLayer.style.visibility = vis; }
	} else { theLayer.style.visibility = vis; }
}