/* 
	ECC Style: Global JavaScript
	Author: Transmyt Marketing 
	Last Update: 11/10/08
	
								*/

function FP_swapImgRestore() {//v1.0

 var doc=document,i; if(doc.$imgSwaps) { for(i=0;i<doc.$imgSwaps.length;i++) {

  var elm=doc.$imgSwaps[i]; if(elm) { elm.src=elm.$src; elm.$src=null; } } 

  doc.$imgSwaps=null; }

}



function FP_swapImg() {//v1.0

 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;

 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;

 elm.$src=elm.src; elm.src=args[n+1]; } }

}



function FP_preloadImgs() {//v1.0

 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();

 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }

}



function FP_getObjectByID(id,o) {//v1.0

 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);

 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;

 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)

 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }

 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;

 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }

 return null;

}

// Set up the image files to be used.


var theImages = new Array() // do not change this

theImages[0] = 'http://eccstyle.com/images/homevid1.gif'

theImages[1] = 'http://eccstyle.com/images/homevid2.gif'

theImages[2] = 'http://eccstyle.com/images/homevid3.gif'

theImages[3] = 'http://eccstyle.com/images/homevid4.gif'

theImages[4] = 'http://eccstyle.com/images/homevid5.gif'

theImages[5] = 'http://eccstyle.com/images/homevid6.gif'

theImages[6] = 'http://eccstyle.com/images/homevid7.gif'



// do not edit anything below this line

var j = 0

var p = theImages.length;

var preBuffer = new Array()

for (i = 0; i < p; i++){

   preBuffer[i] = new Image()

   preBuffer[i].src = theImages[i]

}



var whichImage = Math.round(Math.random()*(p-1));



function showImage(){

   document.write('<img border="0" src="'+theImages[whichImage]+'" width="183" height="159" usemap="#main">');

}

// Jimco Add-ins Spawn JavaScript

   // This script is freely redistributable. //-->

function spawnJimcoPopup(url, name, options, h, w, x, y, scaleType)

{

   var windowOptions;

   if (scaleType == 'percent')

   {

     w = (w * screen.availWidth) / 100;

     h = (h * screen.availHeight) / 100;

   }

   if (x == 'center')

   {

     x = (screen.availWidth - w) / 2;

     y = (screen.availHeight - h) / 2;

   }

   windowOptions = options + ',width=' + w + ',height=' + h + ',left=' + x + ',top=' + y;

   newWindow = window.open(url, name, windowOptions);

   newWindow.focus();

}
