var ns4 = (document.layers)? 1 : 0 ;
var ie = (document.all)? 1 : 0 ;
var usr = navigator.userAgent
var objns6 = (usr.indexOf('Netscape6')!=-1)? 1 : 0 ;
var ns = (document.getElementById)? 1 : 0 ;
var isMac = (navigator.userAgent.indexOf('Mac')!=-1) ;
var brsr = (navigator.appName.indexOf("Netscape")!=-1) ;
function buttonOver(id)
{
  id.style.backgroundColor = "FF0000";
}
function showTeeBinder(){
  win = window.open("techart/bindermini.htm","_techart_mini","width=559,height=407,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}
function buttonOut(id)
{
  id.style.backgroundColor = "01594D";
}
function bgColorChange(id, bgcolor)
{
  id.style.backgroundColor = bgcolor;
}
function backgroundChange(id, imageName)
{
  id.style.backgroundImage = imageName;
}
function getParameter(str, name)
{
  var res = "";
  if (str.indexOf("?")!=-1)
  {
    str = str.substring(str.indexOf("?")+1, str.length);
    if (str.indexOf(name)!=-1)
    {
      if (str.indexOf("&", str.indexOf(name)+name.length)!=-1)
        res = str.substring(str.indexOf(name)+name.length+1, str.indexOf("&"))
	  else
        res = str.substring(str.indexOf(name)+name.length+1, str.length);
	}
  }
  return res;
}
function showBig(imageName, windowName, width, height)
{
  win = window.open("big.htm?path="+imageName,windowName,"width="+Number(width+30)+",height="+Number(height+60)+",left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}
function showBigConcrete(imageName, windowName, width, height)
{
  height = height + 180;
  if (height<418)
    height = 418;
  width = width + 70;
  win = window.open("big_concrete2.htm?path="+imageName,windowName,"width="+Number(width)+",height="+Number(height)+",left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}
function showBigColorChart(imageName, windowName, width, height)
{
  height = height + 90;
  if (height<418)
    height = 418;
  width = width + 400;
  win = window.open("big_colorchart.htm?path="+imageName,windowName,"width="+Number(width)+",height="+Number(height)+",left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}
function showBigColor(pageName)
{
  width =  457;
  height = 348;
  height = height + 110;
  if (height<418)
    height = 418;
  width = width + 60;
  win = window.open(pageName,"colorchart","width="+Number(width)+",height="+Number(height)+",left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}
function showBigPattern(pageName, width, height)
{
  height = height + 112;
  if (height<418)
    height = 418;
  width = width + 60;
  win = window.open(pageName,"_blank","width="+Number(width)+",height="+Number(height)+",left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}
function showBigPortfolio(imageName)
{
  win = window.open("big_portfolio.htm?path="+imageName,"_portfolio","width=450,height=410,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}
function loadfocus()
{
  if ((navigator.appName== "Netscape" && parseInt(navigator.appVersion) >= 4)|| (navigator.appName.indexOf("Microsoft") != -1 && parseInt(navigator.appVersion) > 3))
    browserVer = '1';
  else
    browserVer = '2';
  if (browserVer == 1)
	window.focus();
  return true;
}
function newsletter()
{
  win = window.open("mail.htm","mail","width=400,height=195,left=17,top=17,statusbar=no,toolbar=no,scrollbars=no,navbar=no");
  win.focus();
}
function showBinder()
{
  win = window.open("flipbinder/bindermini.htm","newbindermini","width=664,height=410,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}
function showMessage(id, text)
{
  if(ie)
	document.all[id].innerText = text;
  else if (ns)
	document.getElementById(id).innerHTML = text;
  showElement(id);
}
function showElement(id)
{
  if(ie)
	document.all[id].style.visibility = "visible";
  else if (ns)
	document.getElementById(id).style.visibility = "visible";
}
function hideElement(id)
{
  if(ie)
	document.all[id].style.visibility = "hidden";
  else if (ns)
	document.getElementById(id).style.visibility = "hidden";
}
function showroom()
{
  win = window.open("showroom/index.htm","_blank","width=748,height=485,left=17,top=17,statusbar=no,toolbar=no,scrollbars=never,navbar=no");
  win.focus();
}
function freeQuote()
{
  win = window.open("freequotes.htm","freequotes","width=380,height=280,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}
function bigImage(img,width,height) {
  win = window.open("popup_image.htm?img="+img,"_blank","width="
   +Number(Number(width)+50)+",height="+Number(Number(height)+110)
   +",left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}
sponsorname = "Central Valley Builders Supply";
sponsorwebsite = "http://www.cvbs.com/";
function sponsor()
{
  win = window.open(sponsorwebsite,"_blank","width=710,height=490,left=17,top=17,statusbar=no,toolbar=no,scrollbars=never,navbar=no");
  win.focus();
}
 var message = 
    "   For More Information About Us  \n" 
  + " Call 800 741-2861 or Visit Us at: \n"
  + "      www.clearimaging.com         \n"
  + "   All Source Code Copyrighted     \n"
  + "    by Clearimaging.com Þ 2004     ";
  
function clickIE4(){
  if (event.button==2){
    alert(message);
    return false;
  }
}
function clickNS4(e){
  if (document.layers||document.getElementById&&!document.all){
    if (e.which==2||e.which==3){
      alert(message);
      return false;
    }
  }
}
if (document.layers){
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
  document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false");
