<!--

if (top.frames.length > 1) {top.location = self.location;}

function externalLinks() {

	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");

	for (var i=0; i<anchors.length; i++) {
	   var anchor = anchors[i];
	   if (anchor.getAttribute("href") &&
	       anchor.getAttribute("rel") == "external")
	     anchor.target = "_blank";
	}
}

window.onload = externalLinks;

function validate_required(field, alerttxt) {
	with (field) {
		if (value==null||value=="") {
			alert(alerttxt);return false;
		} else {
			return true;
		}
	}
}

function validate_form(thisform) {
	with (thisform) {
		if (validate_required(rsk, "Please type search keyword(s) before clicking the button!")==false)
			{rsk.focus();return false;}
	}
}

function testAmFonts() {

	amFont1 = "Arial AMU";
	amFont2 = "Arian AMU";

	var body  = document.body,
	test  = document.createElement('div'),
	installed = false,
	template =
		'<b style="display:inline !important; width:auto !important; font:normal 10px/1 \'X\',sans-serif !important">ii</b>'+
		'<b style="display:inline !important; width:auto !important; font:normal 10px/1 \'X\',monospace !important">ii</b>',
	ab;

	if (amFont1) {
		test.innerHTML = template.replace(/X/g, amFont1);
		test.style.cssText = 'position: absolute; visibility: hidden; display: block !important';
		body.insertBefore(test, body.firstChild);
		ab = test.getElementsByTagName('b');
		installed1 = ab[0].offsetWidth === ab[1].offsetWidth;
		body.removeChild(test);
	}

	if (amFont2) {
		test.innerHTML = template.replace(/X/g, amFont2);
		test.style.cssText = 'position: absolute; visibility: hidden; display: block !important';
		body.insertBefore(test, body.firstChild);
		ab = test.getElementsByTagName('b');
		installed2 = ab[0].offsetWidth === ab[1].offsetWidth;
		body.removeChild(test);
	}

	if(!installed1 && !installed2) {
		document.getElementById('AMfontOffer').style.display='block';
	}
}

// -->
