// Common JavaScript functions

/////////////////////////////////////////////////////////////////////
function DisplayHeader()
{
    var pBody = new param;
    var pAuthor  = new param; 
    var pLink  = new param;
    GetQuote(pBody,pAuthor,pLink);
    DisplayHeaderQuote(pBody.getValue(), pAuthor.getValue() , pLink.getValue());
}

function param()
{
    this.array = new Array(1);
    this.setValue = function(v) { this.array[0] = v; }
    this.getValue = function()  { return this.array[0]; }
}

function DisplayHeaderQuote(sBody, sAuthor, sLink)
{
	
    document.open();
    document.writeln("<table border='0' width='100%' cellspacing='0' cellpadding='0' height='52' bgcolor='#FFFFFF' STYLE=\"background-image: url(\'images/g1.gif\');  \">");
    document.writeln("  <tr>");
    document.writeln("    <td width='160' height='66' valign='top' align='center' nowrap bgcolor='#FFFFFF'>");
    document.writeln("    <p style='text-indent: 0; margin: 0'>");
    document.writeln("    <a href='default.asp'><img border='0' src='images/4wiresNew.jpg' ></a></p>");
    document.writeln("    </td>");
    
    document.writeln("    <td align='right' valign='middle'>");
    document.writeln("    <table border='0' cellpadding='0' cellspacing='0' width='100%'>");
    document.writeln("      <tr>");
    document.writeln("        <td style='PADDING-RIGHT: 10px; ' vAlign='' align='right'>");
    document.writeln("        <table border='0' cellSpacing='0' cellPadding='0'>");
    document.writeln("            <tr>");
	
	
	if (sBody != "")
	{
		document.writeln("              <td>"); 
		if (sLink != "") document.writeln("<a href='" + sLink + "' class='sHeadLocator'>"); 
			document.writeln("              <font color=black>"); 
			document.writeln("              \"" + sBody + "\"<br>"); 
			document.writeln("              &nbsp;&nbsp;&nbsp;<i>- ");
			document.writeln(               sAuthor);
			document.writeln("              </i>");
		if (sLink != "") document.writeln("</a>"); 
		document.writeln("              </td>"); 
	}
	
    document.writeln("            </tr>");
    document.writeln("          </tbody>");
    document.writeln("        </table>");
    document.writeln("        </td>");
    document.writeln("      </tr>");
    document.writeln("      </tr>");
    document.writeln("    </table>");
    document.writeln("    </td>");
    document.writeln("  </tr>");
    document.writeln("</table>");
}

/////////////////////////////////////////////////////////////////////
function DisplayNavBar()
{
    document.open();
    document.writeln("<table border='0' width='100%' cellspacing='0' cellpadding='0'>");
    document.writeln("<tr>");
    document.writeln("<td background='images/bk1.gif'>");
    document.writeln("<div align='center'>");
    document.writeln("<center>");
    document.writeln("<script type='text/javascript' language='JavaScript1.2'>");
    
    document.writeln("<!--");
    document.writeln("stm_bm(['mainmenu',430,'','images/sp.gif',0,'','',1,0,0,0,50,1,0,0,'','',0],this);");
    document.writeln("stm_bp('p0',[0,4,0,0,3,0,15,0,100,'progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.20)',-2,'',-2,90,0,0,'#7f7f7f','#000000','images/bk1.gif',3,0,0,'#000000']);");
    document.writeln("stm_ai('p0i0',[6,16,'transparent','images/d2.gif',2,15,0]);");

//    document.writeln("stm_aix('p0i2','p0i0',[]);");
    document.writeln("stm_ai('p0i2',[0,'   Home    ','','',-1,-1,0,'default.asp','_self','','','','',0,0,0,'','',-1,-1,0,0,1,'#f0f0f0',1,'#f0f0f0',1,'','',0,3,0,0,'#ffffff','#ffffff','#333333','#cc0000','bold 8pt Verdana','bold 8pt Verdana',0,0]);");
//    document.writeln("stm_bp('p2',[1,4,-10,4,0,3,7,0,100,'',-2,'',-2,90,0,0,'#cccccc','transparent','',3,1,1,'#808080']);");
 document.writeln("stm_aix('p0i2','p0i0',[]);");
    document.writeln("stm_ep();");  
      
                                        
    document.writeln("stm_ai('p0i1',[0,'Products & Service','','',-1,-1,0,'','_self','','','','',0,0,0,'','',-1,-1,0,0,1,'#f0f0f0',1,'#f0f0f0',1,'','',0,3,0,0,'#ffffff','#ffffff','#333333','#cc0000','bold 8pt Verdana','bold 8pt Verdana',0,0]);");
    document.writeln("stm_bp('p1',[1,4,-10,4,0,3,7,0,100,'',-2,'',-2,90,0,0,'#cccccc','transparent','',3,1,1,'#808080']);");
    //document.writeln("stm_aix('p1i0', 'p0i1',[0,'Alarm Systems','','',-1,-1,0,'alarms.asp','_self','','','images/a1.gif','images/a1.gif',7,7,0,'','',0,0,0,0,1,'#f0f0f0',0,'#969696',0,'','',3,3,0,0,'#ffffff','#ffffff','#505050','#ffffff','11px Verdana','11px Verdana']);");
    document.writeln("stm_aix('p1i0', 'p0i1',[0,'Security Systems','','',-1,-1,0,'Security.asp','_self','','','images/a1.gif','images/a1.gif',7,7,0,'','',0,0,0,0,1,'#f0f0f0',0,'#969696',0,'','',3,3,0,0,'#ffffff','#ffffff','#505050','#ffffff','11px Verdana','11px Verdana']);");
    document.writeln("stm_aix('p1i1', 'p0i0',[6,1,'#cccccc','',-1,-1]);");
    document.writeln("stm_aix('p1i2', 'p1i0',[0,'Telephony','','',-1,-1,0,'telephony.asp']);");
    document.writeln("stm_aix('p1i3', 'p1i1',[]);");
    document.writeln("stm_aix('p1i4', 'p1i0',[0,'Data   ','','',-1,-1,0,'data.asp']);");
    document.writeln("stm_aix('p1i5', 'p1i1',[]);");
    document.writeln("stm_aix('p1i4', 'p1i0',[0,'Structure Wiring   ','','',-1,-1,0,'structure_wiring.asp']);");
    document.writeln("stm_aix('p1i5', 'p1i1',[]);");
    document.writeln("stm_aix('p1i4', 'p1i0',[0,'CCTV','','',-1,-1,0,'cctv.asp']);");
    document.writeln("stm_aix('p1i5', 'p1i1',[]);");
    document.writeln("stm_aix('p1i6', 'p1i0',[0,'VoIP Solutions     ','','',-1,-1,0,'voip.asp']);");
    document.writeln("stm_aix('p1i7', 'p1i1',[]);");
    //document.writeln("stm_aix('p1i8', 'p1i0',[0,'CCTV','','',-1,-1,0,'cctv.asp']);");
    //document.writeln("stm_aix('p1i9', 'p1i1',[]);");
    document.writeln("stm_aix('p1i10','p1i0',[0,'Home Theatres ','','',-1,-1,0,'hometheater.asp']);");
    document.writeln("stm_aix('p1i11','p1i1',[]);");
    document.writeln("stm_aix('p1i12','p1i0',[0,'Intercom Systems ','','',-1,-1,0,'intercom.asp']);");
    document.writeln("stm_ep();");

// request 11/30/06 VR
  //  document.writeln("stm_aix('p0i2','p0i0',[]);");
  //  document.writeln("stm_ai('p0i2',[0,'   Home    ','','',-1,-1,0,'default.asp','_self','','','','',0,0,0,'','',-1,-1,0,0,1,'#f0f0f0',1,'#f0f0f0',1,'','',0,3,0,0,'#ffffff','#ffffff','#333333','#cc0000','bold 8pt Verdana','bold 8pt Verdana',0,0]);");
  //  document.writeln("stm_bp('p2',[1,4,-10,4,0,3,7,0,100,'',-2,'',-2,90,0,0,'#cccccc','transparent','',3,1,1,'#808080']);");
   // document.writeln("stm_aix('p2i0','p0i1',[0,'Accessibility         ','','',-1,-1,0,'solutions_accessibility.asp','_self','','','images/a1.gif','images/a1.gif',7,7,0,'','',0,0,0,0,1,'#f0f0f0',0,'#969696',0,'','',3,3,0,0,'#ffffff','#ffffff','#505050','#ffffff','11px Verdana','11px Verdana']);");
   // document.writeln("stm_ep();");


//   document.writeln("stm_aix('p0i3','p0i1',[0,'   Download    ','','',-1,-1,0,'default.asp']);");
//   document.writeln("stm_bpx('p2','p1',[1,4,-10,4,0,3,7,7]);");
//   document.writeln("stm_aix('p2i1','p1i0',[0,'Remote Viewer','','',-1,-1,0,'downloads/remoteviewer.exe']);");
//   document.writeln("stm_aix('p2i2','p1i1',[]);");
//   document.writeln("stm_aix('p2i3','p1i0',[0,'VTGO for PocketPC   ','','',-1,-1,0,'download.asp?product=vtgo_ppc']);");
//   document.writeln("stm_aix('p2i4','p1i1',[]);");
//   document.writeln("stm_aix('p2i5','p1i0',[0,'VTALL','','',-1,-1,0,'download.asp?product=vtall']);");
//   document.writeln("stm_ep();");

    document.writeln("stm_aix('p0i2','p0i0',[]);");
	document.writeln("stm_aix('p0i3','p0i1',[0,'   Store    ','','',-1,-1,0,'http://shop.4wires.com/main.sc']);");
    document.writeln("stm_bpx('p2','p1',[1,4,-10,4,0,3,7,7]);");
    //document.writeln("stm_aix('p2i1','p1i0',[0,'Purchase 4Wires.com products','','',-1,-1,0,'store_menu.asp']);");
    document.writeln("stm_ep();");
    

	document.writeln("stm_aix('p0i6','p0i0',[]);");
    document.writeln("stm_aix('p0i7','p0i1',[0,'    Support    ','','',-1,-1,0,'support_request.asp']);");
    document.writeln("stm_bpx('p5','p1',[]);");
   document.writeln("stm_aix('p5i2','p1i0',[0,'Glossary','','',-1,-1,0,'support_glossary.asp']);");
//    document.writeln("stm_bpx('p3','p1',[1,4,177,-20]);");
//	document.writeln("stm_aix('p3i0','p1i0',[0,'CCTV','','',-1,-1,0,'support_faq.asp?product=vtgo']);");
//	document.writeln("stm_aix('p3i1','p1i1',[]);");
//	document.writeln("stm_aix('p3i2','p1i0',[0,'DVR  ','','',-1,-1,0,'support_faq.asp?product=vtgo_ppc']);");
//	document.writeln("stm_aix('p3i3','p1i1',[]);");
//	document.writeln("stm_aix('p3i4','p1i0',[0,'Voice recorders','','',-1,-1,0,'support_faq.asp?product=vtall']);");
//	document.writeln("stm_ep();");

    
    document.writeln("stm_aix('p5i3','p1i1',[]);");
    document.writeln("stm_aix('p5i4','p1i0',[0,'Knowledge Base','','',-1,-1,0,'tech_quest.asp']);");
    document.writeln("stm_aix('p5i5','p1i1',[]);");
    document.writeln("stm_aix('p5i5','p1i0',[0,'Technical Support Request ','','',-1,-1,0,'support_request.asp']);");
    document.writeln("stm_aix('p5i1','p1i1',[]);");
    //document.writeln("stm_aix('p5i6','p1i0',[0,'Remote Assistance','','',-1,-1,0,'support_remote_assistance.asp']);");
    document.writeln("stm_ep();");
    
    //downloads
     document.writeln("stm_aix('p0i9','p0i1',[0,'    Downloads   ','','',-1,-1,0,'downloads.asp']);");
    
//    document.writeln("stm_aix('p0i8','p0i0',[]);");
//    document.writeln("stm_aix('p0i9','p0i1',[0,'    Undefined section    ','','',-1,-1,0,'reseller_opportunities.asp']);");
//    document.writeln("stm_bpx('p6','p1',[]);");
//    document.writeln("stm_aix('p6i0','p1i0',[0,'Reseller Opportunities   ','','',-1,-1,0,'reseller_opportunities.asp']);");
//    document.writeln("stm_aix('p6i1','p1i1',[]);");
//    document.writeln("stm_aix('p6i0','p1i0',[0,'Request Reseller Application  ','','',-1,-1,0,'reseller_application.asp']);");
//    document.writeln("stm_aix('p6i2','p1i1',[]);");
//    document.writeln("stm_aix('p6i0','p1i0',[0,'Reseller Resources  ','','',-1,-1,0,'reseller_resources.asp']);");
//    document.writeln("stm_aix('p6i3','p1i1',[]);");
//    document.writeln("stm_aix('p6i0','p1i0',[0,'License Management  ','','',-1,-1,0,'license_main.asp']);");
    document.writeln("stm_ep();");
//    
    document.writeln("stm_aix('p0i10','p0i0',[]);");
    document.writeln("stm_aix('p0i11','p0i1',[0,'   Company    ','','',-1,-1,0,'company_contact.asp']);");
    document.writeln("stm_bpx('p7','p1',[]);");
    document.writeln("stm_aix('p7i0','p1i0',[0,' About 4Wires.com    ','','',-1,-1,0,'company_about.asp']);");
    document.writeln("stm_aix('p7i1','p1i1',[]);");
    document.writeln("stm_aix('p7i2','p5i4',[0,' Contact Us   ','','',-1,-1,0,'company_contact.asp']);");
    document.writeln("stm_aix('p7i3','p1i1',[]);");
    document.writeln("stm_aix('p7i4','p1i0',[0,' Partners   ','','',-1,-1,0,'company_partners.asp']);");
    document.writeln("stm_aix('p7i5','p1i1',[]);");
    document.writeln("stm_aix('p7i6','p1i0',[0,' Our Clients ','','',-1,-1,0,'company_clients.asp']);");
    document.writeln("stm_ep();");

    document.writeln("stm_aix('p0i2','p0i0',[]);");
    
    //document.writeln("stm_aix('p0i12','p0i0',[]);");
    
    //---
    //---
    document.writeln("stm_ep();");
    document.writeln("stm_em();");
    document.writeln("//-->");
    document.writeln("</script>");
    document.writeln("</center>");
    document.writeln("</div>");
    document.writeln("</td>");
    document.writeln("</tr>");
    document.writeln("</table>");

}


/////////////////////////////////////////////////////////////////////
function DisplayNavShade()
{
    document.open();
    document.writeln("<table border='0' width='100%' cellspacing='0' cellpadding='0'>");
    document.writeln("  <tr>");
    document.writeln("    <td WIDTH='100%' background='images/s1.gif'>");
    //document.writeln("    <img SRC='images/search.gif'  ALT BORDER='0'></td>");
    document.writeln("    <img SRC='images/sp.gif' width='8' HEIGHT='8' ALT BORDER='0'></td>");
    document.writeln("  </tr>");
    document.writeln("</table>");
}





/////////////////////////////////////////////////////////////////////
function DisplayStatus()
{
    document.open();
    document.writeln("<table CELLPADDING='0' CELLSPACING='0' WIDTH='100%' BORDER='0'>");

    document.writeln("  <tr>");
    document.writeln("    <td bgcolor='#FCFCFC'><font size='1'>");
    document.writeln("    <img border='0' src='images/sp.gif' width='1' height='1'></font></td>");
    document.writeln("  </tr>");
    
    document.writeln("  <tr>");
    document.writeln("    <td align='center' VALIGN='BOTTOM' nowrap>");

    document.writeln("<div  style='height: 50px; width: 100%; background: url(images/gradient.jpg); color=#444444'>");
    document.writeln("<br>Copyright &copy; 2008 4Wires.com. All rights reserved.<br><br>");
    document.writeln("<a href='site_map.asp'>Site Map</a>&nbsp;&nbsp;<a href='company_privacy.asp'>Privacy Policy</a>");
    document.writeln("</div><br><br>");


//    document.writeln("<div  style='height: 50px; width: 100%; background: url(images/gradient.jpg); color=#444444'><br>Copyright &copy; 2006 4Wires Software Solutions. All rights reserved.</div>");


    document.writeln("	</td>");
    document.writeln("  </tr>");
    document.writeln("</table>");
}

/////////////////////////////////////////////////////////////////////
function DisplayStatusShade()
{

    document.open();
    document.writeln("<table border='0' width='100%' cellspacing='0' cellpadding='0'>");
    document.writeln("  <tr>");
    document.writeln("    <td WIDTH='100%' background='images/s2.gif'><img SRC='images/sp.gif' width='8' HEIGHT='8' BORDER='0'></td>");
    document.writeln("  </tr>");
    document.writeln("</table>");


}

/////////////////////////////////////////////////////////////////////
function openPopup(url,x,y){
  if (!x){x=760;};
  if (!y){y=630;};
  window.open(url,null,'toolbar=yes,menubar=no,resizable=yes,scrollbars=yes,width='+x+',height='+y)
}

/////////////////////////////////////////////////////////////////////
function openPopupFixed(url,x,y){
  if (!x){x=760;};
  if (!y){y=630;};
  window.open(url,null,'toolbar=no,status=no,menubar=no,resizable=yes,scrollbars=no,width='+x+',height='+y)
}

//////////////////////////////////////////////////////////////////////

 function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }