
path = new Array();
path.push('/static/js/lib/prototype.js');
path.push('/static/js/imgReplace.js');

loadScrips(path);

function onDocumentLoad ()
{
	var font = 'TheSans-B7Bold.ttf';	
	text2image($$('#navi .menu em.img'),{
		font: font,
		width: '180',
		height: '16',
		color: 'ffffff',
		size: '10',
		positionx: 0,
		positiony: 0,
		replaceElement: {
			tagName: "em",
			className: "img"
		},
		modifyValue : function (vari)
		{
			return vari.toUpperCase();
		}
	});
	
	text2image($$('#content .tvteaser .text h2'),{
		font: font,
		width: '180',
		height: '16',
		color: '333',
		size: '10',
		positionx: 0,
		positiony: 0,
		replaceElement: {
			tagName: "h2",
			className: "img"
		},
		modifyValue : function (vari)
		{
			return vari.toUpperCase();
		}
	});
}


window.onload = onDocumentLoad;


function loadScrips (path)
{
	for(i=0;i<path.length;i++)
	{
		document.write('<script type="text/javascript" src="' + path[i] + '"></script>');
	}
}

function gotoLink (htmlElement) {
	
	var destinationURL = "";
	var target = "";
	
	if(htmlElement.href) {
		destinationURL = htmlElement.href;
		target = htmlElement.getAttribute("target");
	}
	else {
		if(htmlElement.childNodes) {
			if(htmlElement.getElementsByTagName("a")) {
				destinationURL = htmlElement.getElementsByTagName("a")[0].href;
				target = htmlElement.getElementsByTagName("a")[0].getAttribute("target");
			}
		}
	}
	
	if(target == "_blank") {
		window.open(destinationURL);
	}
	else {
		location.href = destinationURL;
	}
}

