
// iphone redirect: NOT on purchase2.aspx page
if (location.pathname != "/purchase2.aspx") {
    if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)) {
	    location.replace('http://iphone.givethegiftcard.com');
    }
}

// launches links in new windows - workaround for strict mode that doesn't support the target attribute
function externalLinks() { 
	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"; 
	}
}

YAHOO.util.Event.addListener(window, 'load', function() {
		externalLinks();
	});
