
// Javascript functions required by various areas throughout.

// Products page

function openBrWindow() {
  var day = new Date();
  var id = day.getTime();
  window.open('productsgallery.html',id,'resizable,width=600,height=420');
}

// Press releases (moved to News and Awards)

function newsWin(url,w,h) {
      var day = new Date();
	  var id  = day.getTime();
	  var params = 'width='+w+',height='+h+',scrollbars,resizable';
	  var win = open(url,id,params);
}

// Various locations, including from within press release pop-ups

function newWin(img,title,w,h) {
      var day = new Date();
	  var id  = day.getTime();
	  var wd = w+125;
	  var ht = h+150;
	  var params = 'width='+wd+',height='+ht+',scrollbars,resizable';
	  var msg = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n'+
	    '<html><head><title>'+title+'<\/title>\n'+
	    '<style type="text\/css">\n'+
		'body,html {  background-color: #000000; color:#ffffff; font-family:Arial,Helvetica, Sans-Serif; text-align:center; }\n'+
		'<\/style><\/head>'+
		'<body><h3>'+title+'<\/h3>\n'+
		'<img src="'+img+'" width="'+w+'" height="'+h+'" border="0" alt="'+title+'">\n'+
		'<br><form><hr width="100%" size="1"><input type="button" onClick="window.close\(\);" value="Close Window"><hr width="100%" size="1"></form>\n'+
		'<\/body><\/html>\n\n';
		
	  var win = open('',id,params);
	  win.document.write(msg);
	  win.document.close();
}

// Added 01-27-10

window.onload = function() { 
	external_links = new Array('blog-link','blog-link-bottom','yt-link','yt-link-bottom','blog-link-contact','yt-link-contact');
	for (i=0;i<external_links.length;i++) {
		if (document.getElementById(external_links[i])) { 
			document.getElementById(external_links[i]).onclick=function() { exitMessage(this.href); }
		}
	}
}; 
function exitMessage(url) {
	var msg = 'The link will open in a new window.\nClick OK to continue.';
	alert(msg);
	return true;
}