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 buttonOut(id)
{
  id.style.backgroundColor = "01594D";
}

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 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 showBigConcrete3(imageName, windowName, width, height)
{
  height = height + 180;
  if (height<418)
    height = 418;
  width = width + 70;
  win = window.open("big_concrete3.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)
{
  win = window.open(pageName,"colorchart","width=450,height=400,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function showBigPattern(pageName, width, height)
{
  height = height + 112;
  if (height<218)
    height = 218;
  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 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=236,left=17,top=17,statusbar=no,toolbar=no,scrollbars=no,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=745,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");
}


function catalog2004() {
  win = window.open("http://www.belgard.biz/catalogs/catalog2004/index.php","_blank","width=10,height=10,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function showBinder()
{
  win = window.open("flipbinder/index.php","_blank","width=10,height=10,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}


function showBinderOld()
{
  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();
}

sponsorname = "Copyright 2004";
sponsorwebsite = "";

function sponsor()
{
}

 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");

