function popUpWindow()
{
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName('a');
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute('href') && anchor.getAttribute('rel') == 'external')
anchor.target = '_blank';
}
}

function download(location)
{
var returnUrl = document.location.href;
var termsblock = document.getElementById("homepage_content");

var termsstring = "<h2>Terms and Conditions of Use</h2><p>The GM Procure brand is central to our identity and as such must be controlled in its use.</p><p>The GM Procure logo contains three elements:</p><ul><li>The logotype (GM Procure)</li><li>The house icon</li><li>The strapline</li></ul><p>The first two elements must not be split, and must appear together at all times.  The strapline may or may not be used. The logo must not be altered / modified / stretched / redrawn in any way, and should retain a proportional amount of clear space ('the exclusion area') around it.</p><p>Permission is freely granted to reproduce the logo within your organisation with the express understanding that it is not used to falsely claim a relationship with GM Procure that does not exist, nor seek to make fraudulent financial gain. GM Procure reserves the right to take any action as it, in its sole discretion, considers appropriate if it believes you to have breached this understanding.</p><p>By accepting these term and conditions you agree to abide by the above.</p><button onClick=\"javascript:iAgree('"+location+"','"+returnUrl+"');\">I Agree</button><button onClick=\"javascript:cancel('"+returnUrl+"');\">Cancel</button>";
termsblock.innerHTML = '<div id="terms">'+termsstring+'</div>';
var termscontent = document.getElementById("terms");
termscontent.style.border = '2px solid #378eca';
termscontent.style.backgroundColor = '#F4F4F4';
termscontent.style.marginLeft = 'auto';
termscontent.style.marginRight = 'auto';
termscontent.style.padding = '10px';
termscontent.style.width = '600px';
termscontent.style.textAlign = 'center';
termscontent.style.display = 'block';
}

function iAgree(location, returnUrl)
{
window.open(location,'Download','location=no');
document.location.href = returnUrl;
}

function cancel(returnUrl)
{
var returnUrl = returnUrl;
document.location.href = returnUrl;
}