///***** JavaScript: Image Preload *****///
if (window.document.images) {
    function doPreload() {
      var the_images = new Array('../images/logo.gif','../images/n11.gif','../images/n12.gif','../images/n21.gif','../images/n22.gif','../images/n31.gif','../images/n32.gif','../images/n41.gif','../images/n42.gif','../images/n51.gif','../images/n52.gif','../images/s11.gif','../images/s12.gif','../images/s21.gif','../images/s22.gif','../images/s31.gif','../images/s32.gif','../images/s41.gif','../images/s42.gif','../images/s51.gif','../images/s52.gif','../images/s61.gif','../images/s62.gif','../images/s71.gif','../images/s72.gif');
      preloadImages(the_images);
      }
    function preloadImages(the_images_array) {
    for(loop = 0; loop < the_images_array.length; loop++) {
      var an_image = new Image();
      an_image.src = the_images_array[loop];
      }
     }
    }

//	IE Flash Fix
//	*********************
	function RunFoo() {
	    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="640" height="2550" id="new-intro04" align="middle">\n');
    	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
    	document.write('<param name="movie" value="new-intro04.swf" />\n');
	    document.write('<param name="loop" value="false" />\n');
	    document.write('<param name="quality" value="high" />\n');
	    document.write('<param name="salign" value="lt" />\n');
	    document.write('<param name="bgcolor" value="#ffffff" />\n');
    	document.write('<embed src="new-intro04.swf" loop="false" quality="high" salign="lt" bgcolor="#ffffff" width="640" height="2550" name="new-intro04" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" /></embed>\n');
	    document.write('</object>\n');
	}

//	IE Flash Fix - INTRO
//	*********************
	function RunFooIntro() {
	    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="760" height="600" id="script" align="left">\n');
    	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
    	document.write('<param name="movie" value="script.swf" />\n');
	    document.write('<param name="loop" value="false" />\n');
	    document.write('<param name="quality" value="high" />\n');
	    document.write('<param name="scale" value="noborder" />\n');
	    document.write('<param name="salign" value="lt" />\n');
	    document.write('<param name="bgcolor" value="#ffffff" />\n');
    	document.write('<embed src="script.swf" loop="false" quality="high" scale="noborder" salign="lt" bgcolor="#ffffff" width="760" height="600" name="script" align="left" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" /></embed>\n');
	    document.write('</object>\n');
	}

//	IE Flash Fix - ANIMATION
//	*********************
	function RunFooAnimation() {
	    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="257" height="253" id="circle_animation" align="middle">\n');
    	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
    	document.write('<param name="movie" value="circle_animation.swf" />\n');
	    document.write('<param name="loop" value="true" />\n');
	    document.write('<param name="quality" value="high" />\n');
	    document.write('<param name="scale" value="noborder" />\n');
	    document.write('<param name="salign" value="lt" />\n');
	    document.write('<param name="bgcolor" value="#ffffff" />\n');
    	document.write('<embed src="circle_animation.swf" quality="high" bgcolor="#ffffff" width="257" height="253" name="circle_animation" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" /></embed>\n');
	    document.write('</object>\n');
	}

//	Pop-Up Window
//	*********************
	function popUP(this_pg) {
	var the_window = window.open(this_pg,'the_window','width=432,height=495,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,screenX=50pixels,screenY=50pixels');
	}

//	Security Code Window
//	*********************
	function secCode(this_pg) {
	var the_window = window.open(this_pg,'the_window','width=432,height=600,toolbar=no,location=no,status=no,scrollbars=no,resizable=yes,screenX=50pixels,screenY=50pixels');
	}

//	Larger Item View Window
//	*********************
	function lgrView(this_pg) {
	var the_window = window.open(this_pg,'the_window','width=475,height=600,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,screenX=50pixels,screenY=50pixels');
	}

//	Email Friend Window
//	*********************
	function emailFrnd(this_pg) {
	var the_window = window.open(this_pg,'the_window','width=432,height=495,toolbar=no,location=no,status=no,scrollbars=no,resizable=yes,screenX=50pixels,screenY=50pixels');
	}

//	Self Close
//	*********************
    function closeNow()	{
    window.close()
    }

//	Date Script
//	*********************
	var today = new Date();
	var day = today.getDate();
	var month = today.getMonth();
		function y2k(number) {
		  return (number < 1000) ? number + 1900 : number;
		}

		var year = y2k(today.getYear())
		if (month == "0")
		    month = "January";
	    else
		if (month == "1")
		    month = "February";
	    else
		if (month == "2")
		    month = "March";
	    else
		if (month == "3")
		    month = "April";
	    else
		if (month == "4")
		    month = "May";
	    else
		if (month == "5")
		    month = "June";
	    else
		if (month == "6")
		    month = "July";
	    else
		if (month == "7")
		    month = "August";
	    else
		if (month == "8")
		    month = "September";
	    else
		if (month == "9")
		    month = "October";
	    else
		if (month == "10")
		    month = "November";
	    else
		if (month == "11")
		    month = "December";

//	Rotating Banner Script
//	*********************
/*   dw_banners.js   version date: April 2005  */

/*************************************************************************
  This code is from Dynamic Web Coding at dyn-web.com
  Copyright 2001-5 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

dw_Banner.restartDelay = 500; // delay onmouseout to restart rotation

dw_Banners = {}; // globally accessible reference to object 
function dw_Banner(id, delay, bMouse) {
    this.id = id; this.delay = delay; this.items = []; this.ctr = 0; this.timer = null;
    dw_Banners[this.id] = this; this.animString = "dw_Banners." + this.id;
    if (bMouse) dw_Banner.setMouseEvents(this.id); // set up pause/resume onmouseover/out
};

dw_Banner.prototype.addItem = function(sHtml) {
 	this.items[this.items.length] = sHtml;
};

dw_Banner.prototype.rotate = function() {
    clearTimeout(this.timer); this.timer = null;
    var el = document.getElementById(this.id);
    if ( el && typeof el.innerHTML != "undefined" ) {
        el.innerHTML = this.items[this.ctr];
        if (this.ctr < this.items.length-1) this.ctr++;
        else this.ctr = 0;
        this.timer = setTimeout(this.animString + ".rotate()", this.delay);
    }
};

dw_Banner.setMouseEvents = function(id) {
    var el = document.getElementById(id);
    if (el) {
        el.onmouseover = dw_Banner.pause;
        el.onmouseout = dw_Banner.resume;
    }
};

// these 2 functions called onmouseover/out of banner el
dw_Banner.pause = function() { 
    var curObj = dw_Banners[this.id];
    if (curObj) { clearTimeout(curObj.timer); curObj.timer = null; }
};
 
dw_Banner.resume = function(e) {
    e = e? e: window.event;
    var toEl = e.relatedTarget? e.relatedTarget: e.toElement;
    if ( this != toEl && !dw_contained(toEl, this) ) {
        var curObj = dw_Banners[this.id];
        if (curObj)
            curObj.timer = setTimeout(curObj.animString + ".rotate()", dw_Banner.restartDelay);
    }
};

// returns true of oNode is contained by oCont (container)
function dw_contained(oNode, oCont) {
    if (!oNode) return; // in case alt-tab away while hovering (prevent error)
    while ( oNode = oNode.parentNode ) if ( oNode == oCont ) return true;
    return false;
};

var imageHandler = { 
    path:"", imgs:[], preload:function() { for(var i=0;arguments[i];i++) {
    var img=new Image(); img.src=this.path+arguments[i]; this.imgs[this.imgs.length]=img;}}
};
