function eventsPop(url) {
	membercheck = window.open(url,"eventsPop","width=350,height=350,resizable=1,scrollbars=1")
	membercheck.focus();
}

window.onload = function()
{
	outgoing_links();	
}


function outgoing_links()
{
	var links = document.getElementsByTagName("a");
	var urlRe = new RegExp("http:\/\/((www\.)?)([a-zA-Z0-9\\_\\-\\.]*)\.([a-zA-Z]{1,5})/");
	for(var i=0;i<links.length;i++) 
    {
    	if (links[i].onclick == undefined)
		{
        	fullPath = links[i].href.toLowerCase();
			last4 = fullPath.substring(fullPath.length-4, fullPath.length);
            if (links[i].href.toLowerCase().indexOf("mailto:") > -1)
           	{
            	
           		links[i].onclick=function()
                {
                	href = this.href.toLowerCase();
                    emailLink = href.replace("mailto:","");
                    //alert('Mails CLick '+emailLink.toLowerCase());
                    pageTracker._trackEvent('Mails', 'Click', emailLink.toLowerCase() );
                };
           	}
            else if(links[i].href.toLowerCase().indexOf("lakeplacidvacations.com") == -1 && urlRe.test(links[i].href))
            {
            	links[i].onclick=function()
                {
                	href = this.href;
                    re = /^https?:\/\/(www\.)?([^/]+)?/i;
                    href.match( re );
                    domainOnly =  RegExp.$2;
                    //alert('Outgoing links Click '+domainOnly.toLowerCase());
                    pageTracker._trackEvent('Outgoing links', 'Click', domainOnly.toLowerCase() );
                };
           	}
            else if( (last4 == ".pdf") )
           	{
            	links[i].onclick=function()
                {
                	href = this.href;
                    splhref = href.split('/');
                    fileOnly = splhref[splhref.length-1];
                    //alert('Downloads PDF '+fileOnly.toLowerCase());
                    pageTracker._trackEvent('Downloads', 'PDF', fileOnly.toLowerCase() ); 
                };
             }
             else if( (last4==".doc") )
            {
                links[i].onclick=function()
                {
                    href = this.href;
                    splhref = href.split('/');
                    fileOnly = splhref[splhref.length-1];
                    //alert('Downloads DOC '+fileOnly.toLowerCase());
                    pageTracker._trackEvent('Downloads', 'DOC', fileOnly.toLowerCase() ); 
                };
             }
             
                 
		}
	}
}

