📄 script.js
字号:
// Version: 2.1
// Function: expdate
// Purpose: Calculates the Expiration Date for the cookie
function expdate() {
var today = new Date();
var expr = new Date( today.getTime() + 8294400000 );
return expr.toGMTString();
}
// Function: SetCookie
// Purpose: Write the cookie, available for the whole site and
// and availability for one year
function SetCookie( strValue ) {
// alert( "Current cookie: " + document.cookie );
document.cookie = "Frames=" + strValue + "; PATH = /; expires=" + expdate();
// alert( "New cookie: " + document.cookie );
}
// Function: Init
// Purpose: Initialise the lot.
function Init() {
var strNav = "nav_home.html";
var str = location.search;
var pos = str.indexOf("?");
if (pos != -1) {
strNav = str.substring(pos + 1);
pos = strNav.indexOf("+");
if ( pos != -1 ) {
strNav = strNav.substring(0, pos) + "?" + strNav.substring(pos + 1);
}
}
SetCookie("on");
return( strNav )
}
// Function: footer
// Purpose: Writes bottomline on the mainpages. If frames are not enabled
// it adds a link to the homepage and a message that the website
// should be viewed with a frames enabled browser
function footer() {
var strHRef = location.href
document.write('<hr>');
if (document.cookie != "Frames=on" ) {
document.write( '<a href="frm_top.html" target=top CLASS=Logo><img src=images/AQFOOT.jpg></a> | ' );
}
document.write( 'Last modified: ' + document.fileModifiedDate,
' by <a name=webmaster>' );
if ( strHRef.indexOf("contact") == -1 ){
document.write('<a href=contact.html>M. v.d. Steenoven</a></a>.' );
} else {
document.write('M. v.d. Steenoven</a>.' );
}
if (document.cookie != "Frames=on" ) {
document.write('<br><small><i>This site is best viewed with a frames enabled browser.</i></small>');
}
}
// Function: CheckFrame
// Purpose: Used in the main-pages to check if the page is viewed in frames.
// If not, then the cookie is checked if Frames are enabled and
// the page is relocated.
function CheckFrame( str ) {
if( top == self ) {
if ( document.cookie != 'Frames=off' ) {
if( !str ) {
// alert( "Relocating" );
self.location.href = "default.html";
} else {
// alert( "Relocating?" + str );
self.location.href = "default.html?" + str;
}
}
}
}
// Function: SubFrame
// Purpose: Used in navigator-pages to open the main-page in parallel
function SubFrame( strMain ) {
var str = location.search;
var pos = str.indexOf("?");
if ( !strMain ) strMain = "main.html"; // just an default value
if (pos != -1) {
strMain = str.substring( pos + 1 );
// alert( 'SubFrame parameter: ' + strMain );
}
if( top == self ) {
CheckFrame();
} else {
window.open( strMain,"main" );
}
}
// End of file: script.js
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -