function fn_event (obj_object, str_event, str_function) {

	if (obj_object.addEventListener) {
   		obj_object.addEventListener(str_event, str_function, true);
   		return true;
	}

	else if (obj_object.attachEvent) {
		return obj_object.attachEvent("on" + str_event, str_function);
	}

	else {
		return false;
	}
}

function fn_ahref() {

	if (!document.getElementsByTagName) return;
	arr_nodes = document.getElementsByTagName('A');

	for (i = 0; i < arr_nodes.length; i++) {
		obj_node = arr_nodes[i];
		if (obj_node.getAttribute('href') && obj_node.getAttribute('rel') == 'external')
		obj_node.target = '_blank';
	}
}

fn_event (window, 'load', fn_ahref);

if (typeof sIFR == "function") {
	var template = named ({sFlashSrc : "/hoseasonsvillas/images/gillsans.swf", sColor : "#152B5B;"});
	sIFR.replaceElement ("h1", template);
}

/**************************************************
	Popup window related functions
**************************************************/
function popup(url, title, width, height, scroll) {
	var s = 'menubar=no,toolbar=no,location=no,resizable=yes,status=yes'
	s += ',scrollbars=' + scroll
	s += ',width=' + width + ',height=' + height;
	s += ',top=' + (screen.availHeight - height) / 2 + ',left=' + (screen.availWidth - width) / 2;

	//close existing window
	if (navigator.newwindow) navigator.newwindow.close();
	
	//save new window object in navigator object and activate
	navigator.newwindow = self.open(url, title, s);
	navigator.newwindow.focus();
	
	return false;
}