
function modelHover(id,thumb,price,year,msrp,promoImg){pos=String($(id).positionedOffset()).split(",");x=+pos[0]+240;y=pos[1];$('model-rollover').setStyle({top:y+'px',left:x+'px'});$('model-rollover').update('<img src="/flx/modelThumbs/'+thumb+'" /><br /><span class="price">'+price+'<span class="msrpLabel">'+msrp+'</span></span><span class="year">'+year+'</span><br />'+promoImg);$('model-rollover').appear({duration:0.2});}function MM_preloadImages(){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(){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){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(){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];}}v=false;if(typeof(Option)+""!="undefined")v=true;function relate(j){for(k=1;k<4;k++){with(document.searchForm.elements[k]){howmany=options.length;if(howmany>1){for(i=howmany-1;i>0;i--){options[i]=null;}}opsize=q[j][k].length;if(opsize>1){for(i=0;i<opsize;i++){options[i]=new Option(q[j][k][i].text,q[j][k][i].value);}}else{options[0].text=' ';}options[0].selected=true;}}}function checkText(){textField=document.searchForm.text;if(textField.value=="Quick Search"){textField.value="";}}function checkForm(){masterSelect=document.searchForm.master;masterSelected=masterSelect.options[masterSelect.selectedIndex].value;if(masterSelected!=""){modelSelect=document.searchForm.mid;modelSelected=modelSelect.selectedIndex;if(modelSelect.options[modelSelected].value!=""){checkText();return true;}else{alert("Please select a model!");return false;}}else{alert("Please select a Vehicle Type!");return false;}}function popupModels(query){if(document.images){PopWin=window.open("/accessories/models/"+query,"PopWin","scrollbars=yes,status=no,menubar=yes,width=400,height=400,resizable=yes");PopWin.focus();}}function addToWishlist(applicationID,sizeSKU,modelID){if(sizeSKU.match("selectNone")==null){new Ajax.Request('/inc/wishlist.php',{method:'get',parameters:{aid:escape(applicationID),partNum:escape(sizeSKU),mid:escape(modelID)},onSuccess:function(t){$('wishlistItems').update(t.responseText);}});}else{alert("You must select a size to add an item to your wishlist");}}function deleteItem(applicationID,partNum){new Ajax.Request('/inc/wishlist.php',{method:'post',parameters:{aid:escape(applicationID),'delete':escape(partNum)},onSuccess:function(t){$('wishlist_'+applicationID).remove();if(t.responseText!=''){$('wishlistItems').update(t.responseText);}}});}function edit(applicationID,partNum){$('edit_'+applicationID).update('<a href="/accessories/wishlist" onclick="cancelQuantity('+applicationID+', '+$('quantity_'+applicationID).innerHTML+', \''+partNum+'\'); return false;">Cancel</a>');$('quantity_'+applicationID).update('<input type="text" size="2" id="quantityVal_'+applicationID+'" name="quantityVal_'+applicationID+'" value="'+$('quantity_'+applicationID).innerHTML+'" /> <input type="submit" value="Submit" onclick="editQuantity('+applicationID+', \''+partNum+'\'); return false;" />');}function editQuantity(applicationID,partNum){new Ajax.Request('/inc/wishlist.php',{method:'post',parameters:{aid:escape(applicationID),partNum:partNum,quantity:$('quantityVal_'+applicationID).value},onSuccess:function(t){$('quantity_'+applicationID).update($('quantityVal_'+applicationID).value);$('edit_'+applicationID).update('<a href="/accessories/wishlist" onclick="edit('+applicationID+', \''+partNum+'\'); return false;">Edit</a>');}});}function cancelQuantity(applicationID,initialVal,partNum){$('quantity_'+applicationID).update(initialVal);$('edit_'+applicationID).update('<a href="/accessories/wishlist" onclick="edit('+applicationID+', \''+partNum+'\'); return false;">Edit</a>');}function updateWishlist(){$('accLoading').show();new Ajax.Request('/inc/wishlist.php',{method:'get',onSuccess:function(t){$('wishlistItems').update(t.responseText);$('accLoading').hide();}});}function zoomImage(filename,location){$('zoomImage').href='http://www.kawasaki.ca/flx/'+location+filename;myLightbox.updateImageList();fireEvent($('zoomImage'),'click');}
function fireEvent(obj,evt){var fireOnThis=obj;if(document.createEvent){var evObj=document.createEvent('MouseEvents');evObj.initEvent(evt,true,false);fireOnThis.dispatchEvent(evObj);}else if(document.createEventObject){fireOnThis.fireEvent('on'+evt);}}function setCookie(c_name,value){var exdate=new Date();exdate.setDate(exdate.getDate()+365);document.cookie=c_name+"="+escape(value)+";expires="+exdate.toGMTString();}var tooltip=function(){var id='tt';var top=15;var left=-60;var maxw=300;var speed=500;var timer=20;var endalpha=100;var alpha=0;var tt,c,b,h;var ie=document.all?true:false;return{show:function(v,cV,w){if(tt==null){tt=document.createElement('div');tt.setAttribute('id',id);c=document.createElement('div');c.setAttribute('id',id+'cont');b=document.createElement('div');b.setAttribute('id',id+'bot');tt.appendChild(c);tt.appendChild(b);document.body.appendChild(tt);tt.style.opacity=0;tt.style.filter='alpha(opacity=0)';document.onmousemove=this.pos;}
tt.style.display='block';c.innerHTML='<img src="/flx/technologyImages/articlePics/'+v+'" alt="" /><br />'+cV;b.innerHTML='<img src="/images/beta/techArrowDown.png" alt="" />';tt.style.width=w?w+'px':'auto';if(!w&&ie){tt.style.width=tt.offsetWidth;}
if(tt.offsetWidth>maxw){tt.style.width=maxw+'px'}
h=parseInt(tt.offsetHeight)+top;clearInterval(tt.timer);tt.timer=setInterval(function(){tooltip.fade(1)},timer);},pos:function(e){var u=ie?event.clientY+document.documentElement.scrollTop:e.pageY;var l=ie?event.clientX+document.documentElement.scrollLeft:e.pageX;tt.style.top=(u-h)+'px';tt.style.left=(l+left)+'px';},fade:function(d){var a=alpha;if((a!=endalpha&&d==1)||(a!=0&&d==-1)){var i=speed;if(endalpha-a<speed&&d==1){i=endalpha-a;}else if(alpha<speed&&d==-1){i=a;}
alpha=a+(i*d);tt.style.opacity=alpha*.01;tt.style.filter='alpha(opacity='+alpha+')';}else{clearInterval(tt.timer);if(d==-1){tt.style.display='none'}}},hide:function(){clearInterval(tt.timer);tt.timer=setInterval(function(){tooltip.fade(-1)},timer);}};}();function toggleAccNav(masterID){Effect.toggle('navModels_'+masterID,'blind',{duration:0.3});$$('ul ul').invoke('hide');}
var zKeeper=new Array();var topzKeeper=new Array();var vTopOff
var vTopOn
var topvTopOff
var topvTopOn
var runningWin
function prepNavBatch(){winTest=navigator.platform.indexOf("Win");if(winTest>-1){runningWin=true;}else{runningWin=false}
if((navigator.appName=="Microsoft Internet Explorer")){vTopOff=4;vTopOn=4;topvTopOff=-10;topvTopOn=-10;}else{vTopOff=-1;vTopOn=-1;topvTopOff=-11;topvTopOn=-11;}
for(i=0;i<4;i++){currentEval='M'+(i+1);zKeeper[i]=document.getElementById(currentEval).style.zIndex;}
for(i=0;i<2;i++){currentEval='topM'+(i+1);topzKeeper[i]=document.getElementById(currentEval).style.zIndex;}}
function pushMeOut(whoAmI,userPress){if(whoAmI<99){currentEval='M'+whoAmI;currentTextEval='T'+whoAmI;lessMe=whoAmI-1;zKeeper[lessMe]=4;for(var i=0;i<zKeeper.length;i++){if((zKeeper[i]>document.getElementById(currentEval).style.zIndex)&&((i+1)!=whoAmI)){zKeeper[i]=zKeeper[i]-1;}}}
if((navigator.appName=="Microsoft Internet Explorer")&&runningWin){pusher=2;}else{pusher=0;}
for(var i=0;i<zKeeper.length;i++){myEval='M'+(i+1);myTextEval='T'+(i+1);document.getElementById(myEval).style.zIndex=zKeeper[i];document.getElementById(myEval).style.top=vTopOff+"px";document.getElementById(myTextEval).style.top=(vTopOff+pusher)+"px";if((navigator.appName=="Microsoft Internet Explorer")&&runningWin){document.getElementById(myEval).className="normTabAlpha";if(document.getElementById(myTextEval).style.left||(document.getElementById(myTextEval).style.left!="-10px;")){document.getElementById("T1").style.marginLeft="-6px";document.getElementById("T2").style.marginLeft="-7px";document.getElementById("T3").style.marginLeft="-13px";document.getElementById("T4").style.marginLeft="6px";}}else{document.getElementById(myEval).className="normTab";document.getElementById("T1").style.marginLeft="-7px";document.getElementById("T2").style.marginLeft="-7px";document.getElementById("T3").style.marginLeft="-13px";document.getElementById("T4").style.marginLeft="13px";}}
if(whoAmI<99){document.getElementById(currentEval).style.top=vTopOn+"px";document.getElementById(currentTextEval).style.top=(vTopOn+pusher)+"px";if((navigator.appName=="Microsoft Internet Explorer")&&runningWin){document.getElementById(currentEval).className="overTabAlpha";}else{document.getElementById(currentEval).className="overTab";}}
for(var i=1;i<=zKeeper.length;i++){overEval='L'+i;document.getElementById(overEval).className="menuText";}
if(whoAmI<99){overEval='L'+whoAmI;document.getElementById(overEval).className="menuTextOn";}}
function topPushMeOut(whoAmI,userPress){if(whoAmI<99){currentEval='topM'+whoAmI;currentTextEval='topT'+whoAmI;lessMe=whoAmI-1;topzKeeper[lessMe]=2;for(var i=0;i<=topzKeeper.length;i++){if((topzKeeper[i]>document.getElementById(currentEval).style.zIndex)&&((i+1)!=whoAmI)){topzKeeper[i]=topzKeeper[i]-1;}}}
if((navigator.appName=="Microsoft Internet Explorer")&&runningWin){pusher=-3;}else{pusher=-2;}
for(var i=0;i<topzKeeper.length;i++){myEval='topM'+(i+1);myTextEval='topT'+(i+1);document.getElementById(myEval).style.zIndex=topzKeeper[i];document.getElementById(myEval).style.top=topvTopOff+"px";document.getElementById(myTextEval).style.top=(topvTopOff+pusher)+"px";if((navigator.appName=="Microsoft Internet Explorer")&&runningWin){document.getElementById(myEval).className="topNormTabAlpha";if(document.getElementById(myTextEval).style.left||(document.getElementById(myTextEval).style.left!="-10px;")){document.getElementById("topT1").style.marginLeft="-13px";document.getElementById("topT2").style.marginLeft="9px";}}else{document.getElementById(myEval).className="topNormTab";document.getElementById("topT1").style.marginLeft="-14px";document.getElementById("topT2").style.marginLeft="19px";}}
if(whoAmI<99){document.getElementById(currentEval).style.top=topvTopOn+"px";document.getElementById(currentTextEval).style.top=(topvTopOn+pusher)+"px";if((navigator.appName=="Microsoft Internet Explorer")&&runningWin){document.getElementById(currentEval).className="topOverTabAlpha";}else{document.getElementById(currentEval).className="topOverTab";}}
for(var i=1;i<=topzKeeper.length;i++){overEval='topL'+i;document.getElementById(overEval).className="topMenuText";}
if(whoAmI<99){overEval='topL'+whoAmI;document.getElementById(overEval).className="topMenuTextOn";}}
function confirmDelete(loc){if(confirm("Are you sure you would like to delete this listing?")){window.location=loc;}}
var x=null;var xSet=false;function setActiveName(nameToSet){if(navigator.appName=="Netscape"){x=document.getElementById(nameToSet).contentDocument;}else{x=eval(nameToSet+".document");}}
function Init(myName){setActiveName(myName);x.designMode='On';xSet=true;}
function setContent(theContent,myName){setActiveName(myName);x.body.style.fontFamily="Verdana"
x.body.style.fontSize="11px"
x.body.bgColor="";x.body.text='#000000';x.body.innerHTML=theContent;}
function postIt(textareaName,myName){setActiveName(myName);document.getElementById(textareaName).value=x.body.innerHTML;}
function boldIt(myName){setActiveName(myName);x.execCommand('bold',false,null);}
function italIt(myName){setActiveName(myName);x.execCommand('italic',false,null);}
function ordListIt(myName){setActiveName(myName);x.execCommand('insertorderedlist',false,null);}
function bulListIt(myName){setActiveName(myName);x.execCommand('insertunorderedlist',false,null);}
function linkIt(myName){setActiveName(myName);if(navigator.appName=="Netscape"){var szURL=prompt("URL (ex. http://www.google.com)","");x.execCommand('createlink',false,szURL);}else{x.execCommand('CreateLink');}}
function ajaxUploads(techID){if(techID=='0'){alert('In order to add images. You must first submit the copy to the database.');}else{Effect.toggle('downloadDiv','appear');$('linkImages').fade();}}
function linkImages(techID,WYName){if(techID=='0'){alert('In order to add images. You must first submit the copy to the database.');}else{Effect.toggle('linkImages','appear');$('downloadDiv').fade();new Ajax.Updater('imageWrap','includes/linkImages.php?id='+techID+'&WYName='+WYName,{method:'get'});}}
function AddLink(myName,imagePath){setActiveName(myName);$('linkImages').fade();if(navigator.appName=="Netscape"){var szURL='http://www.kawasaki.ca/flx/technologyImages/picDirLarge/'+imagePath
x.execCommand('createlink',false,szURL);}else{x.execCommand('CreateLink');}}
function removeLink(myName){setActiveName(myName);if(navigator.appName=="Netscape"){x.execCommand('Unlink',false,'null');}else{x.execCommand('Unlink');}}
function deleteTech(id){new Ajax.Request('includes/deleteTechImage.php',{method:'get',parameters:{id:id},onSuccess:function(t){tech='techImage_'+id
$(tech).fade();},onFailure:function(t){response='Error code 10002x1';}});}
function selOn(ctrl){ctrl.style.borderColor='#000000';ctrl.style.backgroundColor='#B5BED6';ctrl.style.cursor='hand';}
function selOff(ctrl){ctrl.style.borderColor='#ECE9D8';ctrl.style.backgroundColor='#ECE9D8';}
function selDown(ctrl){ctrl.style.backgroundColor='#8492B5';}
function selUp(ctrl){ctrl.style.backgroundColor='#B5BED6';}
function addToList(listField,newText,newValue){if((newValue=="")||(newText=="")){alert("You cannot add blank values!");}else{var len=listField.length++;listField.options[len].value=newValue;listField.options[len].text=newText;listField.selectedIndex=len;}}
function removeFromList(listField){if(listField.length==-1){alert("There are no values which can be removed!");}else if(listField.options[listField.selectedIndex].text==""){alert("You cannot remove blank values!");}else{var selected=listField.selectedIndex;if(selected==-1){alert("You must select an entry to be removed!");}else{var replaceTextArray=new Array(listField.length-1);var replaceValueArray=new Array(listField.length-1);for(var i=0;i<listField.length;i++){if(i<selected){replaceTextArray[i]=listField.options[i].text;}
if(i>selected){replaceTextArray[i-1]=listField.options[i].text;}
if(i<selected){replaceValueArray[i]=listField.options[i].value;}
if(i>selected){replaceValueArray[i-1]=listField.options[i].value;}}
listField.length=replaceTextArray.length;for(i=0;i<replaceTextArray.length;i++){listField.options[i].value=replaceValueArray[i];listField.options[i].text=replaceTextArray[i];}}}}
function moveUpList(listField){if(listField.length==-1){alert("There are no values which can be moved!");}else{var selected=listField.selectedIndex;if(selected==-1){alert("You must select an entry to be moved!");}else{if(listField.length==0){alert("There is only one entry!\nThe one entry will remain in place.");}else{if(selected==0){alert("The first entry in the list cannot be moved up.");}else{var moveText1=listField[selected-1].text;var moveText2=listField[selected].text;var moveValue1=listField[selected-1].value;var moveValue2=listField[selected].value;listField[selected].text=moveText1;listField[selected].value=moveValue1;listField[selected-1].text=moveText2;listField[selected-1].value=moveValue2;listField.selectedIndex=selected-1;}}}}}
function moveDownList(listField){if(listField.length==-1){alert("There are no values which can be moved!");}else{var selected=listField.selectedIndex;if(selected==-1){alert("You must select an entry to be moved!");}else{if(listField.length==0){alert("There is only one entry!\nThe one entry will remain in place.");}else{if(selected==listField.length-1){alert("The last entry in the list cannot be moved down.");}else{var moveText1=listField[selected+1].text;var moveText2=listField[selected].text;var moveValue1=listField[selected+1].value;var moveValue2=listField[selected].value;listField[selected].text=moveText1;listField[selected].value=moveValue1;listField[selected+1].text=moveText2;listField[selected+1].value=moveValue2;listField.selectedIndex=selected+1;}}}}}
function submitBuckets(textfieldName,listField1){var len1=listField1.length;var buck1="";for(i=0;i<len1;i++){buck1+=listField1.options[i].value;}
document.getElementById(textfieldName).value=buck1.substring(1);}