Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INDEX
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>Index</title>
- <link type="text/css" href="styles.css" rel="stylesheet" id="stylesheet"/>
- <script language="JavaScript">
- function getStyle()
- {
- return getStyleFile(getStyleIndex());
- }
- function getStyleIndex()
- {
- var styleIndex = 0;
- var cookiesArr=document.cookie.split(";");
- for (var i = 0; i < cookiesArr.length; i++)
- {
- var cname = cookiesArr[i].substr(0, cookiesArr[i].indexOf("="));
- var cvalue = cookiesArr[i].substr(cookiesArr[i].indexOf("=") + 1);
- if (cname.replace(/^\s+|\s+$/g,"") == "style" && cvalue != null)
- {
- styleIndex = parseInt(cvalue);
- }
- }
- return styleIndex;
- }
- function getStyleFile(index)
- {
- switch(index)
- {
- case 1:
- return 'styles2.css';
- break;
- default:
- return 'styles.css';
- break;
- }
- }
- function setStyle(style)
- {
- //alert(style);
- menu.document.getElementById('stylesheet').href = style;
- main.document.getElementById('stylesheet').href = style;
- }
- function selectStyle(index)
- {
- var exdate = new Date();
- exdate.setDate(exdate.getDate() + 1000);
- var c_value = escape(index) + "; expires=" + exdate.toUTCString();
- document.cookie = "style" + "=" + c_value;
- setStyle(getStyleFile(index));
- }
- </script>
- </head>
- <frameset rows="30%,70%" id="frames">
- <frame src="menu.htm" name="menu" />
- <frame src="main.htm" name="main" />
- </frameset>
- </html>
- MENU
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <script language="JavaScript">
- //clock code
- var statclock=false;//allows normal ststus bar
- function clock() {
- function pad(u){
- if (u<10) u="0"+u;return u};//all 2-digit numbers
- var now = new Date();
- var hh = now.getHours();h=hh;if (hh>12) h=hh-12;
- var mm = now.getMinutes();
- var ss = now.getSeconds();ss=pad(ss);
- if (statclock) window.status="The time is "+mm+" minutes past "+h; //after mouseclick
- running=window.setTimeout("clock();",1000);//renew each sec
- hh=pad(hh);mm=pad(mm);
- document.display.time.value=hh+":"+mm+":"+ss;
- }
- window.onload = function() {
- var index = parent.getStyleIndex();
- document.getElementById('colours').selectedIndex = index;
- parent.selectStyle(index);
- clock();
- }
- </script>
- <link type="text/css" href="styles.css" rel="stylesheet" id="stylesheet"/>
- <style type="text/css">
- h1{text-align : left}
- </style>
- <title>Menu</title>
- </head>
- <body>
- <h1>Menu</h1>
- <a href="home.html" target="main">Home</a>
- </br>
- <a href="about.html" target="main">About</a>
- </br>
- <a href="johnlb.html" target="main">John Logie Baird</a>
- </br>
- <form name="display">
- <p>The time is:</p>
- <input size="8" name="time" type="text">
- </form>
- <p>Change the theme:</p>
- <select id="colours" name="colours" onchange="parent.selectStyle(this.selectedIndex);">
- <option>Normal</option>
- <option>Red</option>
- </select>
- </body>
- </html>
- MAIN
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>Index</title>
- <link type="text/css" href="styles.css" rel="stylesheet" id="stylesheet"/>
- <script language="JavaScript">
- window.onload = function() {
- var index = parent.getStyleIndex();
- parent.selectStyle(index);
- }
- </script>
- </head>
- <body>
- Test
- </body>
- </html>
Add Comment
Please, Sign In to add comment