function fnLoadExternalLinksInNewWindow() {
   if (!document.getElementsByTagName) return;
   var arrAnchors = document.getElementsByTagName("a");
   for (var i=0; i < arrAnchors.length; i++) {
      var objAnchor = arrAnchors[i];
      if (objAnchor.getAttribute("href") && objAnchor.getAttribute("rel") == "external") {
         objAnchor.target = "_blank";
         if (objAnchor.getAttribute("href").indexOf('http:\/\/') != -1 && objAnchor.getAttribute("href").indexOf('smartdealerproducts.com') == -1 && objAnchor.getAttribute("href").indexOf('smartmenucomplete.com') == -1 && objAnchor.getAttribute("href").indexOf('iasdirect.com') == -1) {
            objAnchor.href = '/company/redir.asp?Link='+objAnchor.getAttribute("href");
         }
      }
   }
}
window.onload = fnLoadExternalLinksInNewWindow;

function fnNewWindow(strURL,strTitle,strMods) {
   var strNewWindow=window.open(strURL,strTitle,strMods);
}
function fnShowVideo() {
   var strNewWindow=window.open("","ShowVideo",'top=25,left=25,scrollbars=no,height=370,width=340');
   strNewWindow.document.open("text/html","replace");
   strNewWindow.document.writeln('<html>');
   strNewWindow.document.writeln('<head>');
   strNewWindow.document.writeln('<link rel="stylesheet" type="text/css" href="/theme/text.css">');
   strNewWindow.document.writeln('<script language="javascript">');
   strNewWindow.document.writeln('<!-'+'-');
   strNewWindow.document.writeln('function closeWindow() {this.window.close();}');
   strNewWindow.document.writeln('-'+'->');
   strNewWindow.document.writeln('</script>');
   strNewWindow.document.writeln('<title>Sample SmartEye Video</title>');
   strNewWindow.document.writeln('</head>');
   strNewWindow.document.writeln('<body background="/images/bg.gif" style="margin: 10px">');
   strNewWindow.document.writeln('<div class="centerblock">');
   strNewWindow.document.writeln('   <object');
   strNewWindow.document.writeln('   id="player"');
   strNewWindow.document.writeln('   CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"');
   strNewWindow.document.writeln('   STANDBY="Loading Microsoft Windows Media Player..."');
   strNewWindow.document.writeln('   CODEBASE="https://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"');
   strNewWindow.document.writeln('   TYPE="application/x-oleobject"');
   strNewWindow.document.writeln('   WIDTH="320"');
   strNewWindow.document.writeln('   HEIGHT="310"');
   strNewWindow.document.writeln('   STYLE="border: 1px #111111 solid">');
   strNewWindow.document.writeln('      <PARAM NAME="url" VALUE="mms://storage.mysmarteye.com/SmartEyeSampleVideo/SmartEyeSampleVideo.WMV">');
   strNewWindow.document.writeln('      <PARAM NAME="filename" VALUE="mms://storage.mysmarteye.com/SmartEyeSampleVideo/SmartEyeSampleVideo.WMV">');
   strNewWindow.document.writeln('      <PARAM NAME="animationAtStart" VALUE="true" />');
   strNewWindow.document.writeln('      <PARAM NAME="transparentAtStart" VALUE="true" />');
   strNewWindow.document.writeln('      <PARAM NAME="autoStart" VALUE="true" />');
   strNewWindow.document.writeln('      <PARAM NAME="autoSize" VALUE="false" />');
   strNewWindow.document.writeln('      <PARAM NAME="showControls" VALUE="true" />');
   strNewWindow.document.writeln('      <PARAM NAME="showStatusBar" VALUE="true" />');
   strNewWindow.document.writeln('      <embed STYLE="height: 310; width: 320; border: 1px #111111 solid"');
   strNewWindow.document.writeln('         TYPE="application/x-mplayer2"');
   strNewWindow.document.writeln('         PLUGINSPAGE="http://www.microsoft.com/Windows/MediaPlayer/"');
   strNewWindow.document.writeln('         SRC="mms://storage.mysmarteye.com/SmartEyeSampleVideo/SmartEyeSampleVideo.WMV"');
   strNewWindow.document.writeln('         ALIGN="middle"');
   strNewWindow.document.writeln('         WIDTH="320"');
   strNewWindow.document.writeln('         HEIGHT="310"');
   strNewWindow.document.writeln('         SHOWSTATUSBAR="1">');
   strNewWindow.document.writeln('      </embed>');
   strNewWindow.document.writeln('   </object>');
   strNewWindow.document.writeln('</div>');
   strNewWindow.document.writeln('<p align="center"><a href="javascript:closeWindow()">Close this window</a></p>');
   strNewWindow.document.writeln('</body>');
   strNewWindow.document.writeln('</html>');
   strNewWindow.document.close();
}
function popupWindow(file) {
   var strNewWindow=window.open("","OnlineDemo",'top=25,left=25,scrollbars=no,height=545,width=795');
   strNewWindow.document.open("text/html","replace");
   strNewWindow.document.writeln('<html>');
   strNewWindow.document.writeln('<head>');
   strNewWindow.document.writeln('<link rel="stylesheet" type="text/css" href="/theme/text.css">');
   strNewWindow.document.writeln('<script language="javascript">');
   strNewWindow.document.writeln('<!-'+'-');
   strNewWindow.document.writeln('function closeWindow() {this.window.close();}');
   strNewWindow.document.writeln('-'+'->');
   strNewWindow.document.writeln('</script>');
   strNewWindow.document.writeln('<title>Online Demonstration</title>');
   strNewWindow.document.writeln('</head>');
   strNewWindow.document.writeln('<body background="/images/bg.gif" style="margin: 10px">');
   strNewWindow.document.writeln('<table border="0" width="100%" cellpadding="0" cellspacing="0">');
   strNewWindow.document.writeln('  <tr>');
   strNewWindow.document.writeln('    <td align="center">');
   strNewWindow.document.writeln('      <table border="1" style="border: 1px solid #2E4A72; border-spacing: 0pt; border-collapse: collapse" height="474" width="770" style="border-collapse: collapse; border-spacing: 0px;" cellpadding="0" cellspacing="0">');
   strNewWindow.document.writeln('        <tr>');
   strNewWindow.document.writeln('          <td bgcolor="#FFFFFF">');
   strNewWindow.document.writeln('          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="770" height="474">');
   strNewWindow.document.writeln('            <param name="movie" value="/products/product_intros/'+file+'.swf">');
   strNewWindow.document.writeln('            <param name="quality" value="high">');
   strNewWindow.document.writeln('            <param name="LOOP" value="false">');
   strNewWindow.document.writeln('            <param name="WMode" value="Transparent"><param name="SCALE" value="exactfit">');
   strNewWindow.document.writeln('            <embed src="/products/product_intros/'+file+'.swf" width="770" height="474" loop="false" alt="Online Demonstration" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="exactfit"></embed>');
   strNewWindow.document.writeln('          </object>');
   strNewWindow.document.writeln('          </td>');
   strNewWindow.document.writeln('        </tr>');
   strNewWindow.document.writeln('      </table>');
   strNewWindow.document.writeln('    </td>');
   strNewWindow.document.writeln('  </tr>');
   strNewWindow.document.writeln('</table>');
   strNewWindow.document.writeln('<p align="center"><a href="javascript:closeWindow()">Close this window.</a></p>');
   strNewWindow.document.writeln('</body>');
   strNewWindow.document.writeln('</html>');
   strNewWindow.document.close();
}
function largeImageDisplay(img,H,W) {
   var strNewWindow=window.open("","LargeImageDisplay",'top=25,left=25,scrollbars=no,height='+H+',width='+W);
   strNewWindow.document.open("text/html","replace");
   strNewWindow.document.writeln('<html>');
   strNewWindow.document.writeln('<head>');
   strNewWindow.document.writeln('<link rel="stylesheet" type="text/css" href="/theme/text.css">');
   strNewWindow.document.writeln('<script language="javascript">');
   strNewWindow.document.writeln('<!-'+'-');
   strNewWindow.document.writeln('function closeWindow() {this.window.close();}');
   strNewWindow.document.writeln('-'+'->');
   strNewWindow.document.writeln('</script>');
   strNewWindow.document.writeln('<title>Display Large Image</title>');
   strNewWindow.document.writeln('</head>');
   strNewWindow.document.writeln('<body background="/images/bg.gif" style="margin: 10px">');
   strNewWindow.document.writeln('<table border="0" width="100%" cellpadding="0" cellspacing="0">');
   strNewWindow.document.writeln('  <tr>');
   strNewWindow.document.writeln('    <td align="center">');
   strNewWindow.document.writeln('      <img src="'+img+'">');
   strNewWindow.document.writeln('    </td>');
   strNewWindow.document.writeln('  </tr>');
   strNewWindow.document.writeln('</table>');
   strNewWindow.document.writeln('<p align="center"><a href="javascript:closeWindow()">Close this window</a></p>');
   strNewWindow.document.writeln('</body>');
   strNewWindow.document.writeln('</html>');
   strNewWindow.document.close();
}
function MM_preloadImages() { //v3.0
   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
      var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
   }

   function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
   }

   function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
      d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
   }

   function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
      if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
   }
   function printit(){
      if (window.print) {window.print();}
      else {
         var WebBrowser='<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
         document.body.insertAdjacentHTML('beforeEnd',WebBrowser);
         WebBrowser1.ExecWB(6, 2);
      }
      var intSW=screen.availWidth/2-250;
   }
