screenBuffer=100;
myLeft=(screen.width - 640)/2;
myTop=(screen.height - 580)/2;
myHeight=500;
brochure=null;popup_window=null;pdfdisplay=null;definition=null;xternal=null;

function stopError() {return true;}

window.onerror = stopError;

function popupWindow(windowType, theURL, winName, width, height, toolbar, scrollbars, resizable, top, left)
{
    if (windowType=="daughter")
    {
            winName="fmDaughter";
            width=800;
            height=520;
            toolbar="yes";
            scrollbars="yes";
            resizable="yes";
            var top=eval((screen.height-height)/2);
            var left=eval((screen.width-width)/2);
    }
    else if (windowType=="offsite")
    {
        winName="fmOffsite";
        width=800;
        height=480;
        toolbar="yes";
        scrollbars="yes";
        resizable="yes";
        var top=eval((screen.height-height)/2);
        var left=eval((screen.width-width)/2);
    }
    else if (windowType=="popup")
    {
        winName="fmPopup";
        width=640;
        height=295;
        toolbar="yes";
        scrollbars="yes";
        resizable="yes";
        var top=eval((screen.height-height)/2);
        var left=eval((screen.width-width)/2);
    }
    else if (windowType=="adobe")
    {
        winName="fmPopup";
        width=640;
        height=445;
        toolbar="yes";
        scrollbars="yes";
        resizable="yes";
        var top=eval((screen.height-height)/2);
        var left=eval((screen.width-width)/2);
    }
    else {
        if (!winName || winName==" ") winName="fmDaughter";
        if (!width || width==" ") width=640;
        if (!height || height==" ") height=480;
        if (!toolbar || toolbar==" ") toolbar="yes";
        if (!scrollbars || scrollbars==" ") scrollbars="yes";
        if (!resizable || resizable==" ") resizable="yes";
        if (!top || top==" ") var top=eval((screen.height-height)/2);
        if (!left || left==" ") var left=eval((screen.width-width)/2);
    }

    if (!popup_window || popup_window.closed){
        var popup_window = window.open(theURL, winName, 'toolbar='+toolbar+', menubar='+toolbar+', location='+toolbar+', status='+toolbar+', scrollbars='+scrollbars+', resizable='+resizable+', width='+width+', height='+height+', top='+top+', left='+left);
    }else{
        popup_window.focus();
        popup_window.location.href = theURL;
    }
}

function open_fmbrochure (theURL,winName){
if (!brochure || brochure.closed){brochure = window.open(theURL,'showbrochure','toolbar=yes,scrollbars=yes,resizable=yes,width=640,height='+myHeight+',top='+myTop+',left='+myLeft);
}else{brochure.focus();brochure.location.href = theURL;
}
}

//Popup Survey Window.  The window size is smaller and has no scrollbar and toolbar.
function popup_window (theURL,winWidth,winHeight){
if (winWidth == null || winWidth==" ") { winWidth=640}
if (winHeight == null || winHeight==" ") { winHeight=295}
if (!popupwindow || popupwindow.closed){popupwindow = window.open(theURL,'display','toolbar=no,scrollbars=yes,resizable=yes,width='+winWidth+',height='+winHeight);
}else{popuwindow.focus();popupwindow.location.href = theURL;
}
}

// Appends the hitbox file path and name to the pdf url and then passes it along to fileRedirect().
// The setTimeout function was the only way this could be done from an onClick instead of an href!

function display_pdf (theURL){
if (theURL.indexOf("http://") == 0 || theURL.indexOf("www.") == 0 || theURL.indexOf("https://") == 0 || theURL.indexOf("ww3.") == 0){displayFile (theURL);
}else{
    loc=location.pathname;
    posLast=loc.lastIndexOf("/");
    dirPath=loc.substring(0,posLast+1);
    if (theURL.indexOf("/") != 0){
     if (theURL.indexOf("./") == 0){theURL = dirPath + theURL.substring(2,theURL.length);
     }else{theURL = dirPath + theURL;
     }
    }
redirect = "/include/hitbox/track_and_redirect.html?file=" + theURL;
setTimeout('fileRedirect (redirect);', 0);
}
}

// Redirect the url to the hitbox tracking html page.
function fileRedirect (theURL){window.location = theURL;}

//Daughter window to display any file type.
function displayFile (theURL){
if (!pdfdisplay || pdfdisplay.closed){pdfdisplay = window.open(theURL,'display','toolbar=yes,scrollbars=yes,resizable=yes,width=640,height='+myHeight+',top='+myTop+',left='+myLeft);
}else{pdfdisplay.focus();pdfdisplay.location.href = theURL;
}
}

//Daughter window to display PDF files.  This window uses the Adobe Exchange navigation menu
//instead of the browser's defualt navigation menu.

function open_brochure (theURL,winName){
if (!brochure || brochure.closed){brochure = window.open(theURL,'showbrochure','toolbar=yes,scrollbars=yes,resizable=yes,width=640,height='+myHeight+',top='+myTop+',left='+myLeft);
}else{brochure.focus();brochure.location.href = theURL;
}
}

function open_page (theURL,winName){
if (!brochure || brochure.closed){brochure = window.open(theURL,'showbrochure','toolbar=yes,scrollbars=yes,resizable=yes,width=910,height='+myHeight+',top='+myTop+',left='+myLeft);
}else{brochure.focus();brochure.location.href = theURL;
}
}

function off_site (theURL){
if (!xternal || xternal.closed){xternal = window.open(theURL,'extrnl','toolbar=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,location=yes,width='+screen.width+',height='+myHeight+',top='+myTop+',left='+myLeft);
}else{xternal.focus();xternal.location.href = theURL;
}
}

function display_restricted_access (){window.open('/corporate/errors/restricted_access_popup.html','restricted_access','toolbar=no,scrollbars=no,resizable=no,width=425,height=340,top='+eval((screen.height-200)/2)+',left='+eval((screen.width-340)/2));}

function show_definition (theURL,winName){
if (!definition || definition.closed){definition = window.open(theURL,'showdef','toolbar=yes,scrollbars=yes,width=600,height=150,top='+myTop+',left='+myLeft);
}else{definition.focus();definition.location.href = theURL;
}
}

function display_alert(alertType){
	if (alertType=='restatement'){alertMessage='CAUTIONARY NOTE REGARDING PREVIOUSLY REPORTED FINANCIAL RESULTS --Freddie Mac has restated its previously issued consolidated financial statements for the years 2000 and 2001 and the first three quarters of 2002 and revised its fourth quarter and full-year consolidated financial statements for 2002 (collectively referred to as the \“restatement\”).  Freddie Mac\'s Information Statement and Annual Report to Shareholders dated February 27, 2004 (the \“2002 Information Statement\”) contains important information about the restatement and its impact on previously reported results.  The financial statements and other information contained in the 2002 Information Statement supersede the previously issued annual and quarterly financial statements for 2000, 2001 and 2002 and the corresponding information for those periods (and prior periods) contained in prior earnings releases, Information Statements, Information Statement Supplements, Annual Reports, Monthly Volume Summaries and Quarterly Investor/Analyst reports; such previous financial statements and corresponding information should no longer be relied upon.';
	}
	else{
		alertMessage='';
	}
	alert(alertMessage);
}

function checkAlertURLs() {
}
