function addToCart() {
  cart_quantity.submit();
}

function enlargePicture(img,width,height,titleTxt) {
  pic = window.open('', 'picWindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+(width+10)+',height='+(height+10)+',screenX=150,screenY=150,top=150,left=150');
  pic.document.write('<html><head><title>'+titleTxt+'</title></head><body>\n');
  pic.document.write('<img src="'+img+'" border="0" alt="'+titleTxt+'" \n');
  pic.document.write('  title=" '+titleTxt+' " width="'+width+'" height="'+height+'"/><br/>\n');
  pic.document.write('</body></html>\n');
  pic.document.close() 
}

function writePopupCode(imgSm,widthSm,heightSm,imgLg,widthLg,heightLg,titleTxt,tableParam) {
  tableParam = typeof tableParam != 'undefined'? tableParam : 'align="right"';
  document.write('<table class="smallText" '+tableParam+'><tr><td align="center">');
  document.write('  <a href="javascript:enlargePicture(\''+imgLg+'\','+widthLg+','+heightLg+',\''+titleTxt+'\')">');
  document.write('    <img src="'+imgSm+'" border="0" alt="'+titleTxt+'" title=" '+titleTxt+' "');
  document.write('      width="'+widthSm+'" height="'+heightSm+'" hspace="5" vspace="5"><br/>');
  document.write('    Click to enlarge</a>');
  document.write('</td></tr></table>');
}

//function writeVideoIframeCode(heightFrame,video,widthVid,heightVid,image,widthImg,heightImg) {
//  writeVideoIframeCode(heightFrame,video,widthVid,heightVid,image,widthImg,heightImg,'');
//}
function writeVideoIframeCode(heightFrame,video,widthVid,heightVid,image,widthImg,heightImg,scriptParam) {
  scriptParam = typeof scriptParam != 'undefined'? scriptParam : '';
  document.write('<table style="padding-left:10px;" align="right" border="0" cellpadding="0" cellspacing="0"><tr><td>');
  document.write('<table style="border: solid 1px #cccccc;" cellpadding="3" cellspacing="0"><tr><td>');
  document.write('<iframe src="/inline-video.php?first&img='+image+'&iw='+widthImg+'&ih='+heightImg+'&vid='+video+'&vw='+widthVid+'&vh='+heightVid+''+scriptParam+'" width="'+widthVid+'" height="'+(heightFrame+15)+'" border="0"');
  document.write('        scrolling="no" marginheight="0" marginwidth="0" frameborder="0">');
  document.write('  <img src="'+image+'" border="0" width="'+widthImg+'" height="'+heightImg+'">'); 
  document.write('  <p style="font-size:x-small">');
  document.write('    Having trouble seeing the video? Download the demo via the links');
  document.write('    below (simply right click the link then &quot;<strong>Save Target');
  document.write('    As</strong>&quot; or &quot;<strong>Download Linked');
  document.write('    File</strong>&quot; to your hard drive):');
  document.write('  </p>');
  document.write('  <p>');
  document.write('    Windows Media: <a href="'+video+'.wmv"><img src="images/i_wmv.gif" width="20" height="16" border="0">Demo Video.wmv</a><br/>');
  document.write('    Quicktime/iTunes: <a href="'+video+'.m4v"><img src="images/i_qt.gif" width="16" height="16" border="0">Demo Video.m4v</a>');
  document.write('  </p>');
  document.write('</iframe>');
  document.write('</td></tr></table>');
  document.write('</td></tr></table>');
}

