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 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("&"+name, str.indexOf(name)+name.length)!=-1)
        res = str.substring(str.indexOf("&"+name)+name.length+1, str.indexOf("&"+name))
             else
        res = str.substring(str.indexOf(name)+name.length+1, str.length);
      if (res.indexOf("&")!=-1)
        res = res.substring(0,res.indexOf("&"));
           }
  }
  return res;
}

function showImagePopup(scriptName,section,ind,width,height) {
  width = (width>750)?750:width;
  height = (height>500)?500:height;
  width+=50;
  height+=100;
  width = (width<350)?350:width;
  height = (height<200)?200:height;
  win = window.open('big_image.htm?script='+scriptName+'&section='+section
        +'&ind='+ind,'_blank','width='+width+',height='
        +height+',left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no');
  win.focus();
}

function privacy() {
 popup('privacy_policy.htm');
}

function terms() {
 popup('legal_notice.htm');
}

function popup(adresa){
  var w=550 , h=400;
  var l=(screen.availWidth-w)/2 , t=(screen.availHeight-h)/2;
  win=window.open(adresa,"_blank","width="+w+",height="+h+",left="+l+",top="+t+",statusbar=no,toolbar=no,scrollbars=yes,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 showImage(id, src)
{
  if (ie)
        document.all[id].src = src;
  else if (ns)
        document.getElementById(id).src = src;
}

function showMessage(id, text)
{
  if(ie)
        document.all[id].innerHTML = text;
  else if (ns)
        document.getElementById(id).innerHTML = text;
}

function viewCatalog()
{
//  win = window.open("http://www.flipbinder.com/stepflip/bindermini.htm","_blank","width=627,height=406,left=17,top=17,statusbar=no,toolbar=no,scrollbars=never,navbar=no");
  win = window.open("http://65.109.161.9/stepstone/brochure1/bindermini.htm","brochure1mini","width=637,height=402,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

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 shapes()
{
  win = window.open('shapes.htm','shapes','scrollbars,top=17,left=17,width=550,height=380');
  win.focus();
}

function glossary()
{
  win = window.open('glossary.htm','Glossary','scrollbars,top=17,left=17,width=550,height=380');
  win.focus();
}

function requestinfo()
{
  win = window.open('requestinfo.htm','_blank','scrollbars,top=17,left=17,width=550,height=600');
  win.focus();
}

function details1() //wall caps
{
  win = window.open("http://65.109.161.9/stepstone/details1/bindermini.htm","stepstoneprecastdetails1","width=648,height=402,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function details2() //roof
{
  win = window.open("http://65.109.161.9/stepstone/details2/bindermini.htm","stepstoneprecastdetails2","width=641,height=402,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function details3() //dekstone
{
  win = window.open("http://65.109.161.9/stepstone/details3/bindermini.htm","stepstoneprecastdetails3","width=641,height=402,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function details4()
{
  win = window.open("http://65.109.161.9/stepstone/details4/bindermini.htm","stepstoneprecastdetails4","width=641,height=402,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function details5()
{
  win = window.open("http://65.109.161.9/stepstone/details5/bindermini.htm","stepstoneprecastdetails5","width=641,height=402,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function details6()
{
  win = window.open("http://65.109.161.9/stepstone/details6/bindermini.htm","stepstoneprecastdetails6","width=641,height=402,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function specDetails() {
  win = window.open("http://www.stepstoneinc.com/spec/index.php","stepstone_specsdetails","width=250,height=150,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function brochureDeckstone() {
  var win = window.open("brochure_deckstone/bindermini.htm","_blank","width=645,height=402,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

function catalogDekstoneDetails() {
  win = window.open("http://www.clearimaging.com/cms/catalogs/dekstone_details1/index.php?signature=dekstone","_blank","width=250,height=150,left=17,top=17,statusbar=no,toolbar=no,scrollbars=never,navbar=no");
  win.focus();
}

function catalogDekstone1() {
  win = window.open("http://www.clearimaging.com/cms/catalogs/dekstone_details2/index.php?signature=dekstone","_blank","width=250,height=150,left=17,top=17,statusbar=no,toolbar=no,scrollbars=never,navbar=no");
  win.focus();
}

function catalogDekstone2() {
  win = window.open("http://www.clearimaging.com/cms/catalogs/dekstone_details3/index.php?signature=dekstone","_blank","width=250,height=150,left=17,top=17,statusbar=no,toolbar=no,scrollbars=never,navbar=no");
  win.focus();
}

function catalogDekstoneColorInstructions() {
  win = window.open("http://www.clearimaging.com/cms/catalogs/dekstone_color_instruction/index.php?signature=dekstone","_blank","width=250,height=150,left=17,top=17,statusbar=no,toolbar=no,scrollbars=never,navbar=no");
  win.focus();
}

function catalogDekstoneColorInstructions2() {
  win = window.open("http://www.clearimaging.com/cms/catalogs/dekstone_color_instruction2/index.php?signature=dekstone","_blank","width=250,height=150,left=17,top=17,statusbar=no,toolbar=no,scrollbars=never,navbar=no");
  win.focus();
}

function profile(url)
{
  win = window.open("profile.htm?"+url,"stepstoneprecastprofile","width=610,height=403,left=17,top=17,statusbar=no,toolbar=no,scrollbars= never,navbar=no");
  win.focus();
}

var message = 
':. For the Company Contact Information,' + String.fromCharCode(13,10)+
'   please click on the <Contact Us> site link.' + String.fromCharCode(13,10)+
':. For Website and Technical Support,' + String.fromCharCode(13,10)+
'   visit us at: www.clearimaging.com' + String.fromCharCode(13,10)+
':. Website Source Code Copyrighted by' + String.fromCharCode(13,10)+
'    Clear Imaging '+(new Date()).getFullYear();

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");
