var w = null; var d = null; var e = null; var g = null; var x = null; var y = null; var mpr = 1.7777777778; var mpw = 250; var mph = Math.floor(mpw / mpr); var p = 20; var nc = 31; var initialLoad = true; function setWindowParams() { w=window; d=document; e=d.documentElement; g=d.getElementsByTagName('body')[0]; x=w.innerWidth||e.clientWidth||g.clientWidth; y=w.innerHeight||e.clientHeight||g.clientHeight; rpCoasters(); } window.onload = setWindowParams; window.onresize = setWindowParams; function rpCoasters() { var c = Math.floor(x/(mpw+p)); if (c <= 1) { c = 1; } pt = 20; pl = 20; for (i = 0; i < nc; i++) { if (i % c == 0 && i != 0) { pt = pt + mph + p; pl = 20; } document.getElementById('c_'+i).style.position = 'absolute'; document.getElementById('c_'+i).style.top = pt + 'px'; document.getElementById('c_'+i).style.left = pl + 'px'; document.getElementById('c_'+i).style.width = mpw + 'px'; document.getElementById('c_'+i).style.height = mph + 'px'; document.getElementById('cn_'+i).style.position = 'absolute'; document.getElementById('cn_'+i).style.top = (mph-43) + 'px'; document.getElementById('cn_'+i).style.left = '5px'; document.getElementById('cn_'+i).style.width = (mpw-10) + 'px'; document.getElementById('cp_'+i).style.position = 'absolute'; document.getElementById('cp_'+i).style.top = (mph-20) + 'px'; document.getElementById('cp_'+i).style.left = '5px'; document.getElementById('cp_'+i).style.width = (mpw-10) + 'px'; pl = pl + mpw + p; } if (initialLoad) { initialLoad = false; loadImages(); } } function loadImages() { document.getElementById('c_'+0).style.backgroundImage = 'url(m/intimidator_small.jpg)'; document.getElementById('c_'+1).style.backgroundImage = 'url(m/nighthawk_small.jpg)'; document.getElementById('c_'+2).style.backgroundImage = 'url(m/afterburn_small.jpg)'; document.getElementById('c_'+3).style.backgroundImage = 'url(m/cobra_small.jpg)'; document.getElementById('c_'+4).style.backgroundImage = 'url(m/carolinacyclone_small.jpg)'; document.getElementById('c_'+5).style.backgroundImage = 'url(m/hurler_small.jpg)'; document.getElementById('c_'+6).style.backgroundImage = 'url(m/vortex_small.jpg)'; document.getElementById('c_'+7).style.backgroundImage = 'url(m/goldrush_small.jpg)'; document.getElementById('c_'+8).style.backgroundImage = 'url(m/fury325_small.jpg)'; document.getElementById('c_'+9).style.backgroundImage = 'url(m/thunderroad_small.jpg)'; document.getElementById('c_'+10).style.backgroundImage = 'url(m/tornado_small.jpg)'; document.getElementById('c_'+11).style.backgroundImage = 'url(m/firechaser_small.jpg)'; document.getElementById('c_'+12).style.backgroundImage = 'url(m/wildeagle_small.jpg)'; document.getElementById('c_'+13).style.backgroundImage = 'url(m/thunderhead_small.jpg)'; document.getElementById('c_'+14).style.backgroundImage = 'url(m/mysterymine_small.jpg)'; document.getElementById('c_'+15).style.backgroundImage = 'url(m/blazingfury_small.jpg)'; document.getElementById('c_'+16).style.backgroundImage = 'url(m/bluestreak_small.jpg)'; document.getElementById('c_'+17).style.backgroundImage = 'url(m/cedarcreekmineride_small.jpg)'; document.getElementById('c_'+18).style.backgroundImage = 'url(m/corkscrew_small.jpg)'; document.getElementById('c_'+19).style.backgroundImage = 'url(m/gatekeeper_small.jpg)'; document.getElementById('c_'+20).style.backgroundImage = 'url(m/gemini_small.jpg)'; document.getElementById('c_'+21).style.backgroundImage = 'url(m/irondragon_small.jpg)'; document.getElementById('c_'+22).style.backgroundImage = 'url(m/magnumxl200_small.jpg)'; document.getElementById('c_'+23).style.backgroundImage = 'url(m/maverick_small.jpg)'; document.getElementById('c_'+24).style.backgroundImage = 'url(m/meanstreak_small.jpg)'; document.getElementById('c_'+25).style.backgroundImage = 'url(m/millenniumforce_small.jpg)'; document.getElementById('c_'+26).style.backgroundImage = 'url(m/pipescream_small.jpg)'; document.getElementById('c_'+27).style.backgroundImage = 'url(m/raptor_small.jpg)'; document.getElementById('c_'+28).style.backgroundImage = 'url(m/rougarou_small.jpg)'; document.getElementById('c_'+29).style.backgroundImage = 'url(m/topthrilldragster_small.jpg)'; document.getElementById('c_'+30).style.backgroundImage = 'url(m/wickedtwister_small.jpg)'; }