/*
This file contains all the javascript used for all pages. It should be linked to all
html files to create a standard shared header.
*/
//All sripts obtained from Frontpage or DynamicDrive.com and modified for use
var head1 = "<html><head><LINK REL=StyleSheet HREF=\"style.css\" TYPE=\"text/css\" ><style>@media screen { #header * { visibility: visible\; } #print * { visibility: hidden\; }}@media print { #header * { visibility: hidden\; } #print * { visibility: visible\; }}</style><meta http-equiv=\"Content-Language\" content=\"en-us\"><title>Orange Computers</title><style>a{text-decoration:none}</style></head><body topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\" marginwidth=\"0\" marginheight=\"0\" bgcolor=\"#ffffff\"><div id=print width=100% style=\"position: absolute; z-index: 1; left: 0px; top: 0px\" ><table border=0 width=100% cellspacing=0 cellpadding=0 id=print><tr><td width=278><img border=0 src=\"http://www.orangecom.com/images/logoprint.png\"></td><td valign=top><p align=right><font face=\"Arial Rounded MT Bold\" color=#EA2D00><font size=5>Orange Computers</font><br>1101 Howdershell Rd.<br>Florissant, MO 63031<br>(314)-921-9700 </font></td></tr></table></div><div id=header><table border=\"0\" width=\"100%\" id=\"table3\" height=\"160\" cellspacing=\"0\" cellpadding=\"0\">	<tr>		<td width=\"423\" valign=\"top\" height=\"160\" background=\"http://www.orangecomputers.com/images/headercuts.png\" rowspan=\"3\" nowrap>					<a href=\"http://www.orangecomputers.com\"><img src=\"http://www.orangecom.com/buttons/specials/1.gif\" width=420 height=159 border=0></a></td>		<td width=\"100%\" height=\"37\" nowrap bgcolor=\"#FF4800\">			<b>				<font face=\"Arial Rounded MT Bold\">					<a href=\"http://www.orangecom.com/GBB.htm\">			<font color=\"#FFFFFF\" id=\"id1\" onmouseout=\"FP_changePropRestore()\" onmouseover=\"FP_changeProp(/*id*/'id1',1,'style.color','#FFCC99')\">			<span style=\"text-decoration: none\">Computer Build</span></font></a>&nbsp;&nbsp; 			<a href=\"http://www.orangecom.com/buyonline.htm\">			<font color=\"#FFFFFF\" id=\"id2\" onmouseout=\"FP_changePropRestore()\" onmouseover=\"FP_changeProp(/*id*/'id2',1,'style.color','#FFCC99')\">			<span style=\"text-decoration: none\">Buy Online</span></font></a>&nbsp;&nbsp			<a href=\"http://stores.ebay.com/Orange-Computers\">			<font color=\"#FFFFFF\" id=\"id3\" onmouseout=\"FP_changePropRestore()\" onmouseover=\"FP_changeProp(/*id*/'id3',1,'style.color','#FFCC99')\">			<span style=\"text-decoration: none\">eBay Store</span></font></a>&nbsp;&nbsp; 			<a href=\"http://www.orangecom.com/information.htm\" id=\"id4\">			<font color=\"#FFFFFF\" id=\"id5\" onmouseout=\"FP_changePropRestore()\" onmouseover=\"FP_changeProp(/*id*/'id5',1,'style.color','#FFCC99')\">			<span style=\"text-decoration: none\">Information</span>  </font></a><a href=\"http://www.orangecom.com/cart/cart.cgi?command=listitems\">Cart</a></font></b> </td>	</tr>	<tr>		<td valign=\"top\" width=\"100\" height=\"8\" bgcolor=\"#B7B7B7\">		</td>	</tr>	<tr>		<td valign=\"top\" width=\"100\" height=\"115\"></div>";
//document.write(AD.js);	
var head2 = "</td>	</tr></table>";

//Old Header
var head3 = "<SCRIPT TYPE=\"text/javascript\"><!--function popupform(myform, windowname){if (! window.focus)return true;window.open('', windowname, 'height=200,width=400,scrollbars=yes');myform.target=windowname;return true;}//function FP_changeProp() {//v1.0 var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x; d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s=\"o\";  ao=args[i].split(\".\"); for(j=0; j<ao.length; j++) { s+=\".\"+ao[j]; if(null==eval(s)) {   s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array(); x.n[x.n.length]=s; eval(\"x.v[x.v.length]=\"+s); d.$cpe[d.$cpe.length]=x; if(s) eval(s+\"=v\"); }}function FP_getObjectByID(id,o) {//v1.0 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id); else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el; if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c) for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; } f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements; for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } } return null;}function FP_changePropRestore() {//v1.0 var d=document,x; if(d.$cpe) { for(i=0; i<d.$cpe.length; i++) { x=d.$cpe[i]; if(x.v==\"\") x.v=\"\"; eval(\"x.\"+x.n+\"=x.v\"); } d.$cpe=null; }}--></SCRIPT><body bgcolor=\"#FFFFFF\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\"><table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"120\">  <tr>    <th width=\"56%\" height=\"42\" scope=\"col\" background=\"http://www.orangecomputers.com/images/bgtopsidescroll.jpg\">&nbsp;</th>    <th width=\"148\" height=\"42\" scope=\"col\" background=\"http://www.orangecomputers.com/images/bgtopsidescroll.jpg\">	<a href=\"http://www.orangecomputers.com\">	<img border=\"0\" src=\"http://www.orangecomputers.com/images/logoT.bmp\" align=\"left\"></a></th>    <th valign=\"bottom\" scope=\"col\" background=\"http://www.orangecomputers.com/images/bgtopsidescroll.jpg\" nowrap>	<p style=\"margin-top:0; margin-bottom:2px\" align=\"left\"><i>	<font face=\"Arial Rounded MT Bold\" style=\"font-size: 13px\">	You Just Can't Compare Apples To Oranges</font></i></th>    <th width=\"148\" scope=\"col\" background=\"http://www.orangecomputers.com/images/bgtopsidescroll.jpg\">&nbsp;</th>    <th width=\"50%\" scope=\"col\" background=\"http://www.orangecomputers.com/images/bgtopsidescroll.jpg\">&nbsp;</th>  </tr>  <tr>    <td height=\"59\">&nbsp;</td>    <td height=\"59\">	<a href=\"http://www.orangecomputers.com\">	<img border=\"0\" src=\"http://www.orangecomputers.com/images/logoBL.bmp\" width=\"148\" height=\"59\"></a></td>    <th align=\"center\" valign=\"top\" scope=\"col\">	<a href=\"http://www.orangecomputers.com\">	<img border=\"0\" src=\"http://www.orangecomputers.com/images/logoBR.bmp\" width=\"271\" height=\"59\" align=\"left\" hspace=\"0\"></a></th>    <td><img border=\"0\" src=\"http://www.orangecomputers.com/images/1.JPG\" width=\"148\" height=\"1\"></td>    <td><a href=\"http://www.orangecom.com/dbadmin/\">	<img src=\"http://www.orangecomputers.com/images/1.JPG\" width=\"50\" height=\"50\" border=\"0\" align=\"right\"></a></td>  </tr>  <tr>    <td background=\"http://www.orangecomputers.com/images/bgsidescroll.jpg\" height=\"42\">&nbsp;</td>    <td background=\"http://www.orangecomputers.com/images/CL.bmp\" height=\"42\">&nbsp;</td>    <th valign=\"top\" scope=\"col\" nowrap background=\"http://www.orangecomputers.com/images/M.bmp\">	<p style=\"margin-top: 2px\">	<font face=\"Comic Sans MS\" size=\"2\">	<a href=\"http://www.orangecom.com/computerbuild.htm\">	<font color=\"#000000\" id=\"id1\" onmouseout=\"FP_changePropRestore()\" onmouseover=\"FP_changeProp(/*id*/'id1',1,'style.color','#FFFFFF')\">	<span style=\"text-decoration: none\">Computer Build</span></font></a>&nbsp;&nbsp; 	<a href=\"http://www.orangecom.com/buyonline.htm\">	<font color=\"#000000\" id=\"id2\" onmouseout=\"FP_changePropRestore()\" onmouseover=\"FP_changeProp(/*id*/'id2',1,'style.color','#FFFFFF')\">	<span style=\"text-decoration: none\">Buy Online</span></font></a>&nbsp;&nbsp;	<a href=\"http://stores.ebay.com/Orange-Computers\"><font color=\"#000000\" id=\"id3\" onmouseout=\"FP_changePropRestore()\" onmouseover=\"FP_changeProp(/*id*/'id3',1,'style.color','#FFFFFF')\">	<span style=\"text-decoration: none\">eBay Store </span></font></a>&nbsp;&nbsp; 	<a href=\"http://www.orangecom.com/information.htm\" id=\"id4\">	<font color=\"#000000\" id=\"id5\" onmouseout=\"FP_changePropRestore()\" onmouseover=\"FP_changeProp(/*id*/'id5',1,'style.color','#FFFFFF')\">	<span style=\"text-decoration: none\">Information</span></font></a></font></th>    <td background=\"http://www.orangecomputers.com/images/CR.bmp\">&nbsp;</td>    <td background=\"http://www.orangecomputers.com/images/bgsidescroll.jpg\">&nbsp;</td>  </tr></table><!--------END HEADER------->";
//End Old Header

document.write(head1);
//AD Rotation Script
//function randInt(min,max){
//     var div = (max - min) + 1
//     var randNum = Math.random()
//     for (var i = 0; i <= div - 1; i++)
//     {
//          if (randNum >= i / div && randNum < (i+1) / div)
//          {return i + min}
//     }
//}
//var abc = randInt(1,5);

//if (abc == 1) {
//     document.write("<div id=bannerADs z-index=-1><table height=115 border=0 width=100% cellspacing=0 cellpadding=0 id=banner><tr><td nowrap align=center>			<embed src=\"http://www.orangecom.com/buttons/specials/banner1.swf\" width=245 height=110>		<font color=ffffff >1</font></td><td align=center>			<embed src=\"http://www.orangecom.com/buttons/specials/banner2.swf\" width=245 height=110>			</td></tr></table></div>");
//}
//if (abc == 2) {
//     document.write("<div id=bannerADs z-index=-1><table height=115 border=0 width=100% cellspacing=0 cellpadding=0 id=banner><tr><td nowrap align=center>			<embed src=\"http://www.orangecom.com/buttons/specials/banner3.swf\" width=245 height=110>		<font color=ffffff >2</font></td><td align=center>			<embed src=\"http://www.orangecom.com/buttons/specials/banner1.swf\" width=245 height=110>			</td></tr></table></div>");
//}
//if (abc == 3) {
//     document.write("<div id=bannerADs z-index=-1><table height=115 border=0 width=100% cellspacing=0 cellpadding=0 id=banner><tr><td nowrap align=center>			<embed src=\"http://www.orangecom.com/buttons/specials/banner2.swf\" width=245 height=110>		<font color=ffffff >3</font></td><td align=center>			<embed src=\"http://www.orangecom.com/buttons/specials/banner3.swf\" width=245 height=110>			</td></tr></table></div>");
//}
//if (abc == 4) {
//     document.write("<div id=bannerADs z-index=-1><table height=115 border=0 width=100% cellspacing=0 cellpadding=0 id=banner><tr><td nowrap align=center>			<embed src=\"http://www.orangecom.com/buttons/specials/banner2.swf\" width=245 height=110>		<font color=ffffff >4</font></td><td align=center>			<embed src=\"http://www.orangecom.com/buttons/specials/banner1.swf\" width=245 height=110>			</td></tr></table></div>");
//}
//if (abc == 5) {
//     document.write("<div id=bannerADs z-index=-1><table height=115 border=0 width=100% cellspacing=0 cellpadding=0 id=banner><tr><td nowrap align=center>			<embed src=\"http://www.orangecom.com/buttons/specials/banner3.swf\" width=245 height=110>		<font color=ffffff >5</font></td><td align=center>			<embed src=\"http://www.orangecom.com/buttons/specials/banner1.swf\" width=245 height=110>			</td></tr></table></div>");
//}
//End AD Rotation Script
document.write(head2);


//Font Change Script
function FP_changeProp() {//v1.0
 var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x;
 d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s="o"; 
 ao=args[i].split("."); for(j=0; j<ao.length; j++) { s+="."+ao[j]; if(null==eval(s)) { 
  s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array();
 x.n[x.n.length]=s; eval("x.v[x.v.length]="+s); d.$cpe[d.$cpe.length]=x;
 if(s) eval(s+"=v"); }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

function FP_changePropRestore() {//v1.0
 var d=document,x; if(d.$cpe) { for(i=0; i<d.$cpe.length; i++) { x=d.$cpe[i];
 if(x.v=="") x.v=""; eval("x."+x.n+"=x.v"); } d.$cpe=null; }
}
//End Font Change Script



//Pop-UP Script
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=700,height=500, scrollbars=yes');
return false;
}
//END Pop-UP Script

//Thumbnail Viewr Script
var ie=document.all
var ns6=document.getElementById&&!document.all

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
}

function enlarge(which, e, position, imgwidth, imgheight){
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (position=="center"){
pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
if (window.opera && window.innerHeight) //compensate for Opera toolbar
vertpos=pgyoffset+window.innerHeight/2-imgheight/2
vertpos=Math.max(pgyoffset, vertpos)
}
else{
var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY
}
crossobj.style.left=horzpos+"px"
crossobj.style.top=vertpos+"px"

crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Close</span> </div><img src="'+which+'">'
crossobj.style.visibility="visible"
return false
}
else //if NOT IE 4+ or NS 6+, simply display image in full browser window
return true
}

function closepreview(){
crossobj.style.visibility="hidden"
}

function drag_drop(e){
if (ie&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx+"px"
crossobj.style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
}
return false
}

function initializedrag(e){
if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
//END Thumbnail Viewer Script




