 /********************************************************************************************
 *Javascript source file                                                                     *
 *********************************************************************************************/
var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

//Fix for ns4
var origWidth, origHeight;
if (ns4) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

if (!document.layers&&!document.all)
event="test"
function showtip2(current,e,text){

if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'
//document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
//document.all.tooltip2.style.pixelTop= event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}

else if (document.layers){
document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function hidetip2(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"
}
}

function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150
}

function preloading(){
var HH_images = new Array();

 for (x=0; x>preloading.arguments.length; x++){
  HH_images[x] = new Image();
  HH_images[x].src = "images/" + preloading.arguments[x];
 }
  
}

 function showimg(imgname){
  var thisspn="";
	var thisimg="";
	if (imgname.length > 0 ){
    event.srcElement.src="images/btnbrdown.jpg";
    thisspn=event.srcElement.id.substr(3,2);
		thisimg=event.srcElement.id.substr(0,3);
		//idshowpic.innerHTML="<IMG src='" + "images/" + imgname + "'>";
    divshowimg.src="images/" + imgname ; 
    //alert(event.srcElement.id.substr(3,2))
    switch (thisspn){
      case "1":
        //spntitle.innerText="Model 1" 
        if (thisimg=='acc') {
				  spndesc.innerText="" 
		  	}else{
				  spndesc.innerText="A 36 inch firepit" 
        }
			break;
      case "2":
        //spntitle.innerText="Model 2" 
        if (thisimg=='acc') {
				  spndesc.innerText="" 
				}else{
				  spndesc.innerText="A 28 inch Firepit" 
        } 
			break;
      case "3":
        //spntitle.innerText="Model 3" 
        if (thisimg=='acc') {
				  spndesc.innerText="" 
				}else{
					spndesc.innerText="A 24 inch Firepit" 
        }
		  break;
      case "4":
        //spntitle.innerText="Model 4"
        if (thisimg=='acc') {
				  spndesc.innerText="" 
				}else{
				 spndesc.innerText="A 16 inch Firepit" 
        }
			break;
      case "5":
        //spntitle.innerText="Model 5" 
        if (thisimg=='acc') {
				  spndesc.innerText="" 
				}else{
				  spndesc.innerText="Firepit used as an ice cooler for cold drinks." 
        }
	    break;
			case "6":
			   if (thisimg=='acc') {
				  spndesc.innerText="" 
				}else{
				  spndesc.innerText="Firepit with protective cover." 
        }  
	    break;
			case "7":
			    if (thisimg=='acc') {
				  spndesc.innerText="" 
				}else{
				  spndesc.innerText="A 22'' Firepit with chimney." 
        }
	    break;
           	case "8":
			   if (thisimg=='acc') {
				  spndesc.innerText="" 
				}else{
				  spndesc.innerText="This is our model 8" 
        }  
	    break;
           	case "9":
			   if (thisimg=='acc') {
				  spndesc.innerText="" 
				}else{
				  spndesc.innerText="This is our model 9" 
        }  
	    break; 
           case "10":
			   if (thisimg=='acc') {
				  spndesc.innerText="" 
				}else{
				  spndesc.innerText="This is our model 9" 
        }      
  
} 
  }
      spndesc.style.visibility=""    
 } 
 
 function restoreimg(imgnme){ 
      event.srcElement.src="images/btnbrown.jpg";
      //if (event.srcElement.id.substr(0,3)=="img") {
      //  divshowimg.src="images/pittabove.jpg"  
     // }
     //spntitle.innerText="" 
     //spndesc.innerText="" 
     // spndesc.style.visibility="hidden";
}

function showaccimg(imgnme){
  //alert(imgnme)
  event.srcElement.src="images/btnbrdown.jpg";
	divshowimg.src="images/" + imgnme
}			  


function poptemplateIMG(sressource,slocation){
  //alert("<DIV " + " style=" + slocation + ">" + "<IMG border=1 src='" + sressource + "'" + ">" + "</DIV>");  
  document.write ("<DIV " + " style=" + slocation + ">" + "<IMG border=1 src='" + sressource + "'" + ">" + "</DIV>")
  
} 


