function autoUrl(name,dest)
{var loc;var id_list;id_list=document.getElementById(name);loc=id_list.options[id_list.selectedIndex].value;if(loc!=0)
location.href=dest+loc;return;}
function autoUrlNoList(name,dest)
{var loc;loc=document.getElementById(name).checked;location.href=dest+(loc==true?1:0);return;}
function toggle(e,show)
{e.style.display=show?'':'none';}
function toggleMultiple(tab)
{var len=tab.length;for(var i=0;i<len;i++)
if(tab[i].style)
toggle(tab[i],tab[i].style.display=='none');}
function showElemFromSelect(select_id,elem_id)
{var select=document.getElementById(select_id);for(var i=0;i<select.length;++i)
{var elem=document.getElementById(elem_id+select.options[i].value);if(elem!=null)
toggle(elem,i==select.selectedIndex);}}
function openCloseAllDiv(name,option)
{var tab=$('*[name='+name+']');for(var i=0;i<tab.length;++i)
toggle(tab[i],option);}
function toggleElemValue(id_button,text1,text2)
{var obj=document.getElementById(id_button);if(obj)
obj.value=((!obj.value||obj.value==text2)?text1:text2);}
function addBookmark(url,title)
{if(window.sidebar)
return window.sidebar.addPanel(title,url,"");else if(window.external)
return window.external.AddFavorite(url,title);else if(window.opera&&window.print)
return true;return true;}
function writeBookmarkLink(url,title,text,img)
{var insert='';if(img)
insert=writeBookmarkLinkObject(url,title,'<img src="'+img+'" alt="'+escape(text)+'" title="'+escape(text)+'" />')+'&nbsp';insert+=writeBookmarkLinkObject(url,title,text);document.write(insert);}
function writeBookmarkLinkObject(url,title,insert)
{if(window.sidebar||window.external)
return('<a href="javascript:addBookmark(\''+escape(url)+'\', \''+escape(title)+'\')">'+insert+'</a>');else if(window.opera&&window.print)
return('<a rel="sidebar" href="'+escape(url)+'" title="'+escape(title)+'">'+insert+'</a>');return('');}
function checkCustomizations()
{var tmp;var pattern=new RegExp(' ?filled ?');for(var i=0;i<customizationFields.length;i++)
if(parseInt(customizationFields[i][1])==1&&$('#'+customizationFields[i][0]).val()==''&&!pattern.test($('#'+customizationFields[i][0]).attr('class')))
return false;return true;}
function ceilf(value,precision)
{if(typeof(precision)=='undefined')
precision=0
var precisionFactor=precision==0?1:Math.pow(10,precision);var tmp=value*precisionFactor;var tmp2=tmp.toString();if(tmp2.indexOf('.')===false)
return(value);if(tmp2.charAt(tmp2.length-1)==0)
return value;return Math.ceil(tmp)/precisionFactor;}
function floorf(value,precision)
{if(typeof(precision)=='undefined')
precision=0
var precisionFactor=precision==0?1:Math.pow(10,precision);var tmp=value*precisionFactor;var tmp2=tmp.toString();if(tmp2.indexOf('.')===false)
return(value);if(tmp2.charAt(tmp2.length-1)==0)
return value;return Math.floor(tmp)/precisionFactor;}
function Calculate1(section1,profile1,diameter1){rollingradius1=Math.round((((diameter1/2)*25.4)+(section1*(profile1/100)))*100)/100;wheelradius1=(diameter1/2);circumference1=Math.round((rollingradius1*2*3.14159)*100)/100;document.wheelsizes.rollingradius1.value=rollingradius1;document.wheelsizes.circumference1.value=circumference1;}
function Calculate2(section2,profile2,diameter2){rollingradius2=Math.round((((diameter2/2)*25.4)+(section2*(profile2/100)))*100)/100;wheelradius2=(diameter2/2);circumference2=Math.round((rollingradius2*2*3.14159)*100)/100;document.wheelsizes.rollingradius2.value=rollingradius2;document.wheelsizes.circumference2.value=circumference2;}
function Difference(circumference1,circumference2){difference=Math.round((circumference2-circumference1)*100)/100;differencepercent=Math.round(((difference/circumference1)*100)*100)/100;realspeed=Math.round((((differencepercent/100)*100)+100)*100)/100;document.wheelsizes.difference.value=difference;document.wheelsizes.differencepercent.value=differencepercent;document.wheelsizes.realspeed.value=realspeed;overallscalar=(250/rollingradius1);currentouter=(rollingradius1*overallscalar);currentinner=(wheelradius1*overallscalar*25.4);newouter=(rollingradius2*overallscalar);newinner=(wheelradius2*overallscalar*25.4);}