Guest User

Untitled

a guest
Feb 21st, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.34 KB | None | 0 0
  1. INDEX
  2.  
  3.  
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  5. <html>
  6. <head>
  7.     <title>Index</title>
  8.     <link type="text/css" href="styles.css" rel="stylesheet" id="stylesheet"/>
  9.    
  10.     <script language="JavaScript">
  11.     function getStyle()
  12.     {
  13.         return getStyleFile(getStyleIndex());
  14.     }
  15.     function getStyleIndex()
  16.     {
  17.         var styleIndex = 0;
  18.    
  19.         var cookiesArr=document.cookie.split(";");
  20.         for (var i = 0; i < cookiesArr.length; i++)
  21.         {
  22.             var cname = cookiesArr[i].substr(0, cookiesArr[i].indexOf("="));
  23.             var cvalue = cookiesArr[i].substr(cookiesArr[i].indexOf("=") + 1);
  24.             if (cname.replace(/^\s+|\s+$/g,"") == "style" && cvalue != null)
  25.             {
  26.                 styleIndex = parseInt(cvalue);
  27.             }
  28.         }
  29.        
  30.         return styleIndex;
  31.     }
  32.    
  33.     function getStyleFile(index)
  34.     {
  35.         switch(index)
  36.         {
  37.         case 1:
  38.             return 'styles2.css';
  39.         break;
  40.         default:
  41.             return 'styles.css';
  42.         break;
  43.         }
  44.     }
  45.    
  46.     function setStyle(style)
  47.     {
  48.         //alert(style);
  49.  
  50.         menu.document.getElementById('stylesheet').href = style;
  51.         main.document.getElementById('stylesheet').href = style;
  52.     }  
  53.     function selectStyle(index)
  54.     {
  55.         var exdate = new Date();
  56.         exdate.setDate(exdate.getDate() + 1000);
  57.         var c_value = escape(index) + "; expires=" + exdate.toUTCString();
  58.         document.cookie = "style" + "=" + c_value;
  59.    
  60.         setStyle(getStyleFile(index));
  61.     }
  62. </script>
  63. </head>
  64.  
  65. <frameset rows="30%,70%" id="frames">
  66.    <frame src="menu.htm" name="menu" />
  67.    <frame src="main.htm" name="main" />
  68. </frameset>
  69.  
  70. </html>
  71.  
  72.  
  73.  
  74. MENU
  75.  
  76.  
  77. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  78.  
  79. <html>
  80. <head>
  81. <script language="JavaScript">
  82. //clock code
  83.  
  84. var statclock=false;//allows normal ststus bar
  85. function clock() {
  86.     function pad(u){
  87.         if (u<10) u="0"+u;return u};//all 2-digit numbers
  88.     var now = new Date();
  89.     var hh = now.getHours();h=hh;if (hh>12) h=hh-12;
  90.     var mm = now.getMinutes();
  91.     var ss = now.getSeconds();ss=pad(ss);
  92.     if (statclock) window.status="The time is "+mm+" minutes past "+h;  //after mouseclick
  93.     running=window.setTimeout("clock();",1000);//renew each sec
  94.     hh=pad(hh);mm=pad(mm);
  95.     document.display.time.value=hh+":"+mm+":"+ss;
  96.     }
  97.  
  98. window.onload = function() {
  99.     var index = parent.getStyleIndex();
  100.     document.getElementById('colours').selectedIndex = index;
  101.     parent.selectStyle(index);
  102.    
  103.     clock();
  104. }
  105. </script>
  106.  
  107. <link type="text/css" href="styles.css" rel="stylesheet" id="stylesheet"/>
  108.  
  109. <style type="text/css">
  110. h1{text-align : left}
  111. </style>
  112.  
  113.  
  114. <title>Menu</title>
  115. </head>
  116. <body>
  117.  
  118. <h1>Menu</h1>
  119. <a href="home.html" target="main">Home</a>
  120. </br>
  121.  
  122. <a href="about.html" target="main">About</a>
  123. </br>
  124.  
  125. <a href="johnlb.html" target="main">John Logie Baird</a>
  126. </br>
  127.  
  128. <form name="display">
  129. <p>The time is:</p>
  130. <input size="8" name="time" type="text">
  131. </form>
  132.  
  133. <p>Change the theme:</p>
  134. <select id="colours" name="colours" onchange="parent.selectStyle(this.selectedIndex);">
  135.     <option>Normal</option>
  136.     <option>Red</option>
  137. </select>
  138.  
  139. </body>
  140. </html>
  141.  
  142.  
  143.  
  144. MAIN
  145.  
  146.  
  147. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  148. <html>
  149. <head>
  150.     <title>Index</title>
  151.     <link type="text/css" href="styles.css" rel="stylesheet" id="stylesheet"/>
  152.    
  153.     <script language="JavaScript">
  154.     window.onload = function() {
  155.         var index = parent.getStyleIndex();
  156.         parent.selectStyle(index);
  157.     }
  158.     </script>
  159. </head>
  160.  
  161. <body>
  162.     Test
  163. </body>
  164.  
  165. </html>
Add Comment
Please, Sign In to add comment