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 bgColorChange(id, bgcolor)
{
  id.style.backgroundColor = bgcolor;
}

function backgroundChange(id, imageName)
{
  id.style.backgroundImage = imageName;
}

function newsletter()
{
  win = window.open("mail.htm","mail","width=400,height=177,left=200,top=200,statusbar=no,toolbar=no,scrollbars=no,navbar=no");
  win.focus();
}

function contact()
{
  win = window.open("contactform.htm","contactus","width=553,height=300,left=200,top=200,statusbar=no,toolbar=no,navbar=no");
  win.focus();
}

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 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 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 showBinder()
{
  win = window.open("flipbinder/binder.htm","binder","width=760,height=476,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function fmailform()
{
  window.open("flipbinder/sfmail.htm","fmailfrm","width=400,height=265,left=120,top=120,statusbar=no,toolbar=no,scrollbars=no,navbar=no");
}  

function showBelgardCatalog()
{
  win = window.open("flipbinder/binder.htm","bindercatalog","width=760,height=476,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function sendCatalog()
{
  win = window.open("sendcatalog.htm","sendcatalogcvbs","width=410,height=255,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}



function sendCatalog2()
{
  win = window.open("flipbinder/sfmail.htm","fmailfrm","width=400,height=250,left=120,top=120,statusbar=no,toolbar=no,scrollbars=no,navbar=no");
  win.focus();
}


function showImage(id, src)
{
  if (document.all)
	document.all[id].src = src;
  else if (document.getElementById)
	document.getElementById(id).src = src;
}

function showMessage(id, text)
{
  if (document.all)
	document.all[id].innerHTML = text;
  else if (document.getElementById)
	document.getElementById(id).innerHTML = text;
}

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();
}

 var message = 
    "   For More Information About Us   " + String.fromCharCode(13,10)
  + " Call 800 741-2861 or Visit Us at: " + String.fromCharCode(13,10)
  + "      www.clearimaging.com         " + String.fromCharCode(13,10)
  + "   All Source Code Copyrighted     " + String.fromCharCode(13,10)
  + "    by Clearimaging.com © 2003     ";
  
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");
