////////////////////////////////////////////////////////////////////////////////////////// // g4LoadPage.js // // Author: Dovie Gelerinter // // Created: Dec. 11, 2003 // // This script will be modified and the state will be removed from the parameter list // // of the function load_page once this is set in place since you will obtain the state // // from the profile information. // ////////////////////////////////////////////////////////////////////////////////////////// // This one is specific to GRADE 4 MATHEMATICS 2004 StatePages = new Array(); // Elements of these arrays should be strings representing the page numbers of pages that // have special versions for the associated states. StatePages["AL"] = new Array(); StatePages["AZ"] = new Array(); StatePages["IL"] = new Array(); StatePages["IN"] = new Array('002a','002b','002c','002d','002f','060a','060b','060c','060d','060f','112','113','122a','122b','122c','122d','122f','188a','188b','188c','188d','188f','244','245','254a','254b','254c','254f','312a','312b','312c','312f','354','355','364a','364b','364c','364d','364f','432a','432b','432c','432d','432f','488','489','498a','498b','498c','498d','498f','560a','560b','560c','560d','560f','622a','622b','622c','622d','622f','686a','686b','686c','686f','index','t03','t11','t22','t24','t25','t26','t27','t28','t29','t30','t31','t32','t33','t34','t35','t36','title','xix','xv_xvi','xvii','xviii','standard'); StatePages["LA"] = new Array(); StatePages["MO"] = new Array(); StatePages["MA"] = new Array(); StatePages["MI"] = new Array(); StatePages["MD"] = new Array(); StatePages["NY"] = new Array(); StatePages["NJ"] = new Array(); StatePages["NC"] = new Array(); StatePages["OH"] = new Array(); StatePages["OK"] = new Array(); StatePages["PA"] = new Array(); StatePages["TN"] = new Array(); StatePages["VA"] = new Array(); StatePages["WV"] = new Array(); // This function takes a parameter of "state" which is a 2 character // string representing the user's state function load_page(state) { a = new Array(); a = location.href.split('/'); pagename = new Array(); pagename = a[a.length - 1].split('.'); var pagenum = pagename[0]; var phsn_StateCode = state; // This variable tracks whether or not a page has been found and loaded yet. var found = "no"; // Check the appropriate state's array to find out if this is a special page. if(StatePages[phsn_StateCode]){ for(var j=0; j < StatePages[phsn_StateCode].length; j++){ // If it is a special page, send the user there. if(StatePages[phsn_StateCode][j] == pagenum){ var str = pagenum + "_" + phsn_StateCode + ".html"; location.href = str; found = "yes"; break; }// end of if(StatePages[phsn_StateCode][j] == pg) }// end of for(var j=0; j < StatePages[phsn_StateCode].length; j++) } // If it wasn't a special page, send them to the national version of this page. if(found == "no"){ var str = pagenum + "_NT.html"; location.href = str; found = "yes"; } }