var layerRef= ""; var styleSwitch = ""; function init( dType ) { if ( navigator.appName == "Netscape" ) { layerRef = "document.layers"; styleSwitch = ""; } else { layerRef = "document.all"; styleSwitch = ".style"; } //createMenuItems( dType ); } function showLayer( layerName ) { eval ( layerRef + '["' + layerName + '"]' + styleSwitch + '.visibility = "visible"' ); } function showPage() { if ( ( document.all["briefingSelection"].bSelection.selectedIndex - 1 ) >= 0 ) { document.location = "briefing.asp?Page=" + ( document.all["briefingSelection"].bSelection.selectedIndex - 1 ); } } function showArchivePage() { document.location = "archive.asp?Page=" + ( document.all["archiveSelection"].bSelection.selectedIndex - 1 ) } function setLinks( thePage ) { for ( var i=0; i<5; i++ ) { if ( i == thePage ) { document.all["pageLink" + i].onclick = null; document.all["pageLink" + i].onmouseover = null; document.all["pageLink" + i].onmouseout = null; document.all["pageLink" + i].style.color = "white"; document.all["pageLink" + i].style.backgroundColor = "#9cb59c"; document.all["pageLink" + i].style.cursor = "default"; } else { document.all["pageLink" + i].onclick = new Function( "showPage( " + i + " );" ); document.all["pageLink" + i].onmouseover = new Function( "changeColour( 3 );" ); document.all["pageLink" + i].onmouseout = new Function( "changeColour( 2 );" ); document.all["pageLink" + i].style.color = "darkGreen"; document.all["pageLink" + i].style.backgroundColor = "#9cb59c"; document.all["pageLink" + i].style.cursor = "hand"; } } } function initForumSubMenu( theMenu ) { for ( var i=0; i<4; i++ ) { if ( document.all["subMenu" + i] != null ) { if ( ( i == theMenu ) && !( ( i == 2 ) && ( document.all["subMenu" + i].innerText.indexOf( "Registration" ) > -1 ) ) ) { document.all["subMenu" + i].onclick = null; document.all["subMenu" + i].onmouseover = null; document.all["subMenu" + i].onmouseout = null; document.all["subMenu" + i].style.color = "white"; document.all["subMenu" + i].style.backgroundColor = "#9cb59c"; document.all["subMenu" + i].style.cursor = "default"; } else { if ( ( i == 2 ) && ( document.all["subMenu" + i].innerText.indexOf( "Registration" ) > -1 ) ) { document.all["subMenu" + i].onclick = new Function( "showForumPage( 3 );" ); } else { document.all["subMenu" + i].onclick = new Function( "showForumPage( " + i + " );" ); } document.all["subMenu" + i].onmouseover = new Function( "changeColour( 3 );" ); document.all["subMenu" + i].onmouseout = new Function( "changeColour( 2 );" ); document.all["subMenu" + i].style.color = "darkGreen"; document.all["subMenu" + i].style.backgroundColor = "#9cb59c"; document.all["subMenu" + i].style.cursor = "hand"; } } } if ( theMenu == 2 ) { initVotingTables(); } } function showForumPage( thePage ) { var pLoc = ''; if ( thePage == 0 ) { pLoc = "contribute.asp"; } else { if ( thePage == 1 ) { pLoc = "briefing.asp"; } else { pLoc = "links.asp"; } } document.location = pLoc; } //****************************************************************************************************** // MouseOver and MouseOut Methods //****************************************************************************************************** var objColours = new Array(); objColours[0] = "red"; objColours[1] = "white"; objColours[2] = "darkGreen"; objColours[3] = "yellow"; objColours[4] = "purple"; objColours[5] = "#026564"; function changeColour( id ) { window.event.srcElement.style.color = objColours[id]; } //****************************************************************************************************** // Methods for the Forum Voting Page //****************************************************************************************************** var currentVotes = new Array(); for ( var i=0; i<5; i++ ) { currentVotes[i] = 5; } var voteOptions = 11; var shadowVote = -1; var blankGif = new Image(); var voteGif = new Image(); var shadowGif = new Image(); blankGif.src = "images/blank.gif"; voteGif.src = "images/dot.gif"; shadowGif.src = "images/dotShadow.gif"; function showShadow( src ) { if( !src.contains( event.fromElement ) ) { shadowVote = parseInt( ( src.id ).substring( 5 ) ); qTable = parseInt( ( src.id ).substring( 4, 5 ) ); updateVotingTable( qTable ); } } function hideShadow( src ) { if( !src.contains( event.toElement ) ) { shadowVote = -1 qTable = parseInt( ( src.id ).substring( src.id.length - 1, src.id.length ) ); updateVotingTable( qTable ); } } function registerVote( src ) { qTable = parseInt( ( src.id ).substring( 4, 5 ) ); currentVotes[qTable] = parseInt( ( src.id ).substring( 5 ) ); updateVotingTable( qTable ); } function updateVotingTable( qTable ) { for ( var i=0; i 0 )? '|' : ''; document.voteForm.votes.value = document.voteForm.votes.value + delimiter + currentVotes[i]; } document.voteForm.submit(); return true; } var briefImages = new Array(); briefImages[0] = new Image(); briefImages[1] = new Image(); briefImages[0].src = "images/brief.gif"; briefImages[1].src = "images/brief_h.gif"; var forumImages = new Array(); forumImages[0] = new Image(); forumImages[1] = new Image(); forumImages[0].src = "images/forum.gif"; forumImages[1].src = "images/forum_h.gif"; var discImages = new Array(); discImages[0] = new Image(); discImages[1] = new Image(); discImages[0].src = "images/disc.gif"; discImages[1].src = "images/disc_h.gif"; var homeImages = new Array(); homeImages[0] = new Image(); homeImages[1] = new Image(); homeImages[0].src = "images/home.gif"; homeImages[1].src = "images/home_h.gif"; var archiveImages = new Array(); archiveImages[0] = new Image(); archiveImages[1] = new Image(); archiveImages[0].src = "images/archive.gif"; archiveImages[1].src = "images/archive_h.gif"; var otherImages = new Array(); otherImages[0] = new Image(); otherImages[1] = new Image(); otherImages[0].src = "images/otherforums.gif"; otherImages[1].src = "images/otherforums_h.gif"; function highlightMenuItem( theItem ) { if( !theItem.contains( event.fromElement ) ) { if ( ( theItem.id ).indexOf( "Brief" ) > -1 ) { document.all[theItem.id].src = briefImages[1].src; } if ( ( theItem.id ).indexOf( "Forum" ) > -1 ) { document.all[theItem.id].src = forumImages[1].src; } if ( ( theItem.id ).indexOf( "Disc" ) > -1 ) { document.all[theItem.id].src = discImages[1].src; } if ( ( theItem.id ).indexOf( "Home" ) > -1 ) { document.all[theItem.id].src = homeImages[1].src; } if ( ( theItem.id ).indexOf( "Archive" ) > -1 ) { document.all[theItem.id].src = archiveImages[1].src; } if ( ( theItem.id ).indexOf( "Other" ) > -1 ) { document.all[theItem.id].src = otherImages[1].src; } } } function dimMenuItem( theItem ) { if( !theItem.contains( event.toElement ) ) { if ( ( theItem.id ).indexOf( "Brief" ) > -1 ) { document.all[theItem.id].src = briefImages[0].src; } if ( ( theItem.id ).indexOf( "Forum" ) > -1 ) { document.all[theItem.id].src = forumImages[0].src; } if ( ( theItem.id ).indexOf( "Disc" ) > -1 ) { document.all[theItem.id].src = discImages[0].src; } if ( ( theItem.id ).indexOf( "Home" ) > -1 ) { document.all[theItem.id].src = homeImages[0].src; } if ( ( theItem.id ).indexOf( "Archive" ) > -1 ) { document.all[theItem.id].src = archiveImages[0].src; } if ( ( theItem.id ).indexOf( "Other" ) > -1 ) { document.all[theItem.id].src = otherImages[0].src; } } } function doNavigation( theItem ) { if ( ( theItem.id ).indexOf( "Contribution" ) > -1 ) { if ( parent.frames.length > 0 ) { parent.parent.location = "http://www.democracyforum.org.uk/briefing.asp"; } else { location = "http://www.democracyforum.org.uk/briefing.asp"; } } if ( ( theItem.id ).indexOf( "Briefing" ) > -1 ) { if ( parent.frames.length > 0 ) { parent.parent.location = "briefing.asp"; } else { location = "briefing.asp"; } } if ( ( theItem.id ).indexOf( "Links" ) > -1 ) { if ( parent.frames.length > 0 ) { parent.parent.location = "http://www.democracyforum.org.uk/edemocracy.asp"; } else { location = "http://www.democracyforum.org.uk/edemocracy.asp"; } } } function createMenuItems( dType ) { if ( document.all['menuHome'] != null ) { document.all['menuHome'].onmouseover = new Function( "highlightMenuItem( this );" ); document.all['menuHome'].onmouseout = new Function( "dimMenuItem( this );" ); document.all['menuHome'].onclick = new Function( "doNavigation( this );" ); document.all['menuHome'].style.cursor = "hand"; } else { document.all['menuOther'].onmouseover = new Function( "highlightMenuItem( this );" ); document.all['menuOther'].onmouseout = new Function( "dimMenuItem( this );" ); document.all['menuOther'].onclick = new Function( "doNavigation( this );" ); document.all['menuOther'].style.cursor = "hand"; } } var home_off; var home_on; var briefing_off; var briefing_on; var contribution_off; var contribution_on; var links_off; var links_on; var body1_off; var body1_on; var body2_off; var body2_on; var body3_off; var body3_on; function preloadMenuImages() { if ( document.images != null ){ home_off = new Image(); home_on = new Image(); briefing_off = new Image(); briefing_on = new Image(); contribution_off = new Image(); contribution_on = new Image(); links_off = new Image(); links_on = new Image(); home_off.src = "images/home_0.gif"; home_on.src = "images/home_1.gif"; briefing_off.src = "images/briefing_0.gif"; briefing_on.src = "images/briefing_1.gif"; contribution_off.src = "images/contribution_0.gif"; contribution_on.src = "images/contribution_1.gif"; links_off.src = "images/links_0.gif"; links_on.src = "images/links_1.gif"; } } function preloadHomeImages() { if ( document.images != null ){ home_off = new Image(); home_on = new Image(); home_off.src = "images/home_0.gif"; home_on.src = "images/home_1.gif"; body1_off = new Image(); body1_on = new Image(); body2_off = new Image(); body2_on = new Image(); body3_off = new Image(); body3_on = new Image(); body1_off.src = "images/body1_0.gif"; body1_on.src = "images/body1_1.gif"; body2_off.src = "images/body2_0.gif"; body2_on.src = "images/body2_1.gif"; body3_off.src = "images/body3_0.gif"; body3_on.src = "images/body3_1.gif"; } } function doMenuItemOver( theSrc ) { if ( document.images != null ) { if ( eval( theSrc + "_on" ) != null ) { if ( eval( theSrc + "_on" ).complete ) { document[theSrc].src = eval( theSrc + "_on.src" ); } } } } function doMenuItemOut( theSrc ) { if ( document.images != null ){ if ( eval( theSrc + "_off" ) != null ) { if ( eval( theSrc + "_off" ).complete ) { document[theSrc].src = eval( theSrc + "_off.src" ); } } } }