

function position_slogan() {
	var slogan_container = document.getElementById('be_somebody_slogan_container');
	var be_somebody_picture = document.getElementById('be_somebody_picture');
	var coord = getDim(be_somebody_picture);
	slogan_container.style.top = (coord.y + be_somebody_picture.height - 55) + 'px';
	slogan_container.style.left = (coord.x + be_somebody_picture.width - 210) + 'px';
	slogan_container.style.visibility = 'visible';
}
//window.onresize = function(){position_slogan();}
//gl_add_onload_event(position_slogan);

function gl_add_onload_event(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
	window.onload = func;
    } else {
	window.onload = function() {
	    if (oldonload) {
		oldonload();
	    }
	    func();
	}
    }
}

function sweep_external_links() {
	for(x=0;x<document.links.length;x++) {
		if ((document.links[x].href.indexOf('http')==0 && document.links[x].href.indexOf('leominstercu.com/')==-1 && document.links[x].href.indexOf('teggweb.com')==-1 && document.links[x].href.indexOf('homebanking.leominstercu.com')==-1) || document.links[x].href.indexOf('/loanapplications/')>-1) {
		//if ((document.links[x].href.indexOf('http')==0 && document.links[x].href.indexOf('wpb1.webproductionsinc.com/')==-1 && document.links[x].href.indexOf('teggweb.com')==-1 && document.links[x].href.indexOf('homebanking.leominstercu.com')==-1) || document.links[x].href.indexOf('/loanapplications/')>-1) {
			update_link(document.links[x]);
		}
	}
}
gl_add_onload_event(sweep_external_links);

function update_link(obj, is_google_map) {
	obj.setAttribute('redirect', obj.href);
	if (is_google_map) {
		obj.setAttribute('onclick', 'gl_ajax_dialog(\'popup\', \'Important Notice\', \''+assess_dir_level()+'externallink.asp?redirect=\'+escape(this.getAttribute(\'redirect\'))+\'&target=\'+escape(this.getAttribute(\'target\')), 1);');
	} else {
		obj.onclick = function() {gl_ajax_dialog('popup', 'Important Notice', assess_dir_level()+'externallink.asp?redirect='+escape(this.getAttribute('redirect'))+'&target='+escape(this.getAttribute('target')), 1);};
	}
	obj.href = 'javascript:void(0)';
	obj.removeAttribute('target');
}

function getDim(el){
	for (var lx=0,ly=0;el!=null;
		lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);
	return {x:lx,y:ly}
}

function assess_dir_level() {
	if (window.location.href.indexOf('/equityad/')>-1) {
		return '../';
	} else {
		return '';
	}
}