function in_array(needle,haystack) { // craig heydenburg 4/8/02 // this function is similar to the PHP function // of the same name function in_array(needle,haystack) var bool = false; for (var i=0; iMUSIC
'); } else if (story_url.indexOf('/arts/books') == 0) { document.write('BOOKS
'); } else if (story_url.indexOf('/arts/film') == 0) { document.write('FILM
'); } else if (story_url.indexOf('/arts/qa') == 0) { document.write('INTERVIEW
'); } else if (story_url.indexOf('/news/qa') == 0) { document.write('INTERVIEW
'); } else if (story_url.indexOf('/arts/feature') == 0) { document.write('FEATURE
'); } } function byline_title_by_url(story_url) { if (story_url.indexOf('/arts/music') == 0) { document.write('Music Review'); } else if (story_url.indexOf('/arts/books') == 0) { document.write('Book Review'); } else if (story_url.indexOf('/arts/film') == 0) { document.write('Film Review'); } else if (story_url.indexOf('/arts/qa') == 0) { document.write('Interviewed'); } else if (story_url.indexOf('/news/qa') == 0) { document.write('Interviewed'); } else if (story_url.indexOf('/commentary/fiore') == 0) { document.write('Cartoon'); } } function home_byline_title_by_url(story_url) { if (story_url.indexOf('/arts/music') == 0) { document.write('Music Review'); } else if (story_url.indexOf('/arts/books') == 0) { document.write('Book Review'); } else if (story_url.indexOf('/arts/film') == 0) { document.write('Film Review'); } else if (story_url.indexOf('/arts/qa') == 0) { document.write('Interview'); } else if (story_url.indexOf('/news/qa') == 0) { document.write('Interview'); } else if (story_url.indexOf('/commentary/fiore') == 0) { document.write('Cartoon'); } } function email_article () { var url = '/popups/getemailinfo_new.pl?url=' + window.location; EmailArticleWindow = window.open(url,'EmailArticleWindow','height=270,width=270'); } function print_article () { var url = '/cgi-bin/print_article.pl?url=' + window.location; PrintArticleWindow = window.open(url,'PrintArticleWindow'); } function validemail ( form ) { form.ema_signup_url.value = document.URL; var Reg = /(\w+)\@(\w+)\.(.+)/ ; if (!form.email.value.match(Reg)) { alert("Please enter a valid email address."); form.email.focus(); return false ; } return true ; } function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (2 < argc) ? argv[2] : null; var path = (3 < argc) ? argv[3] : null; var domain = (4 < argc) ? argv[4] : null; var secure = (5 < argc) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } function popunder() { if (document.location.hostname == "www.motherjones.com") { var expdate = new Date(); var visit; expdate.setTime(expdate.getTime() + (3 * 24 * 60 * 60 * 1000)); if(!(visit = GetCookie("visit"))) visit =0; if (visit == 0) { SetCookie("visit", 1, expdate, "/", ".motherjones.com", false); popwin=window.open('/popout.html','popWindow','width=640,height=700,resizable=no,scrollbars=auto,toolbar=no,location=no,directories=no,status=no,menubar=no'); popwin.blur(); window.focus(); } } }