var tags;var guid=getParameter("guid");if(document.URL.indexOf("guid=")==-1){window.location="/en/experience/news/";}function setPermalink(){document.permalink.url.value=location.href;}function fbs_click(){u=location.href;t=document.title;window.open("http://www.dodge.com/en/experience/news/bounce.html?item="+encodeURIComponent("http://www.facebook.com/sharer.php?u=")+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");return false;}function delicious_click(){u=location.href;t=document.title;window.open("http://www.dodge.com/en/experience/news/bounce.html?item="+encodeURIComponent("http://del.icio.us/post?url=")+encodeURIComponent(u),"delicious");return false;}function digg_click(){var d=feeds.getArticleByGUID(guid);var f=new Element("div",{});f.setHTML(d.description);var e=f.getText().substring(0,150)+"...";u=location.href;t=document.title;window.open("http://www.dodge.com/en/experience/news/bounce.html?item="+encodeURIComponent("http://digg.com/submit?url="+u+"&bodytext="+e+"&title="+d.title+"&media=news&topic=autos"),"digg");return false;}function setFormValidationRequirements(b){if(!b){setTimeout("setFormValidationRequirements("+b+");",1000);return;}b.FromName.required="Your Name";b.FromAddress.required="Your Email Address";b.ToName.required="Your Friends Name";b.ToAddress.required="Your Friends Email Address";b.FromAddress.subtype="email";b.ToAddress.subtype="email";}function submitForm(){document.tellafriend.submit();}function submitTellaFriend(f){var h=feeds.getArticleByGUID(guid);var e=validateForm(f);$("form_messages").setStyle("display","none");if(e){var g="";g+="URLFail=/flash/forms/error.html";g+="&URLOK=/flash/forms/thankyou.html";g+="&URLTemplate=mailer%2Ftemplates%2Fsaf_by_parameters_nogreet.txt";g+="&params="+escape("&guid="+guid);g+="&Subject=Check This Out: "+h.title;g+="&bodytext=This message was sent from "+f.FromName.value+" <"+f.FromAddress.value+">.\nThis name and address were not verified.\n\n\n\nHI,\n\nI thought you might be interested in the following article I found on dodge.com.\n\n"+h.title+"\n\nTo read this article, go to:\nhttp://www.dodge.com/en/experience/news/articles/?guid="+guid+"\n\n\nFor More Dodge News, go to:\nhttp://www.dodge.com/en/experience/news/ \n\n\n\nThis e-mail was sent from www.dodge.com. Please do not reply to this e-mail as it is unmonitored.\n\nDodge e-mail Headquarters, 880 W. Long Lake Road, Troy MI 48098,(800) 946-0600";g+="&prelinktext=";g+="&salutation=";g+="&FromName="+f.FromName.value;g+="&ToName=";g+="&FromAddress="+f.FromAddress.value;g+="&ToAddress="+f.ToAddress.value;makePOSTRequest("/mailer/oo_mailer_encoding.jsp",g,"tellaFriendResult(http_request[i].responseXML, http_request[i].responseText)");submitClicked=false;f.ToAddress.value="";f.ToName.value="";}else{return false;}}function tellaFriendResult(f,d){var e=d.split("true");if(e[1]){$("form_messages").setHTML('<b>MESSAGE SENT</b> <br />Your friend will now get this article sent to them. Thanks for your interest.<br /><br /><a class="submitButton" href="javascript:void(0);" onclick="return closeMessage()">OK</a>');document.tellafriend.ToAddress.value="";}else{$("form_messages").setHTML('<b>ERROR</b> <br />We are unable to tell your friend about this article. Please make sure you have completed all of the required fields and try again.<br /><br /><a class="submitButton" href="javascript:void(0);" onclick="return closeMessage()">OK</a>');}$("form_messages").setStyle("display","block");$("tell_a_friend").setStyle("display","none");}function closeMessage(){$("form_messages").setStyle("display","none");$("tell_a_friend").setStyle("display","block");}function buildArticle(){if(!feeds.feedLoaded){setTimeout("buildArticle();",1000);return;}var d=feeds.getArticleByGUID(guid);var c="";if(d.source){c+='<h1 class="pr">PRESS RELEASE:</h1>';}if(d.pubDate){c+="<p>"+d.pubDate+"</p>";}if(d.title){c+="<h1>"+d.title+"</h1>";}if(d.enclosure){c+='<img src="'+d.enclosure+'" />';}c+='<div id="description">';c+=d.description;if(d.source){c+="<p><strong>Source:"+d.source+"</strong></p>";}c+="</div>";$("article_content").setHTML(c);buildRelatedSubjects(d);buildArticleLinks(d);buildRelatedLinks(d);setShareForms();}function buildRelatedSubjects(e){var g="";var h="/en/experience/news/archive/index.html?subject=";g+="<ul>";g+="<li><h2>Find Out About</h2></li>";for(var f in e.categories){if(typeof(e.categories)=="object"){if(feeds.tagTree.tagIsPublic(e.categories[f])){g+="<li><a href='"+h+e.categories[f]+"'>"+feeds.tagTree.getDisplayName(e.categories[f])+"</a></li>";}}}g+='<li><a href="/en/experience/news/archive/">See All Stories</a></li>';g+="</ul>";$("wrap_tags").setHTML(g);}function buildArticleLinks(e){var f="";f+="<ul>";f+="<li><h2>Also On This Site</h2></li>";for(var d in e.links){if(typeof(e.links[d])!="function"){f+=' <li><a href="'+e.links[d]["url"]+'" name="&amp;lpos=on_this_site">'+e.links[d]["name"]+"</a></li>";}}f+="</ul>";if(e.links.length>0){$("wrap_pages").setHTML(f);}}function buildRelatedLinks(q){var l="http://www.dodge.com/en/experience/news/articles/?guid=";var m=new Array();for(var j in q.categories){if(typeof(q.categories)=="object"){if(feeds.tagTree.tagIsPublic(q.categories[j])){m.merge(feeds.tagTree.getArticles(q.categories[j]));}}}var k=new Array();for(var n in m){if(typeof(feeds.feedItems[m[n]])=="object"){if(feeds.feedItems[m[n]].categories.contains("internal")){if(feeds.feedItems[m[n]]["guid"]!=guid){k.include(feeds.feedItems[m[n]]["guid"]);}}}}var p="";for(i=0;i<5;i++){if(typeof(k[i])=="string"){var o=feeds.getArticleByGUID(k[i]);p+='<li><a href="'+l+o.guid+'" name="&amp;lpos=related_stories"><p>'+o.title+"</p><br /><small>"+o.pubDate+"<br />"+o.source+"</small></a></li>";}}if(p!=""){$("related_stories_container").setHTML(p);}else{$("related_stories_container").setStyle("display","none");}}function setShareForms(){global.initAccordion("shareNews","div.shareNewsAccordion","a.shareNewsToggler",false,true);setFormValidationRequirements(document.tellafriend);setPermalink();$("tellafriend").addEvent("submit",function(b){submitTellaFriend(document.tellafriend);new Event(b).stop();});}onload_register("feeds.read('/en/experience/feeds/dodge-news-internal.xml');");onload_register("buildArticle()");
