
/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}



var pausecontent=new Array();

pausecontent[0]='"Karen Fenton who is in my photography class at Washtenaw Community College carries her M Rock bag around all the time, and it has generated much interest and many compliments. I finally decided to get one." - Ann F. Whitmore Lake, MI';

pausecontent[1]='"Just a few lines to express my complete satisfaction with M-Rock products and customer service.  All of the items I ordered (Canyon Lands, Grand Teton, Ozark, Joshua Tree and a Filter Wallet) arrived quickly and are of superior quality.  I have a closet full of camera cases and bags that just do not compare with M-Rock.  Thanks for your great service.  I am extremely pleased." - Greg Peterson. Bridgeton, NJ';

pausecontent[2]='"We have one MRock case and it has survived abuses from the wilderness of the high Sierras in California to the "depth" of Death Valley. It has also traveled to various destinations stretching from Indonesia to across the continental US all the way to as far as Ireland. We are looking forward to these new cases for our new equipment" - Lipti.';

pausecontent[3]='"Hello - I just received my Ozark bag today. Is it possible to like the bag more than the camera? Cause I think I do!. Thanks, Customer for LIFE!" - Jerry.';

pausecontent[4]='"I purchased an M-ROCK bag 3 years ago and now need a lens case for my expanded kit. I am so very satisfied with my M-ROCK case that I wouldn\'t consider any other make. The high quality and solid durability has been proven under all conditions" - Edward F.';

pausecontent[5]='"Wow, it was waiting for me on the front porch. I am totally impressed with your company and I love my camera bag as well. Thanks for your great service" - Lynette.';

pausecontent[6]='"Michael, I got the cases several days ago, Thank You! I am extremely glad that I did not go with the brands I was finding in all the local stores. I could not be happier with the quality of your cases" - Thanx again, John Krayeski.';

pausecontent[7]='"Great products. And the modular attachment system is brilliant. I have a Nikon D60 with 18-55mm f/3.5-5.6 AF-S DX VR lens, and 55-200mm f/4-5.6G ED AF-S DX VR Zoom Nikkor Lenses. Sometimes I don\'t want to carry the tele zoom, but when I do, the modular attachment is really convenient" - Thanks, FE.';

pausecontent[8]='"Received my order today. Very Fast. You Do Rock! Camera Bag and Belt are fantastic! After 50 years of photography and changing bags this will be my last change. They are great and I anticipate a long relationship with M-ROCK and will promote your product to all my patients and friends" - Thank You Dr K.';

pausecontent[9]='"I bought one of your bags from the local camera store here in Iowa City. Wonderful construction, looks great, and excellent size. I\'m a new fan and would recommend your products to anyone!" - David Bozaan.';

pausecontent[10]='"My most EXCELLENT camera bag arrived today. VERY impressive quality and design. Thank you for the communication and a wonderful product. Another happy customer :)" - M. Stein.';

pausecontent[11]='"Absolutely fabulous - the size, construction, weight balance - I am so excited to have such a fabulously integrated system of bags that will travel as well as I do. Your prompt attention to the order was beyond expectations" - Sally Ruscitti.';

pausecontent[12]='"I wanted to let you know that the order arrived. I was amazed at how quickly it was delivered. Almost a world\'s record for this tiny island. I also want to tell you how pleased I am with the quality of the bags. It Rocks!" - Sharon Ishizaki.';

pausecontent[13]='"I\'ve been using one of your camera bags for about three weeks now, and agree that it\'s the finest way to protect my camera. In forty years of photography, I don\'t think I\'ve ever had a finer bag. Thanks very much" - Bob Beeley.';

pausecontent[14]='"What a company!!!!!!!!!! You guys are too much. Thanks for the service and your great products. I just bought your "belt" yesterday to hang everything on. It\'s great. Thanks again" - Mark Lang.';



function over01(BagID)
{
	document.getElementById('DropDown1').src="https://www.m-rock.com/images/HomePage/" + BagID + ".png";
	document.getElementById('DropDown1').alt="" + BagID + "";
}

function over02(BagID)
{
	document.getElementById('DropDown2').src="https://www.m-rock.com/images/HomePage/" + BagID + ".png";
	document.getElementById('DropDown2').alt="" + BagID + "";
}

function over03(BagID)
{
	document.getElementById('DropDown3').src="https://www.m-rock.com/images/HomePage/" + BagID + ".png";
	document.getElementById('DropDown3').alt="" + BagID + "";
}

function over04(BagID)
{
	document.getElementById('DropDown4').src="https://www.m-rock.com/images/HomePage/" + BagID + ".png";
	document.getElementById('DropDown4').alt="" + BagID + "";
}

function over05(BagID)
{
	document.getElementById('DropDown5').src="https://www.m-rock.com/images/HomePage/" + BagID + ".png";
	document.getElementById('DropDown5').alt="" + BagID + "";
}

function over06(BagID)
{
	document.getElementById('DropDown6').src="https://www.m-rock.com/images/HomePage/" + BagID + ".png";
	document.getElementById('DropDown6').alt="" + BagID + "";
}

function over07(BagID)
{
	document.getElementById('DropDown7').src="https://www.m-rock.com/images/HomePage/" + BagID + ".png";
	document.getElementById('DropDown7').alt="" + BagID + "";
}

function over08(BagID)
{
	document.getElementById('DropDown8').src="https://www.m-rock.com/images/HomePage/" + BagID + ".png";
	document.getElementById('DropDown8').alt="" + BagID + "";
}

function over09(BagID)
{
	document.getElementById('DropDown9').src="https://www.m-rock.com/images/HomePage/" + BagID + ".png";
	document.getElementById('DropDown9').alt="" + BagID + "";
}

function over10(BagID)
{
	document.getElementById('DropDown10').src="https://www.m-rock.com/images/HomePage/" + BagID + ".png";
	document.getElementById('DropDown10').alt="" + BagID + "";
}


function over11(BagID)
{
	document.getElementById('DropDown11').src="https://www.m-rock.com/images/HomePage/" + BagID + ".png";
	document.getElementById('DropDown11').alt="" + BagID + "";
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
