/* replace _blank target for new window. Use: "rel="external" to activate; */
function externalLinks() {
	if(!document.getElementById) return false;
	
	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";
		}
	}
}

/* email information; hide from bots */
var mailserver = "finwaygroup.com";

function getEmail (incommingAddress) {
	var address = incommingAddress + "@" +  mailserver;
	document.write('<a href="mailto:'+address+'?Subject=Information request from finwaygroup.com"' + 'rel="next"' + 'title="send email to '+address+'">' +address+ '</a>');
}


/* generic popup window script */
function newWin(i_url, i_name, i_width, i_height, i_y, i_x, i_scroll, i_resizeable)
{
	// center the window
	i_x = (screen.width - i_width) / 2; 
	i_y = (screen.height - i_height) / 2;
	
	// pass in the rest of the goodies 
	params = 'height='+ i_height +', width='+ i_width +', top='+ i_y +', left='+ i_x +', scrollbars='+ i_scroll +', resizable='+ i_resizeable +',status=0,location=0';
    window.open(i_url, i_name, params);
}


/*  popup window */
/*function defaultWindow()
{
	document.getElementById("elementID").onclick = function()
	{
		this.href = "javascript:void(0)"; // kill the normal url clicky action
		newWin("url", "name", width, height);
	
	}	
}*/



/* domready; apply functions */
/*window.addEvent('domready', function() {
	if(!document.getElementById) return false;*/
	
	/* -- subnav sliders --*/
	/* services sub nav toggle */
//	var serviceSub = new Fx.Slide('serviceSubnav');
//		serviceSub.hide();
//	
//	/* faq sub nav toggle */
//	var faqSub = new Fx.Slide('faqSubnav');
//		faqSub.hide();
//
//	$('services').addEvent('click', function(e){
//		e = new Event(e);
//		serviceSub.toggle();
//		e.stop(); 	
//	});
//	
//	$('faq').addEvent('click', function(e){
//		e = new Event(e);
//		faqSub.toggle();
//		e.stop(); 	
//	});


	
	
	externalLinks(); /* _blank replacement; */
	//defaultWindow(); /* default popup window functionality */
/*});*/
