国慕尼黑啤酒节", "人物春秋*我所知道的胡乔木|自信些,迎接全球化|红与黑"); var mywork= new Array("",info,infoA); /************************************************************************************************
******/
function stringSplit ( string, delimiter ) { if ( string == null || string == "" ) { return null; } else if ( string.split != null ) { return string.split ( delimiter ); } else { var ar = new Array(); var i = 0; var start = 0; while( start >= 0 && start < string.length ) { var end = string.indexOf ( delimiter, start ) ; if( end >= 0 ) { ar[i++] = string.substring ( start, end ); start = end+1; } else { ar[i++] = string.substring ( start, string.length ); start = -1; } } return ar; } } /************************************************************************************************
******/ var menu1 = new Array(); var menu2 = new Array(); /************************************************************************************************
******/ function createMenus ( wh ) { var infoname = new Array(); infoname=mywork[wh]; for ( var i=0; i < infoname.length; i++ ) { menu1[i] = stringSplit ( infoname[i], '*' ); menu2[i] = stringSplit ( menu1[i][1], '|' ); }
var author = document.myForm.main; var book = document.myForm.title;
author.length = infoname.length; book.length = menu2[0].length; for ( var i=0; i < infoname.length; i++ ) { author.options[i].value = menu1[i][0]; author.options[i].text = menu1[i][0]; } document.myForm.main.selected = 0; for (var x=0; x < menu2[0].length; x++) { book.options[x].text = menu2[0][x]; book.options[x].value = menu2[0][x]; }