
   function newWindow(url) {
      var day = new Date();
      var id  = day.getTime();
      var win = open(url,id,'width=620,height=450,scrollbars');
	  return false;
   }


// For video only, pass url, title, w, h

function generateURL(prodid) {
	   if (! prodid) { alert('No product id passed to function'); return false; }
	   var day= new Date();
	   var id = day.getTime();
	   var linkText = prompt('Enter the TEXT you would like on the link for this product','Buy This Product Now');
	   if (linkText == '') { linkText = 'Buy This Product Now'; }
       var msg='<!DOCTYPE HTML PUBLIC "-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN" "http:\/\/www.w3.org/TR\/html4\/loose.dtd">\n'+
	   '<meta http-equiv="Content-Type" content="text\/html; charset=iso-8859-1">\n'+
	   '<html><head><title>URL For This Product<\/title><\/head>'+
	   '<style type="text\/css">\n'+
	   'html,body { font-family: Arial,Helvetica,Sans-Serif; text-align: center; }\n'+
	   'h3,form{ text-align: center; }\n .link { width: 95%; }'+
	   '<\/style><body>\n'+
	   '<h3>URL for this Product<\/h3>\n'+
	   '<p>Copy and paste the code below to add link for this product into your  pages and emails. Be sure not to omit any of the catats \(&lt; or &gt;\)<\/p>\n'+
	   '<form action="">\n'+
	   '<textarea name="link" id="link" class="link" rows="5" cols="75">HTML pages:\n'+
	   '&lt;a href="https://mattmorsa.com/cgi-bin/order.cgi?prodid='+prodid+'"&gt;'+linkText+'&lt;\/a&gt;\n\n'+
	   'Plain Text Emails:\n https://mattmorsa.com/cgi-bin/order.cgi?prodid='+prodid+'<\/textarea>\n'+
	   '<form><hr width="100%" size="1"><input type="button" onClick="javascript:window.close();" value="Close Window">\n'+
	   '<hr width="100%" size="1"><\/form><\/body><\/html>\n';
	   var win = open('',id,'width=650,height=450,scrollbars,resizable');
	   win.document.write(msg);
	   win.document.close();
	   return false;
}

// For video only, pass url, title, w, h

function videoWin(filetype,url,title,w,h) {

	   if (! url) { return; }
	   var day= new Date();
	   var id = day.getTime();
	   var ww = w+75;
	   var wh = h+150;
	   h+=60; // Increment for controls
	   if ((screen.height) && (wh > screen.height-100)) { wh = screen.height-100; }
	   var params = 'width='+ww+',height='+wh+',scrollbars,resizable';
	   var t = (title != '')?title:url;
	      var msg='<!DOCTYPE HTML PUBLIC "-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN" "http:\/\/www.w3.org/TR\/html4\/loose.dtd">\n'+
		          '<meta http-equiv="Content-Type" content="text\/html; charset=iso-8859-1">\n'+
		          '<html><head><title>'+t+'<\/title><\/head>'+
		          '<style type="text\/css">\n'+
				  'html,body { font-family: Arial,Helvetica,Sans-Serif; text-align: center; }\n'+
				  'h3,form{ text-align: center; }\n'+
				  '<\/style><body>\n'+
				  '<h3>'+t+'<\/h3>\n';
				  if ((filetype == 'qt') || (filetype == 'QT')) {
                    msg += '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="' + w + '" height="' + h + '" codebase="http:\/\/www.apple.com\/qtactivex\/qtplugin.cab#version=6,0,2,0">\n'+
                    '<param name="src" value="http:\/\/www.mattmorsa.com\/' + url + '">\n'+
                    '<embed src="http:\/\/www.mattmorsa.com\/' + url + '" width="' + w + '" height="' + h + '" pluginspage="http:\/\/www.apple.com\/quicktime\/download\/"><\/embed>\n' +
                    '<\/object>';
				  }
				  else {
			         msg += '<object id="mediaplayer1" classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" width="' + w + '" height="' + h +'">\n' +
                     '<param name="ShowStatusBar" value="1">\n'+
                     '<param name="filename" value="http:\/\/www.mattmorsa.com\/' + url + '">\n'+
                     '<param name="src" value="http:\/\/www.mattmorsa.com\/' + url + '">\n' +
                     '<param name="autostart" value="1">\n'+
                     '<param name="volume" value="0">\n'+
                     '<embed src="http:\/\/www.mattmorsa.com/' + url + '" type="application\/x-mplayer2" pluginspage="http:\/\/www.microsoft.com\/windows\/mediaplayer\/" width="' + w + '" height="' + h + '" autostart="1" volume="0">\n'+
                     '<\/object>\n';
				  }
			 msg += '<form><hr width="100%" size="1"><input type="button" onClick="javascript:window.close();" value="Close Window">\n'+
				    '<hr width="100%" size="1"><\/form><\/body><\/html>\n';
	      var win = open('',id,params);
		  win.document.write(msg);
		  win.document.close();
	 return false;
}
