
var win= null;
function NewWindow(mypage,myname,w,h,scroll,focus)
{
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=yes';
  win=window.open(mypage,myname,settings);
  if (focus=="Y") 
  {
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
  }
}




// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;

// Duration of crossfade (seconds)
var crossFadeDuration = 3;

// Specify the image files
var Pic = new Array(); // don't touch this
var Link = new Array();
// to add more images, just continue
// the pattern, adding to the array below


// Pic[0] = 'i/Rotating/savemore.jpg';
// Link[1] = '/index.cfm?page=search:browse&categoryID=2020';  

Pic[0] = 'slideshow/1.jpg';
Link[1] = 'index.cfm?page=search:browse&CategoryID=78';

Pic[1] = 'slideshow/2.jpg';
Link[2] = '/index.cfm?page=search:browse&categoryID=85';

Pic[2] = 'slideshow/3.jpg';
Link[0] = '/index.cfm?page=search:browse&categoryID=37';



// =======================================
// do not edit anything below this line
// =======================================
var lnk = 0;
var t;
var j = 0;
var p = Pic.length;
 
var preLoad = new Array();
for (i = 0; i < p; i++){
   preLoad[i] = new Image();
   preLoad[i].src = Pic[i];
}
 
function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.SlideShow.filters.blendTrans.Apply();
   }
 
   document.images.SlideShow.src = preLoad[j].src;

   
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
   }
   lnk = lnk + 1;
   if (lnk > (p-1)) lnk=0
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

function gotoshow(){
 
window.location=Link[lnk];
}

 

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		morehome_categories_02_Fixtures_2_over = newImage("images/marketing/categories/morehome-categories_02-Fixt.jpg");
		morehome_categories_02_Lighting_3_over = newImage("images/marketing/categories/morehome-categories_02-Ligh.jpg");
		morehome_categories_02_Hardware_4_over = newImage("images/marketing/categories/morehome-categories_02-Hard.jpg");
		morehome_categories_02_HVAC_5_over = newImage("images/marketing/categories/morehome-categories_02-HVAC.jpg");
		morehome_categories_02_Tools_6_over = newImage("images/marketing/categories/morehome-categories_02-Tool.jpg");
		morehome_categories_02_Kitchenware_7_over = newImage("images/marketing/categories/morehome-categories_02-Kitc.jpg");
		morehome_categories_02_Home_Decor_8_over = newImage("images/marketing/categories/morehome-categories_02-Home.jpg");
		Tools_6_over = newImage("images/marketing/categories/Tools-6-over.jpg");
		Home_Decor_8_over = newImage("images/marketing/categories/Home-Decor-8-over.jpg");
		preloadFlag = true;
	}
}



/// clear text field
function clickclear(thisfield, defaulttext) {

if (thisfield.value == defaulttext) {

thisfield.value = "";

}

}

function clickrecall(thisfield, defaulttext) {

if (thisfield.value == "") {

thisfield.value = defaulttext;

}

}

/////// shadow

var gradientshadow={}
gradientshadow.depth=6 //Depth of shadow in pixels
gradientshadow.containers=[]

gradientshadow.create=function(){
var a = document.all ? document.all : document.getElementsByTagName('*')
for (var i = 0;i < a.length;i++) {
	if (a[i].className == "shadow") {
		for (var x=0; x<gradientshadow.depth; x++){
			var newSd = document.createElement("DIV")
			newSd.className = "shadow_inner"
			newSd.id="shadow"+gradientshadow.containers.length+"_"+x //Each shadow DIV has an id of "shadowL_X" (L=index of target element, X=index of shadow (depth) 
			if (a[i].getAttribute("rel"))
				newSd.style.background = a[i].getAttribute("rel")
			else
				newSd.style.background = "black" //default shadow color if none specified
			document.body.appendChild(newSd)
		}
	gradientshadow.containers[gradientshadow.containers.length]=a[i]
	}
}
gradientshadow.position()
window.onresize=function(){
	gradientshadow.position()
}
}

gradientshadow.position=function(){
if (gradientshadow.containers.length>0){
	for (var i=0; i<gradientshadow.containers.length; i++){
		for (var x=0; x<gradientshadow.depth; x++){
  		var shadowdiv=document.getElementById("shadow"+i+"_"+x)
			shadowdiv.style.width = gradientshadow.containers[i].offsetWidth + "px"
			shadowdiv.style.height = gradientshadow.containers[i].offsetHeight + "px"
			shadowdiv.style.left = gradientshadow.containers[i].offsetLeft + x + "px"
			shadowdiv.style.top = gradientshadow.containers[i].offsetTop + x + "px"
		}
	}
}
}

if (window.addEventListener)
window.addEventListener("load", gradientshadow.create, false)
else if (window.attachEvent)
window.attachEvent("onload", gradientshadow.create)
else if (document.getElementById)
window.onload=gradientshadow.create

