try{if(typeof (window[_sns_isLoggedIn])=="undefined"){}}catch(e){window.location.reload();
}function msieversion(){var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE");
if(msie>0){return parseInt(ua.substring(msie+5,ua.indexOf(".",msie)));
}else{return 0;
}}function clearAndCheckAuth(elem){if(elem.value=="Type your own comment here"){elem.value="";
}if(_sns_isLoggedIn!=1){authForIE6(elem);
}}function displayNext(articleid,page){$j.ajax({type:"get",url:"/modules/article/comment_fetch-ajax.jsp?headline="+articleid+"&pg="+parseInt(page),success:function(data){var newhtml=data.substr(data.indexOf('<div id="art_cmt_usr">'),data.length);
$j("#art_cmt_usr").replaceWith(newhtml);
},error:function(errorData){alert("Please refresh the page to load comments...");
}});
}function postComment(articleid,revText){var cmt=$j("#art_write_inp_area").val();
var trimmed=cmt.replace(/^\s+|\s+$/g,"");
if(trimmed==""||trimmed=="Type your own comment here"){alert("Did you forget to fill your comment..");
return ;
}if(_sns_isLoggedIn==1){$j.ajax({type:"post",url:"/modules/article/comment_add_ack.jsp",cache:false,data:{add:"true",headline:articleid,revText:revText},success:function(data){if(data=="INVALID"){alert("Invalid content, your comment could not be posted");
}else{alert("your comment is posted!");
}var ua=window.navigator.userAgent;
if(ua.indexOf("MSIE")>0){window.location.reload();
return ;
}displayNext(articleid,1);
$j("#art_write_inp_area").val("Type your own comment here");
},error:function(errorData){alert("Internal Server Error. Please try again after some time!");
}});
}else{authForIE6(elem);
}}function authForIE6(elem){url=_SNS_URL+"/_cqr/login/login.psp?sitedomain="+sns_sitedomain+"&siteState="+desturl+"&authLev=1&lang=en&locale=us";
if(msieversion()==6){window.location.href=url;
}else{elem=$j("#art_write_inp_area");
if(elem.length>1){elem=$j($j(elem)[0]);
}toggleLayer("anchorImg","loginLayer",elem.offset().left-140,elem.offset().top,lu);
}}function reportAuthForIE6(elem){url=_SNS_URL+"/_cqr/login/login.psp?sitedomain="+sns_sitedomain+"&siteState="+desturl+"&authLev=1&lang=en&locale=us";
if(msieversion()==6){window.location.href=url;
}else{elem=$j("#id"+elem).parent(".meta").children(".art_cmt_out_rep");
if(elem.length>1){elem=$j($j(elem)[0]);
}toggleLayer("anchorImg","loginLayer",elem.offset().left-140,elem.offset().top,lu);
}}function reportThis(elem){if(_sns_isLoggedIn!=1){reportAuthForIE6(elem);
return ;
}var newhtml=$j("#id"+elem).parent(".art_cmt_out").html();
$j("#popupReport .box .meta").html(newhtml);
$j("#popupReport .box .meta").find(".art_cmt_out_rep").remove();
$j("#popupReport .box .meta").find(".name").remove();
var imgIcon=$j("#id"+elem).parent().parent().children(".image").html();
$j("#popupReport .box .rep_image").html(imgIcon);
centerPopup(elem);
loadPopup();
}var popupStatus=0;
function loadPopup(){if(popupStatus==0){$j("#backgroundPopup").css({opacity:"0.8"}).fadeIn("normal");
$j("#popupReport").css({"z-index":"9999"}).fadeIn("normal");
$j("#popupConfirm").fadeIn("normal");
if($j.browser.msie&&parseInt($j.browser.version)<=7){$j("#backgroundPopup").css({width:document.documentElement.clientWidth,height:document.body.clientHeight});
}$j("#reporter_info").fadeIn("fast");
popupStatus=1;
}}function disablePopup(){if(popupStatus==1){$j("#popupReport").css({height:"370px"});
$j("#popupMidbrdr").css({height:"370px"});
$j("#backgroundPopup").fadeOut("normal");
$j("#popupReport").fadeOut("normal");
$j("#popupConfirm").fadeOut("normal");
$j("#reportAck").html("");
popupStatus=0;
}}function centerPopup(index){var windowWidth=document.documentElement.clientWidth;
var windowHeight=document.documentElement.clientHeight;
var repHeight=$j("#id"+index).parent(".art_cmt_out").offset().top;
if(navigator.appName=="Microsoft Internet Explorer"){windowHeight=document.body.clientHeight;
}var popupHeight=$j("#popupReport").height();
var popupWidth=$j("#popupReport").width();
$j("#popupReport").css({position:"absolute",top:repHeight-62,left:(windowWidth/2-popupWidth/2)-300,height:popupHeight+23});
$j("#backgroundPopup").css({height:windowHeight,width:windowWidth});
$j("#popupBtmbrdr").css({top:popupHeight+47});
$j("#popupMidbrdr").css({height:popupHeight+47});
}function changeState(id,enable){$j(id).attr("disabled",!enable);
}function changeStateb(id,enable){$j(id).attr("disabled",enable);
}function reportViolation(){var v=$j("#popupReport .box .meta .screenname").val();
var clip=$j("#popupReport .box .meta .cmnt").html();
var reporter=$j("#popupReport #reporter").html();
var comment=$j("#reporterComment").val();
var id=$j("#popupReport .box .meta .cmntid").val();
var reviewuri=$j("#popupReport .box .meta .uri").val();
var asseturi=$j("#popupReport .box .meta .asseturi").val();
var application="Autos Articles";
$j.ajax({type:"post",url:"/modules/common/reportViolation.jsp",data:"reporter="+reporter+"&product=autosarticlecomments&violator="+v+"&reporter_comment="+escape(comment)+"&cmnt_id="+id+"&violating_clip="+escape(clip.replace(/%/g,"%25"))+"&violator_url="+window.location+"&reviewuri="+reviewuri+"&asseturi="+asseturi+"&application="+application,success:function(data){var success='<div class="text">Thank you for reporting this violation. Upon moderator\'s final approval appropriate action will be taken.</div><a href="javascript:;" onclick="disablePopup();" style="margin:25px 0px 5px 235px !important" class="cancelReport">Continue</a>';
$j("#reporter_info").css({display:"none"});
$j("#reportAck").html(success);
},error:function(errorData){var errorMsg='<div class="text">There\'s an internal server error. Your request couldn\'t be completed.</div><a href="javascript:;" onclick="disablePopup();" style="margin:25px 0px 5px 235px !important" class="cancelReport">Continue</a>';
$j("#reporter_info").css({display:"none"});
$j("#reportAck").html(errorMsg);
}});
}function getDateName(){var dayNames=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var now=new Date();
var getDt=dayNames[now.getDay()]+", "+monthNames[now.getMonth()]+" "+now.getDate()+", "+now.getFullYear();
return getDt;
}function __TABBLO_TPT_LOAD(){var getDate=getDateName();
Tabblo.embedded.sites.SettingsObject.preprocess.apply({Properties:{template:"news"},FixedContent:{logo:"http://o.aolcdn.com/art/ch_autos/autos_branding"},Content:{pagetitle:{match:"css",selector:"h1"},text:{match:"css",selector:"h1,.credit,.cdate,#articleTxt>p"}}},[]);
Tabblo.embedded.printabulous();
}function MakePDF(){var tpS=document.createElement("script");
tpS.setAttribute("type","text/javascript");
tpS.setAttribute("charset","utf-8");
tpS.setAttribute("src","http://h30405.www3.hp.com/edit/tptboot/1.0");
document.getElementsByTagName("body").item(0).appendChild(tpS);
}function pdfPrint(url){MakePDF();
}function switchFont(fVal){$j("#articleTxt").attr("class",fVal);
}$j(window).load(function(){$j("#comBubb").hover(function(obj){$j(this).addClass("comHov");
},function(){$j(this).removeClass("comHov");
});
$j("#art_opt_top_h").find(".art_size a").each(function(){$j(this).click(function(){switchFont($j(this).attr("name"));
$j(".art_size").find("a").removeClass("isActive");
$j(this).addClass("isActive");
return false;
});
});
$j("#art_size_v").mouseover(function(){$j(this).addClass("art_size_v");
}).mouseout(function(){$j(this).removeClass("art_size_v");
});
var tl=new Object;
tl.n=0,tl.c="smallText";
$j("#text_l").click(function(){var pObj=$j(this).parent();
if(tl.n==0){$j("#text_s").parent().attr("class","s_on");
tl.c="mediumText";
}else{if(tl.n==1){tl.c="largeText";
pObj.attr("class","l_off");
}else{if(tl.n==2){return false;
}}}switchFont(tl.c);
tl.n++;
return false;
}).parent().hover(function(){if($j(this).hasClass("l_on")){$j(this).addClass("l_hov");
}},function(){if($j(this).hasClass("l_on")){$j(this).removeClass("l_hov");
}});
$j("#text_s").click(function(){var pObj=$j(this).parent();
if(tl.n==2){$j("#text_l").parent().attr("class","l_on");
tl.c="mediumText";
}else{if(tl.n==1){tl.c="smallText";
pObj.attr("class","s_off");
}else{if(tl.n==0){return false;
}}}switchFont(tl.c);
tl.n--;
return false;
}).parent().hover(function(){if($j(this).hasClass("s_on")){$j(this).addClass("s_hov");
}},function(){if($j(this).hasClass("s_on")){$j(this).removeClass("s_hov");
}});
var authLnk=$j(".auth_link a","#artCredits").clone().text(" ");
$j(".auth_photo","#artCredits").wrapInner(authLnk).next().wrapInner(authLnk);
populateMakes();
$j("#a_selectedMake").bind("change",function(){new_populateModels();
});
$j("#b_selectedMake").bind("change",function(){used_populateModels();
});
$j("#articlePage .mmselect .newmms .btn_go").bind("click",function(){if(($j("#a_selectedMake").val()=="selectMake")||($j("#a_selectedModel").val()=="selectModel")){alert("Please select make and model");
return false;
}window.location="/cars-main-piranha-redirect.jsp?make="+$j("#a_selectedMake").val()+"&model="+$j("#a_selectedModel").val();
});
$j("#articlePage .mmselect .usedmms .btn_go").bind("click",function(){var zipRegex=new RegExp("(^\\d{5}$)");
if(($j("#b_selectedMake").val()=="selectMake")||($j("#b_selectedModel").val()=="selectModel")){alert("Please select make and model");
return false;
}if(!zipRegex.test($j("#search_zip").val())){alert("Invalid zip code");
return false;
}window.location="/used-listing-page.jsp?make1="+$j("#a_selectedMake").val()+"&model="+$j("#a_selectedModel").val()+"&location="+$j("#search_zip").val();
});
$j("#popupContactClose").click(function(){disablePopup();
});
$j("#backgroundPopup").click(function(){disablePopup();
});
$j(document).keypress(function(e){if(e.keyCode==27&&popupStatus==1){disablePopup();
}});
});
function populateMakes(){new_populateMakes();
used_populateMakes();
$j("#a_selectedModel").attr("disabled","disabled");
$j("#b_selectedModel").attr("disabled","disabled");
}function new_populateMakes(){var make;
var makeSel=$j("#a_selectedMake");
var makeArray=new Array();
for(make in makesToModels){makeArray.push(make);
}makeArray.sort();
for(var i=0;
i<makeArray.length;
i++){makeSel.append($j('<option value="'+makeArray[i]+'">'+makeArray[i]+"</option>"));
}}function new_populateModels(){var makeSel=$j("#a_selectedMake");
var modelSel=$j("#a_selectedModel");
selectedMake=makeSel.val();
var modelsArray=makesToModels[selectedMake];
if(selectedMake=="selectMake"){return ;
}modelSel.empty().append($j('<option value="selectModel" selected="selected">Select a Model *</option>'));
modelsArray.sort();
for(var i=0;
i<modelsArray.length;
i++){modelSel.append($j('<option value="'+modelsArray[i]+'">'+modelsArray[i]+"</option>"));
}modelSel.attr("disabled","");
}function used_populateMakes(){var make;
var makeSel=$j("#b_selectedMake");
var makeArray=new Array();
for(make in usedMakesToModels){makeArray.push(make);
}makeArray.sort();
for(var i=0;
i<makeArray.length;
i++){makeSel.append($j('<option value="'+makeArray[i]+'">'+makeArray[i]+"</option>"));
}}function used_populateModels(){var makeSel=$j("#b_selectedMake");
var modelSel=$j("#b_selectedModel");
selectedMake=makeSel.val();
var modelsArray=usedMakesToModels[selectedMake];
if(selectedMake=="selectMake"){return ;
}modelSel.empty().append($j('<option value="selectModel" selected="selected">Select a Model *</option>'));
modelsArray.sort();
for(var i=0;
i<modelsArray.length;
i++){modelSel.append($j('<option value="'+modelsArray[i]+'">'+modelsArray[i]+"</option>"));
}modelSel.attr("disabled","");
}