/*
    This function looks after setting up the popup window for email
*/
function RD_PopupWindow(url, windowName, params) {
	var newWindow = window.open('/en/Emailpage.aspx?referrer=' + escape(url), windowName, params);
	newWindow.focus();
}

function email_PopupWindow(url, windowName, params) {
	var newWindow = window.open('/en/Emailpage.aspx?referrer=' + escape(url), windowName, params);
	newWindow.focus();
}

function emailContact(id) {
	var url = document.URL;
	var newWindow = window.open('/en/email.aspx?referrer=' + escape(url) + '&id=' + id, '', 'top=' + ((screen.height - 507) / 2) + ',left=' + ((screen.width - 481) / 2) + ',width=481,height=507,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no');
	newWindow.focus();
}

function emailKeyContact(id) {
	var url = document.URL;
	var newWindow = window.open('/en/email.aspx?referrer=' + escape(url) + '&id=' + id + '&keycontact=true', '', 'top=' + ((screen.height - 507) / 2) + ',left=' + ((screen.width - 481) / 2) + ',width=481,height=507,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no');
	newWindow.focus();
}

// Opens up the A&M Careers apply form.
function emailCareersContact(divisionCode,subject) {

    var screenHeight
    if (divisionCode == "TA")
    {
        screenHeight = 550
     }
    else
    {
        screenHeight = 420
    }
        
	var newWindow = window.open('/en/emailCareers.aspx?code=' + divisionCode + '&subject=' + subject, '', 'top=' + ((screen.height - 400) / 2) + ',left=' + ((screen.width - screenHeight) / 2) + ',width=400,height=' + screenHeight + ',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no');
	newWindow.focus();
}
