function dw_Rotator(h,f,g,b,a,e){var d=document.getElementById(h);if(!d){d=document.images[h];if(!d){return}d.id=h}this.id=h;this.speed=f||5500;this.path=g||"";this.bRand=e;this.ctr=0;this.timer=0;this.imgs=[];this._setupLink(d,a);this.bTrans=b&&typeof d.filters!="undefined";var c=dw_Rotator.col.length;dw_Rotator.col[c]=this;this.animString="dw_Rotator.col["+c+"]"}dw_Rotator.col=[];dw_Rotator.resumeDelay=400;dw_Rotator.prototype._setupLink=function(c,b){if(c.parentNode&&c.parentNode.tagName.toLowerCase()=="a"){var a=this.parentLink=c.parentNode;if(b){dw_Event.add(a,"mouseover",dw_Rotator.pause);dw_Event.add(a,"mouseout",dw_Rotator.resume)}}};dw_Rotator.getInstanceById=function(d){var a=dw_Rotator.col.length,c;for(var b=0;b<a;b++){c=dw_Rotator.col[b];if(c.id&&c.id==d){return c}}return null};dw_Rotator.prototype.on_rotate=function(){};dw_Rotator.prototype.addImages=function(){var a;for(var b=0;arguments[b];b++){a=new Image();a.src=this.path+arguments[b];this.imgs[this.imgs.length]=a}};dw_Rotator.prototype.rotate=function(){clearTimeout(this.timer);this.timer=null;var a=document.getElementById(this.id);if(this.bRand){this.setRandomCtr()}else{if(this.ctr<this.imgs.length-1){this.ctr++}else{this.ctr=0}}if(this.bTrans){this.doImageTrans(a)}else{a.src=this.imgs[this.ctr].src}this.swapAlt(a);this.prepAction();this.on_rotate();this.timer=setTimeout(this.animString+".rotate()",this.speed)};dw_Rotator.prototype.setRandomCtr=function(){var a=0,b;do{b=Math.floor(Math.random()*this.imgs.length);a++}while(b==this.ctr&&a<6);this.ctr=b};dw_Rotator.prototype.doImageTrans=function(a){a.style.filter="blendTrans(duration=1)";if(a.filters.blendTrans){a.filters.blendTrans.Apply()}a.src=this.imgs[this.ctr].src;a.filters.blendTrans.Play()};dw_Rotator.prototype.swapAlt=function(a){if(!a.setAttribute){return}if(this.alt&&this.alt[this.ctr]){a.setAttribute("alt",this.alt[this.ctr])}if(this.title&&this.title[this.ctr]){a.setAttribute("title",this.title[this.ctr])}};dw_Rotator.prototype.prepAction=function(){if(this.actions&&this.parentLink&&this.actions[this.ctr]){if(typeof this.actions[this.ctr]=="string"){this.parentLink.href=this.actions[this.ctr]}else{if(typeof this.actions[this.ctr]=="function"){var a=this.id;this.parentLink.href="javascript: void "+this.actions[this.ctr]+"('"+a+"')"}}}};dw_Rotator.prototype.showCaption=function(){if(this.captions&&this.captionId){var a=document.getElementById(this.captionId);if(a&&this.captions[this.ctr]){a.innerHTML=this.captions[this.ctr]}}};dw_Rotator.start=function(){var a=dw_Rotator.col.length,c;for(var b=0;b<a;b++){c=dw_Rotator.col[b];if(c&&c.id){clearTimeout(c.timer);c.timer=null;c.timer=setTimeout(c.animString+".rotate()",c.speed)}}};dw_Rotator.stop=function(){var a=dw_Rotator.col.length,c;for(var b=0;b<a;b++){c=dw_Rotator.col[b];if(c){clearTimeout(c.timer);c.timer=null}}};dw_Rotator.pause=function(b){b=dw_Event.DOMit(b);var c=b.target.id;var a=dw_Rotator.getInstanceById(c);if(a){clearTimeout(a.timer);a.timer=null}};dw_Rotator.resume=function(b){b=dw_Event.DOMit(b);var c=b.target.id;var a=dw_Rotator.getInstanceById(c);if(a&&a.id){a.timer=setTimeout(a.animString+".rotate()",dw_Rotator.resumeDelay)}};dw_Rotator.setup=function(){if(!document.getElementById){return}var d,c,b,g,f,a;for(d=0;arguments[d];d++){b=arguments[d];g=new dw_Rotator(b.id,b.speed,b.path,b.bTrans,b.bMouse,b.bRand);try{f=b.images;a=f.length;for(c=0;c<a;c++){g.addImages(f[c])}if(b.num){g.ctr=b.num}if(b.actions&&b.actions.length==a){g.addProp("actions",b.actions)}if(b.alt&&b.alt.length==a){g.addProp("alt",b.alt)}if(b.title&&b.title.length==a){g.addProp("title",b.title)}if(b.captions){g.addProp("captions",b.captions);g.captionId=b.captionId;dw_Rotator.addRotateEvent(g,function(e){return function(){dw_Rotator.getInstanceById(e).showCaption()}}(b.id))}}catch(h){}}dw_Rotator.start()};dw_Rotator.addRotateEvent=function(b,a){var c=b.on_rotate;b.on_rotate=function(){c();a()}};dw_Rotator.prototype.addProp=function(d,b){if(!this[d]){this[d]=[]}var a=b.length;for(var c=0;c<a;c++){this[d][this[d].length]=b[c]}};function dw_getRandomImage(g){var c=g.images;if(!c){return}var e=Math.floor(Math.random()*c.length);var f="";var i=c[e];g.num=e;var j=g.path||"";var b=g.id||"";var h,d="",a;if(g.alt){d=g.alt[e]?g.alt[e]:g.alt[0]?g.alt[0]:""}if(g.title){h=g.title[e]?g.title[e]:g.title[0]?g.title[0]:""}if(g.actions){a=g.actions[e]?g.actions[e]:g.actions[0]?g.actions[0]:null}if(a){f+='<a href="';f+=typeof a=="string"?a:"javascript: void "+a;f+=g.loadNewWin?'" target="_blank">':'">'}f+='<img src="'+j+i+'"';f+=b?' id="'+b+'"':"";if(h){f+=' title="'+h+'"'}f+=' alt="'+d+'" border="0" />';if(a){f+="</a>"}document.write(f);document.close()}dw_Rotator.addControls=function(){var d=dw_getElementsByClassName("rotator_controls");for(var c=0;d[c];c++){var a=d[c].getElementsByTagName("a");for(var b=0;a[b];b++){if(dw_hasClass(a[b],"stop")){a[b].onclick=function(){dw_Rotator.stop();return false}}else{if(dw_hasClass(a[b],"start")){a[b].onclick=function(){dw_Rotator.restart();return false}}}}d[c].style.display="block"}};dw_Rotator.restart=function(){var a=dw_Rotator.col.length,c;for(var b=0;b<a;b++){c=dw_Rotator.col[b];if(c&&c.id){clearTimeout(c.timer);c.timer=null;c.timer=setTimeout(c.animString+".rotate()",dw_Rotator.resumeDelay)}}};function dw_hasClass(c,a){var b=new RegExp("\\b"+a+"\\b","i");if(b.test(c.className)){return true}return false}function dw_getElementsByClassName(g,c,b){var a=[],f,d;var e=new RegExp("\\b"+g+"\\b","i");b=b?b:document;if(document.getElementsByTagName){if(!c||c=="*"){f=b.all?b.all:b.getElementsByTagName("*")}else{f=b.getElementsByTagName(c)}for(d=0;f[d];d++){if(e.test(f[d].className)){a.push(f[d])}}}return a}function displayImgInSubWin(c){var a=dw_Rotator.getInstanceById(c);var b=a.imgs[a.ctr].src;openSubWin(b);return false}function openSubWin(d,b,a,i,c,e,g){b=b||"subwindow";g=g||"menubar,resizable,scrollbars";c=c||600;e=e||450;a=(typeof a=="number")?a:Math.round((screen.availWidth-c)/2);i=(typeof i=="number")?i:Math.round((screen.availHeight-e)/2);g+=",width="+c+",height="+e+",left="+a+",top="+i;var f=window.open(d,b,g);if(f){if(!f.closed){f.resizeTo(c,e);f.moveTo(a,i);f.focus();return false}}return true}

var rotator1={path:"theme/nar/img/homepage/",id:"r1",speed:4500,bTrans:true,bMouse:true,images:["arctc-suite.jpg","Multicam.jpg","casevac.jpg"],actions:["New_Products.htm","Portal.aspx?CN=BACEF7407E86&SEARCH=multicam","New_Products.htm"],alt:["Multicam","Casevac"]};

var rotator2={path:"theme/nar/img/homepage/",id:"r2",speed:7500,bTrans:true,bMouse:true,images:["NPS-thumb.jpg","jems2011.jpg","amex.jpg", "twitter.jpg", "facebook.jpg"],actions:["http://www.narescue.com/Catalogs.htm","http://www.narescue.com/HyFin_Xtreme_Chest_Seal-CNAEB13F16A9EA.html?BC=3C7457EA9AFA","#", "http://www.Twitter.com/NARescue","http://www.facebook.com/home.php?#!/profile.php?id=100001329362144&v=wall"],alt:["View our Interactive Catalog","JEMS New Product Innovation","We Accept; Visa, Mastercard, Amex", "Follow NAR on Twitter","Facebook"]};function initRotator(){dw_Rotator.setup(rotator1,rotator2)}dw_Event.add(window,"load",initRotator);
