// ============================================================================================= // WRITE AND READ DATA FOR THE SALARY MAP // ============================================================================================= function SMapWriteData(CityJsonString){ var SalaryMapJson = document.getElementById('SalaryMapJson'); if(CityJsonString.length > 0){ SalaryMapJson.value = CityJsonString; alert(SalaryMapJson.value); } } function SMapReadData(CityJsonString){ var SalaryMapJson = document.getElementById('SalaryMapJson'); alert(SalaryMapJson.value); } // ============================================================================================= // EDITABLE DATA SOURCE FOR THE SALARY MAP // ============================================================================================= // Editable Tables var TablesNums = new Array(); var TableCount = new Number(); var MethodCount = new Number(); var ValueCount = new Number(); function getTablesData(){ var JSONString = new String(); var JSONObject; var MapDataDiv = document.getElementById('MapDataDiv'); var BaseChild = new Number(0); var CellFactor = new Number(1); // Workaround to avoid blank spaces and new lines in Mozilla kind browsers if(parseInt(MapDataDiv.childNodes[0].nodeType) != 1){ BaseChild = 1; CellFactor = 2; } var AllCities = MapDataDiv.childNodes[BaseChild].childNodes[BaseChild].childNodes; var noCell = new String('[object Text]'); var All_M = new Array(); var All_V = new Array(); TableCount = 0; MethodCount = 0; ValueCount = 0; JSONString = '{'; for(var c = 0; c < AllCities.length; c++){ var str = new String(AllCities[c]); // Skip text elements if(str.indexOf(noCell) == -1){ var dataTables = AllCities[c].getElementsByTagName('table'); JSONString += '"dataTable_' + TableCount + '":['; TableCount++; var t = 0; while(t < 2){ var tBody = dataTables[t].childNodes[BaseChild]; JSONString += '{'; var tr = 0; while(tr < tBody.childNodes.length){ var trStr = new String(tBody.childNodes[tr]); if(trStr.indexOf(noCell) == -1){ JSONString += '"gMethods_' + MethodCount + '":"' + tBody.childNodes[tr].childNodes[BaseChild].innerHTML + '",'; // alert(tBody.childNodes[tr].childNodes[BaseChild].innerHTML); MethodCount++; } tr++; } JSONString = JSONString.substring(0, JSONString.length - 1); JSONString += '},'; tr = 0; JSONString += '{'; while(tr < tBody.childNodes.length){ var trStr = new String(tBody.childNodes[tr]); if(trStr.indexOf(noCell) == -1){ // alert(tBody.childNodes[tr].childNodes[BaseChild + CellFactor].innerHTML); JSONString += '"gValues_' + ValueCount + '":"' + tBody.childNodes[tr].childNodes[BaseChild + CellFactor].innerHTML + '",'; ValueCount++; } tr++; } JSONString = JSONString.substring(0, JSONString.length - 1); JSONString += '},'; t++; All_M.push(MethodCount); All_V.push(ValueCount); MethodCount = 0; ValueCount = 0; } JSONString = JSONString.substring(0, JSONString.length - 1); JSONString += '],'; } } JSONString = JSONString.substring(0, JSONString.length - 1); JSONString += '}'; JSONObject = eval('(' + JSONString + ')'); TablesNums.push(TableCount); TablesNums.push(All_M); TablesNums.push(JSONObject); return(TablesNums); } // ============================================================= // GA Variables: alternate vars // ============================================================= var GA_siteID = new String('UA-5935845-1'); var GA_siteDomain = new String('nea.org'); // ============================================================================================= // VARIABLES USED ON GA // ============================================================================================= var neanav = new String(); var neasearch = new String(); // ================================= // MM PAGE FUNCTIONS // ================================= var MM_mediaURL = new String(); var MM_None = new String('
YOUR BROWSER DO NOT HAVE ANY MEDIA PLAYER PLUGIN INSTALLED
'); var MM_Real = new String(); var MM_Quick = new String(); var MM_WinM = new String(); var MM_PlugIns = new Array(); function StopMedia(mediaType, movieName){ try{ var movie = document.getElementById(movieName); if(parseInt(mediaType) == 0) movie.SetVariable("stopS", 1); else if(parseInt(mediaType) == 1){ if(navigator.appName.indexOf("Microsoft") != -1){ neaVideoPlayer.stopVideo(); } else{ window.document.neaVideoPlayer.stopVideo(); } } } catch(err){ } } function MM_openLayer(linkType, mediaTitle, mediaReporter, mediaDesc, mediaDuration){ $("#mm_layer_shadow").css("display","block"); $("#vidlayer").css("display","block"); $("#mm_mediaTitle").text(mediaTitle); $("#mediaDesc").text(mediaDesc); $("#mediaReporter").html(mediaReporter); $("#mediaDuration").html(mediaDuration); document.getElementById('cMediaType').value = linkType; } function MM_closeLayer(){ if(pluginlist.indexOf('Flash') != -1){ if(parseInt(document.getElementById('cMediaType').value) == 0) StopMedia(0, 'neaAudioPlayer'); else if(parseInt(document.getElementById('cMediaType').value) == 1) StopMedia(1, 'neaVideoPlayer'); } $("#mm_layer_shadow").css("display","none"); $("#vidlayer").css("display","none"); } function MM_setMediaURL(mediaLink, mediaType, mediaDesc, mediaDuration, mediaReporter, mediaTitle){ var kWords = new Array('None', 'Windows Media Player', 'RealPlayer', 'QuickTime'); var kFound = 0; var i = new Number(); var inHtml = new String(); if(mediaLink != null && mediaLink != ''){ MM_mediaURL = mediaLink; var MM_None = new String('
YOUR BROWSER DO NOT HAVE ANY MEDIA PLAYER PLUGIN INSTALLED
'); var MM_Real = new String(''); var MM_Quick = new String(''); var MM_WinM = new String('

Error - the plugin has not loaded

'); var MM_PlugIns = new Array(MM_None, MM_WinM, MM_Real, MM_Quick); if(mediaType.toLowerCase() == 'audio'){ if(pluginlist.indexOf('Flash') != -1){ var so = new SWFObject("/assets/img/content/audioPlayer.swf", "neaAudioPlayer", "250", "40", "8"); so.addParam("swliveconnect", "true"); so.addVariable("MM_mediaURL", MM_mediaURL); so.write("mediaPlace"); MM_openLayer(0, mediaTitle, mediaReporter, mediaDesc, mediaDuration); } else{ while(i < kWords.length){ if(pluginlist.indexOf(kWords[i]) != -1){ //alert(MM_PlugIns[i]); //alert(document.getElementById('mediaPlace').innerHTML); inHtml = MM_PlugIns[i].toString(); document.getElementById('mediaPlace').innerHTML = inHtml; kFound = 1; break; } i++; } if(kFound == 0 && i >= kWords.length) $("#mediaPlace").html(MM_PlugIns[0]); } } } } // ========================================= // Search engine identification function // ========================================= function SetSearchID(cLocation){ var splitQMark = cLocation.split('?'); var url = new String(splitQMark[0].toLowerCase()); var params = new String(splitQMark[1]); var aplitHttp = url.split('http://'); var noHttp = new String(aplitHttp[1]); var stp = noHttp.split('/'); var breadCrumb = new String(); for(var i = 1; i < stp.length - 1; i++){ // 'Home' instead of 'Tools' or 'Grants' if(stp[i].toLowerCase() == 'tools' || stp[i].toLowerCase() == 'grants') breadCrumb += 'home/'; else breadCrumb += stp[i] + '/'; } // Filter search by type (params) var splitAmp = params.split('&'); for(var i = 0; i < splitAmp.length; i++){ var strParam = new String(splitAmp[i]); var stpEqual = strParam.split('='); if(params.indexOf('t') != -1){ if(stpEqual[1] == 'Lesson+Plan' || stpEqual[1] == 'Works4Me' || stpEqual[1] == 'Grant/Award'){ if(stpEqual[1] == 'Grant/Award'){ var strGA = new String(stpEqual[1]); var sptGA = strGA.split('/'); var strUnion = sptGA[0] + '&' + sptGA[1]; breadCrumb += strUnion + '/search'; } else breadCrumb += stpEqual[1] + '/search'; } } else{ breadCrumb += 'search'; break; } } return(breadCrumb); } // ============================================================= // Right Rail components identification function (used for GA) // ============================================================= var neamodule = new String(); function GenerateRrId(RRName, RRHeadLine){ var allHiddens = document.getElementsByTagName('input'); var compHiddens = new Array(); var idCounter = new Number(); var gotID = new String(); for(var i = 0; i < allHiddens.length; i++){ if(allHiddens[i].value == RRName){ idCounter++; } } gotID = RRName + '_' + idCounter + '/' + RRHeadLine; return(gotID); } // ==================================================== /* all NEA.org pages use nea.js */ var NEA = {}; // flash constructor NEA.Fla = function(file, h){ this.file = file; this.h = h; } NEA.Fla.prototype.place = 'banner'; // different ones, have to change these to .prototype // (and change usage below to point at the object instance) NEA.Fla.w = 960; NEA.Fla.path = ""; // collection of objects NEA.flash = { academy: new NEA.Fla("NEA_Academy_Flash.swf",184), assoc: new NEA.Fla("NEA_Association_Flash.swf",199), org: new NEA.Fla("/assets/img/template/NEA_org_Flash.swf",239), working: new NEA.Fla("NEA_Working_Flash.swf",184), tour: new NEA.Fla("NEA_Tour.swf",409), queue : [] } // different place NEA.flash['tour'].place = 'tour-swf'; // collect these from the calling page NEA.writeFlash = function(idx){ NEA.flash.queue[NEA.flash.queue.length] = idx; } NEA.png = {}; // courtesy of http://ajaxcookbook.org/png-alpha-transparency/ NEA.png.createPNGImage = function(src, width, height) { if (navigator.userAgent.indexOf("MSIE") != -1) { var element = document.createElement("div"); element.style.filter = "progid:DXImageTransform.Microsoft." + "AlphaImageLoader(src='" + src + "')"; // element.style.filters(1) = "DXImageTransform.Microsoft.Alpha".Opacity[50]; } else { var element = document.createElement("img"); element.src = src; } element.style.width = width + "px"; element.style.height = height + "px"; return element; } NEA.video = {}; NEA.video.art = { path: "_res/images/design/", icon: "icon-play.png", loading: "icon-load.gif" }; NEA.video.txt = { close: '
(close)
', mask: '
', box: '

Loading... Loading...

' } NEA.video.set = function(item,tag){ $(item).hover(function(){ $(item).find(tag).addClass('play-over'); },function(){ $(item).find(tag).removeClass('play-over'); }) }; NEA.video.get = function(obj){ $.ajax({ type: "GET", url: $(obj).attr('href'), timeout : 2000, global : false, data : encodeURI(new Date()), // prevent cache error: function(){ $('#icon-load').empty().append('Loading movie failed. If this continues, please contact NEA for assistance.').addClass('vid-error').append(NEA.video.txt.close); }, success: function(data){ //$('#vidlayer').fadeTo("fast",0.5) // broken in 1.1.3 in IE $('#icon-load').remove(); $('#vidbox').html(data); $('#btn-close').click(function(){ NEA.video.close(); }) } }); }; NEA.video.close = function(){ $('#vidlayer').remove(); $('#vidbox').remove(); }; NEA.video.addLayer = function(obj){ $('body').append(NEA.video.txt.mask).append(NEA.video.txt.box).find('#vidbox #icon-load').append(NEA.video.txt.close); $('#vidbox').css('top',$().scrollTop() + 20 + 'px'); NEA.video.get(obj); }; $(document).ready(function(){ // ************* all pages // this inserts an empty div to allow dual bg colors $('body').prepend("
<\/div>"); // better styles on HRs $('hr').wrap('
<\/div>'); // remove hr blurb from blurb page where it interferes // note: should not do this type of browser detection, really if (!(parseInt($.browser.version) < 6 && $.browser.msie == true)) { $('.drill hr.blurb').parents("div.hr").remove(); } else { // ie5 only fix for width of nav drop-downs $('link').each(function(){ if ($(this).attr('href').indexOf('academy.css') != -1) { $('body').addClass('academy'); } }) } // last list item cleanup (UI only touch) $("#nav-main li:last-child").addClass("last"); $("#site-info li:last-child").addClass("last"); $("#nav-section li:last-child").addClass("last"); // home pages only $('#content-col-a li:last-child a', $('body.home')).addClass('last'); $('#content-col-b li:last-child a', $('body.home')).addClass('last'); $('#content-rail li:last-child a', $('body.home')).addClass('last'); // all drills $('#nav-utils li:first-child a').addClass('last'); // VIDEO OVERLAYS // compliant browsers $('a.video').each(function(){ var src = $(this).find('img').attr('src'); $(this).find('img').attr('src',NEA.video.art.path + NEA.video.art.icon).addClass('play'); NEA.video.set(this,'img'); $(this).css('backgroundImage','url(' + src + ')').click(function(event){ NEA.video.addLayer(this); event.preventDefault(); }) }); // enable video overlays and pop-up layers for IE only if ($.browser.msie) { $('a.video img.play').remove(); var play = NEA.png.createPNGImage(NEA.video.art.path + NEA.video.art.icon, 57, 57); $('a.video').append(play).find('div').addClass('play') $('a.video').each(function(){ NEA.video.set(this,'div'); }) }; // init drop down menus for browsers which do not support LI hovers // if browser ie statement below not really needed except for testing w/ cc's removed /*@cc_on /*@if (@_jscript_version < 5.7) // ie6 and lower only if ($.browser.msie) { $("#nav-main > li").hover(function(){ $(this).addClass("o"); },function(){ $(this).removeClass("o"); }) } // browsers which don't support child selectors $('#nav-section .sub > a.on').addClass("on-sub"); // handle headers post-blurb $('#content-blurb + h2').addClass('post-blurb'); $('hr.blurb + h2').addClass('post-blurb'); $('#content-blurb + img + h2').addClass('post-img'); // http://www.mister-pixel.com/#Content__state=is_that_simple try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {} /*@end @*/ // test for and activate tabs var tabs = false; if ($('#tab-1').get(0)){ // test for tab script $('#tab-1').tabs(); $('#tab-1 li:gt(0)').addClass('no-edge'); tabs = true; }; // only resize content div height if not on a tab page if (!tabs) { var sectionHeight = 0; var contentHeight = 0; $("#nav-section>li").each(function(){ sectionHeight += $(this).height(); }); contentHeight = $('#content-cols').height(); if (contentHeight < sectionHeight) { sectionHeight = sectionHeight - contentHeight; sectionHeight = contentHeight + sectionHeight; $('#content-cols').css('height',sectionHeight); } } $('a[@rel=external]').after(' '); // Flash objects must be written to the page after the DOM mods or IE6 doesn't fire // jQuery document.ready event /// THEREFORE THIS IF STATEMENT MUST BE LAST IN THE READY BLOCK!!! if (NEA.flash.queue.length > 0) { var x = 0; while (x < NEA.flash.queue.length) { var fla = new SWFObject(NEA.Fla.path + NEA.flash[NEA.flash.queue[x]].file, 'flash'+x, NEA.Fla.w, NEA.flash[NEA.flash.queue[x]].h, '8'); fla.addParam('wmode','transparent'); fla.write(NEA.flash[NEA.flash.queue[x]].place); x++; } } }); /** * From the dimensions plugin: not including the whole thing, too much for too little, but thanks guys * Returns how many pixels the user has scrolled to the bottom (scrollTop). * Works on containers with overflow: auto and window/document. * * @example $("#testdiv").scrollTop() * @result 100 * * @name scrollTop * @type Number * @cat Plugins/Dimensions */ jQuery.fn.scrollTop = function() { if ( this[0] == window || this[0] == document ) return self.pageYOffset || jQuery.boxModel && document.documentElement.scrollTop || document.body.scrollTop; return this[0].scrollTop; }; /* Oshyn side... */ function TopMarginZ(div){ var contentRail = document.getElementById(div); contentRail.setAttribute('style', 'margin-top:0px;'); contentRail.style.marginTop = '0px'; } function LessonsSubmit(doReplace, CatLink){ var CurrentURL = new String(document.location); var form = document.getElementById('LessonsCats'); var spt = CurrentURL.split('?'); var EncCat = new String(escape(CatLink.innerHTML)); var url = spt[0] + '?opt1=' + EncCat; if(doReplace == true) document.location.replace(url); else document.location = url; } function CategorySubmit(doReplace, CatLink){ var CurrentURL = new String(document.location); var form = document.getElementById('LessonsCats'); var EncCat = new String(escape(CatLink.innerHTML)); if(CurrentURL.indexOf('&opt2') != -1){ var spt = CurrentURL.split('&opt2'); CurrentURL = spt[0]; } CurrentURL += '&opt2=' + EncCat; if(doReplace == true) document.location.replace(CurrentURL); else document.location = CurrentURL; } // ====== EMAIL A FRIEND ===== function openEmailAFriend(){ $("#emailAFriedbox").css("display","block"); $("#emailAFriedlayer").css("display","block"); $("#articleUrl").val(window.location); $("#senderRedirect").val(window.location); } function openEmailAFriendConfirmation(){ $("#emailAFriedbox").css("display","none"); $("#emailAFriedboxConfirmation").css("display","block"); $("#emailAFriedlayer").css("display","block"); } function closeEmailAFriend(){ $("#emailAFriedbox").css("display","none"); $("#emailAFriedlayer").css("display","none"); $("#emailAFriedboxConfirmation").css("display","none"); } function checkRequired(){ if ($("#senderEmail").val() == '') { //alert("Please put a your email address"); $("#senderEmail").css("background","#FFFFA0"); return false; }else { $("#senderEmail").css("background","#FFFFFF"); } if ($("#senderFriend").val() == '') { //alert("Please put your friend email address"); $("#senderFriend").css("background","#FFFFA0"); return false; }else { $("#senderFriend").css("background","#FFFFFF"); } return true; } $(document).ready(function(){ $("#emailAFriendForm").submit(function(){ if (checkRequired()) { var submitUrl = $("#submitTo").val(); var senderFriendVal = $("#senderFriend").val(); var senderMessageVal = $("#senderMessage").val(); var senderEmailVal = $("#senderEmail").val(); var articleUrlVal = $("#articleUrl").val(); var mailTemplate = "

${senderEmail} thought you would be interested in the following article from the National Education Association

${senderMessage}

To View this article on the web, go to ${articleUrl}

"; //alert(submitUrl); $.post(submitUrl,{senderFriend: senderFriendVal, senderMessage: senderMessageVal, senderEmail: senderEmailVal, articleUrl: articleUrlVal, template: mailTemplate }, function(data) { //Thank you //alert("thank you"); openEmailAFriendConfirmation(); }); } return false; }); }); // ======END EMAIL A FRIEND ===== // ====== VIDEO PARTS ====== function forceRedraw(){ try{ var vp = document.getElementById("neaVideoPlayer").style; vp.display = "block"; } catch(err){ setTimeout('forceRedraw()', 100); } } function loadVideo(videoLoad,videoSkin,videoPlayer){ var so = new SWFObject(videoPlayer, "neaVideoPlayer", "330", "295", "9"); so.addParam("menu", "false"); if(videoLoad != null) so.addVariable("urlVideo", videoLoad); if(videoSkin!= null) so.addVariable("urlSkin", videoSkin); so.write("mediaPlace"); } function showVideo(title,description,reportBy,duration,video,skin,videoPlayer){ var nav_AppCodeName = new String(navigator.appCodeName); var nav_AppVersion = new String(navigator.appVersion); var nav_Platform = new String(navigator.platform); var mediaPlace = document.getElementById('mediaPlace'); var mediaError = new String('THE CURRENT VERSION OF FIREFOX IS KNOW THAT CAUSES FLASH ASSETS TO DO NOT DISPLAY ON INTEL BASED MACINTOSH COMPUTERS. PLEASE UPGRADE TO THE MOST RECENT VERSION OF FIREFOX

https://bugzilla.mozilla.org/show_bug.cgi?id=356694
'); nav_AppCodeName = nav_AppCodeName.toLowerCase(); nav_AppVersion = nav_AppVersion.toLowerCase(); nav_Platform = nav_Platform.toLowerCase(); // alert(nav_Platform.indexOf('macintel')); // alert(nav_AppVersion.indexOf('5.0')); // alert(nav_Platform.indexOf('macintel')); if(nav_AppCodeName.indexOf('mozilla') != -1 && nav_AppVersion.indexOf('5.0') != -1 && nav_Platform.indexOf('macintel') != -1){ mediaPlace.innerHTML = mediaError; MM_openLayer(1, title, reportBy, description, duration); } else{ loadVideo(video, skin, videoPlayer); MM_openLayer(1, title, reportBy, description, duration); } //loadVideo(video, skin, videoPlayer); //MM_openLayer(1, title, reportBy, description, duration); /* $("#vidbox").css("display","block"); $("#vidlayer").css("display","block"); $("#vid-title").text(title); $("#vid-description").text(description); $("#vid-reportByAndRest").html(reportBy); $("#vid-duration").html(duration); loadVideo(video,skin,videoPlayer); */ } function closeVideo(){ MM_closeLayer(); /* StopMedia(1, 'neaVideoPlayer'); $("#vidbox").css("display","none"); $("#vidlayer").css("display","none"); */ } function getVideoString(url,FMServer){ var lastSlash = url.lastIndexOf("/"); if (lastSlash == -1) return ""; var fileName = url.substr(lastSlash+1,url.length); var lastDot = fileName.lastIndexOf("."); if (lastDot == -1) return ""; var extension = fileName.substr(lastDot+1,fileName.length); var onlyFileName = fileName.substr(0,lastDot); if (extension.toLowerCase() == "flv") return FMServer + onlyFileName; else if (extension.toLowerCase() == "mp3") return FMServer + extension + ":" + onlyFileName; else if (extension.toLowerCase() == "mp4" || extension.toLowerCase() == "mov" || extension.toLowerCase() == "avi") return FMServer + extension + ":" + onlyFileName + "." + extension; else return "nop"; } // ====== END VIDEO PARTS ==== // ====== COMMENTS PART ====== function validateCommentForm(thisForm) { var hasError = false; with (thisForm) { if (txtName.value == null || txtName.value == "") { hasError = true; txtName.style.background='#FFFFA0'; } if (txtContent.value == null || txtContent.value == "") { hasError = true; txtContent.style.background='#FFFFA0'; } if (txtCode.value == null || txtCode.value == "") { hasError = true; txtCode.style.background='#FFFFA0'; } return !hasError; } } function SetContentName(coFilePath) { var urlPath = window.location.pathname; var varContent = document.getElementById('commentfile'); varContent.value = coFilePath; var varRedirect = document.getElementById('redirect'); varRedirect.value = urlPath; } // ====== END OF COMMENTS PART ====== // ====== RIGHT COGIX PART ========== function renderResults(results, server, place, name){ $("#pollbox").css("display","block"); $("#polllayer").css("display","block"); $("#poll-title").text('NEA Survey Results'); var resultsFrame = "" document.getElementById('resultsPlaceHolder').innerHTML = resultsFrame; } function renderContentResults(results){ $("#pollbox").css("display","block"); $("#polllayer").css("display","block"); $("#poll-title").text('NEA Survey Results'); var doc = document.getElementById("iframePoll").contentWindow.document; var xmlResults = doc.getElementById(results); var data = xmlResults.innerHTML; document.getElementById('resultsPlaceHolder').innerHTML = data; } function closeResults(){ $("#pollbox").css("display","none"); $("#polllayer").css("display","none"); } // ====== END OF COGIX PART ========== // ====== START STATE DROPDOWN ===== function validateStateForm(thisForm) { with (thisForm) { var errMsg1 = document.getElementById('errMsg1State'); errMsg1.firstChild.nodeValue= ''; var tar = ''; if (cbxState.value != null && cbxState.value != "" && cbxState.value != "Select a State") if (tar == 'new') window.open(cbxState.value); else window.location = cbxState.value; else errMsg1.firstChild.nodeValue= 'Please select a state.'; return false; } } function getStateName(categories) { var catName = ''; var tokens = categories.split(';'); for (i=0; i'); to = anchorText.lastIndexOf('<'); if (from+1 < to && from > -1 && to > -1) return anchorText.substr(from+1, to-from-1); } else if (attributeName = 'href') { from = anchorText.indexOf('href=\"') + 6; to = anchorText.indexOf('\"', from); if (from < to && from > -1 && to > -1) return anchorText.substr(from, to-from); } return ''; } function fillDropDown(locs) { var allStates = new Array(0); var i =0; // Clears the content of the dropdown. document.frmStates.cbxState.options.length = 0; // Ads default item into the dropdown. var oOption = document.createElement("OPTION"); oOption.text='Select a State'; oOption.value=''; oOption.selected = 'selected'; //document.frmStates.cbxState.add(oOption); try { document.frmStates.cbxState.add(new Option('Select a State', ''), null); } catch(e) { document.frmStates.cbxState.add(new Option('Select a State', '')); } for (i=0; i < locs.length; i++) { var state = locs[i]; var oOption = document.createElement("OPTION"); var stateName; var stateUrl; // Checks if a page is from RedDot CMS or regular link. if (state[0] != null && state[0] != '') stateName = getStateName(state[0]); else if (state[1].indexOf('http://') != -1) // If its regular link, check that it has 'http://' in order to add it. stateName = getAttributeFromAnchor('title', state[1]); //oOption.text = getAttributeFromAnchor('title', state[1]); // gets the destination URL from the page anchor. stateUrl = getAttributeFromAnchor('href', state[1]); // Ads the item into the dropdown only if a Stata was found. if (stateName != null && stateName != '') //if (oOption.text!= null && oOption.text != '') allStates.push(stateName + ';' + stateUrl); //document.frmStates.cbxState.add(oOption); } allStates.sort(); for (i=0; i < allStates.length; i++) { var parts = allStates[i].split(';'); var oOption = document.createElement("OPTION"); oOption.text = parts[0]; oOption.value = parts[1]; //document.frmStates.cbxState.add(oOption); try { document.frmStates.cbxState.add(new Option(parts[0], parts[1]), null); } catch(e) { document.frmStates.cbxState.add(new Option(parts[0], parts[1])); } } return false; } // ====== END STATE DROPDOWN ===== // ====== CF Form validation ===== function verifyPledgeForm(thisForm) { var hasError = false; with (thisForm) { if (planning.value == null || planning.value == "") { hasError = true; planning.style.background='#FFFFA0'; } if (name.value == null || name.value == "") { hasError = true; name.style.background='#FFFFA0'; } if (city.value == null || city.value == "") { hasError = true; city.style.background='#FFFFA0'; } if (state.value == null || state.value == "" || state.value == "Choose one") { hasError = true; state.style.background='#FFFFA0'; } return !hasError; } } // ============================================================= // Wizzard for JS RSS // ============================================================= function generateCode(basePath){ document.wizard.code.value = ""; if (document.wizard.target.checked){ document.wizard.code.value = '