function writeFlash(title, w, h) {

    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.0.0" width="' + w + '" height="' + h + '" ID="sf" VIEWASTEXT>')

    document.write('  <param name="movie" value="' + title + '.swf" />')

    document.write('  <param name="quality" value="high" />')

    document.write('  <param name="wmode" value="window" />')

    document.write('  <param name="allowScriptAccess" value="always" />')

    document.write('  <param name="allowFullScreen" value="true" />')

    document.write('  <embed src="' + title + '.swf" quality="high" name="sf" allowScriptAccess="always" allowFullScreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + w + '" height="' + h + '"></embed>')

    document.write('</object>')

}
function 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=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];}}
}
preloadImages('../images/Home_over.jpg','../images/Home_overdown.jpg','../images/Races_over.jpg','../images/Races_overdown.jpg','../images/Info_over.jpg','../images/Info_overdown.jpg','../images/Gallery_over.jpg','../images/Gallery_overdown.jpg','../images/Training_over.jpg','../images/Training_overdown.jpg','../images/Contact_over.jpg','../images/Contact_overdown.jpg','../images/Blog_over.jpg','../images/Blog_overdown.jpg');

function moveto(form) {
var myindex=form.newpage.selectedIndex
window.location=(form.newpage.options[myindex].value);
}

function OpenNewWindow(form) {
var myindex=form.newpage.selectedIndex
window.open(form.newpage.options[myindex].value,'','status,menubar=yes,scrollbars=yes,resizeable=yes,height=800, width=1050')
return false
}

function OpenNewWindowViaURL(url) {
window.open(url,'','status,menubar=yes,scrollbars=yes,resizeable=yes,height=800, width=1050')
return false
}
function OpenNewWindow2ViaURL(url) {
window.open(url,'','status,menubar=yes,scrollbars=yes,resizeable=yes,height=940, width=1050')
return false
}
function OpenNewAlbumWindowViaForm(form) {
var myindex=form.newpage.selectedIndex
window.open(form.newpage.options[myindex].value,'','status,menubar=yes,scrollbars=yes,resizeable=yes,height=700, width=800')
return false
}
function OpenNewAlbumWindowViaURL(url) {
window.open(url,'','status,menubar=yes,scrollbars=yes,resizeable=yes,height=700, width=800')
return false
}
function CalculateWFM(){if(document.getElementById('txtWeightWFM').value==''||isNaN(document.getElementById('txtWeightWFM').value)){alert('Please enter a valid weight');document.getElementById('txtWeightWFM').focus();return false;}if(document.getElementById('txtTimeWFM').value==''||isNaN(document.getElementById('txtTimeWFM').value)){alert('Please enter a valid time');document.getElementById('txtTimeWFM').focus();return false;}var hr;var kg;var cb;if(document.getElementById('selTimeWFM').value!=1){hr=document.getElementById('txtTimeWFM').value/60;}else{hr=document.getElementById('txtTimeWFM').value;}if(document.getElementById('selWeightWFM').value!=1){kg=document.getElementById('txtWeightWFM').value*.45359237;}else{kg=document.getElementById('txtWeightWFM').value;}if(kg>182||kg<22){alert('Please enter a valid weight');document.getElementById('txtWeightWFM').focus();return false;}if(hr>12||hr<=0){alert('Please enter a valid time');document.getElementById('txtTimeWFM').focus();return false;}cb=Math.round((kg*document.getElementById('selPaceWFM').value)*hr);document.getElementById('divResultWFM').innerHTML='You burned '+cb+' calories!';}
