/*This file created to add site js functions */
document.write('<script src="', '/Scripts/jquery-1.3.2.min.js', '" type="text/JavaScript"><\/script>');
document.write('<script src="', '/Scripts/contingency.js', '" type="text/JavaScript"><\/script>');

/*
jquery is not is scope here...
need an onload manager because document.write doesn't create a blocking script load
*/

function onloadListener(func)
{
	if(window.addEventListener)
	{
		window.addEventListener('load', func, false);
	}
	else if(window.attachEvent)
	{
		window.attachEvent('onload', func);
	}
}

function emailafriend(url) 
{ 
        var murl = ""; 
        url= url || document.URL;
        url=url.toUpperCase(); 
       
        var strauthUrl="-authoring.rf.lilly.com"; 
        var strstgUrl="-staging.rf.lilly.com" 
        var strpseUrl="-pseudo.rf.lilly.com"; 
 
        if (url.indexOf(strauthUrl.toUpperCase()) >= 0 || url.indexOf(strstgUrl.toUpperCase()) >= 0|| url.indexOf(strpseUrl.toUpperCase()) >= 0) { 
                                murl = "https://emailafriend.lilly.com/index.jsp?url=" + url.toLowerCase(); 
                        } 
                else 
                        { 
                                murl = "https://emailafriend.lilly.com/index.jsp?url=" + url.toLowerCase(); 
 
                        } 
        window.open(murl, 'EmailAFriend', 'height=500, resizable=yes, scrollbars=yes, width=650'); 
} 

onloadListener(function()
{
	/*iehacks*/
	$('#ctl00_head_PlaceHolderMain_Top_x0020_Section__ControlWrapper_RichHtmlField').parent().parent().remove();

    //add class to body for per page style fixes
    var fullURL = window.location + '';
    var pos = fullURL.lastIndexOf("/");
    var page = fullURL.substring(pos + 1);
    page = page.replace(".aspx", "");    
    $('body').addClass(page+'-body');
    
	//ie menu bg cache fix:
	try { document.execCommand('BackgroundImageCache', false, true);} catch(e) {}    
});




