/////////////////////////////////////////////////////////////////// // Description: Adapted javascript for watermark logo with hidden feature // // Copyright (c) 2005 W. Van Hooste // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // License type: MIT License // Contact: ragnar@lodbrok.be // References: // This code is available from : http://www.lodbrok.be/ // Original concept : Site Logo Script (Geocities Watermark) // Redistributed code : Dynamic Drive // // Version: // 0.1.0 20050501 W. Van Hooste // // NOTE: Pop-up blocking must be disabled for the hidden feature to work! /////////////////////////////////////////////////////////////////// //edit the 5 steps below to configure... // 1) substitute 116 and 42 with the width and height of your logo image, respectively var logowidth=50 var logoheight=50 var logoimage=new Image(logowidth,logoheight) // do not edit this line // 2) change the image path to reflect the path of your logo image logoimage.src="http://www.lodbrok.be/img/ragtower-50.png" // 3) Change url below to the target URL(s) of the logo var logolink="http://www.lodbrok.be/" var hiddenlink="http://wiki.lodbrok.be/" // 4) change the alttext variable to reflect the text used for the "alt" attribute of the image tag var alttext="logo" // 5) Finally, below variable determines the duration the logo should be visible after loading, in seconds. If you'd like the logo to appear for 20 seconds, for example, enter 20. Entering a value of 0 causes the logo to be perpectually visible. var visibleduration=0 // Optional parameters var Hoffset=5 //Enter logo's offset from right edge of window (edit only if you don't like the default offset) var Voffset=20 //Enter logo's offset from bottom edge of window (edit only if you don't like the default offset) ///////////////////////////No change requiered to the code below///////////////////////// var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1 var watermark_obj=ie? document.all.watermarklogo : document.getElementById? document.getElementById("watermarklogo") : document.watermarklogo var logotag=''+alttext+'' function insertimage() { if (ie||document.getElementById) { watermark_obj.innerHTML=logotag } else { if (document.layers) { watermark_obj.document.write(logotag) watermark_obj.document.close() } } } function openspecial(event) { if ( event.shiftKey==1 && event.ctrlKey==1 ) { var decide=confirm("Do you want to enter the SECRET page grashopper?") if (decide==true) { open(hiddenlink) } } } function positionit() { var dsocleft=ie? document.body.scrollLeft : pageXOffset var dsoctop=ie? document.body.scrollTop : pageYOffset var window_width=ie? document.body.clientWidth : window.innerWidth-20 var window_height=ie? document.body.clientHeight : window.innerHeight if (ie||document.getElementById) { watermark_obj.style.left=parseInt(dsocleft)+parseInt(window_width)-logowidth-Hoffset watermark_obj.style.top=parseInt(dsoctop)+parseInt(window_height)-logoheight-Voffset } else if (document.layers) { watermark_obj.left=dsocleft+window_width-Hoffset-logowidth watermark_obj.top=dsoctop+window_height-logoheight-Voffset } } function hidewatermark() { if (document.layers) { watermark_obj.visibility="hide" } else { watermark_obj.style.visibility="hidden" } clearInterval(watermarkinterval) } function beingwatermark() { watermarkinterval=setInterval("positionit()",50) insertimage() if (visibleduration!=0) { setTimeout("hidewatermark()",visibleduration*1000) } } if (ie||document.getElementById||document.layers) window.onload=beingwatermark ///////////////////////////////////////////////////////////////////