// JavaScript Document

/***********************************************
* Sticky Note script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
* Go to http://www.dynamicdrive.com/ for full source code
***********************************************/

//Specify display mode. 3 possible values are:
//1) "always"- This makes the fade-in box load each time the page is displayed
//2) "oncepersession"- This uses cookies to display the fade-in box only once per browser session
//3) integer (ie: 5)- Finally, you can specify an integer to display the box randomly via a frequency of 1/integer...
// For example, 2 would display the box about (1/2) 50% of the time the page loads.

var displaymode_1="oncepersession"

var enablefade_1="yes" //("yes" to enable fade in effect, "no" to disable)
var autohidebox_1=["no", 10] //Automatically hide box after x seconds? [yes/no, if_yes_hide_after_seconds]
var showonscroll_1="yes" //Should box remain visible even when user scrolls page? ("yes"/"no)
var IEfadelength_1=0.5 //fade in duration for IE, in seconds
var Mozfadedegree_1=0.025 //fade in degree for NS6+ (number between 0 and 1. Recommended max: 0.2)

////////No need to edit beyond here///////////

if (parseInt(displaymode_1)!=NaN)
var random_num=Math.floor(Math.random()*displaymode_1)

function displayfadeinbox_1(){
var ie=document.all && !window.opera
var dom=document.getElementById
iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
objref_1=(dom)? document.getElementById("fadeinbox_1") : document.all.fadeinbox_1
var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset
var docwidth=(ie)? iebody.clientWidth : window.innerWidth
docheight=(ie)? iebody.clientHeight: window.innerHeight
var objwidth=objref_1.offsetWidth
objheight=objref_1.offsetHeight
objref_1.style.left=docwidth/2-objwidth/2+"px"
objref_1.style.top=scroll_top+docheight/2-objheight/2+"px"

if (showonscroll_1=="yes")
showonscroll_1var=setInterval("staticfadebox_1()", 50)

if (enablefade_1=="yes" && objref_1.filters){
objref_1.filters[0].duration=IEfadelength_1
objref_1.filters[0].Apply()
objref_1.filters[0].Play()
}
objref_1.style.visibility="visible"
if (objref_1.style.MozOpacity){
if (enablefade_1=="yes")
mozfadevar=setInterval("mozfadefx()", 90)
else{
objref_1.style.MozOpacity=1
controlledhidebox_1()
}
}
else
controlledhidebox_1()
}

function mozfadefx_1(){
if (parseFloat(objref_1.style.MozOpacity)<1)
objref_1.style.MozOpacity=parseFloat(objref_1.style.MozOpacity)+Mozfadedegree_1
else{
clearInterval(mozfadevar)
controlledhidebox_1()
}
}

function staticfadebox_1(){
var ie=document.all && !window.opera
var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset
objref_1.style.top=scroll_top+docheight/2-objheight/2+"px"
}

function hidefadebox_1(){
objref_1.style.visibility="hidden"
if (typeof showonscroll_1var!="undefined")
clearInterval(showonscroll_1var)
}

function controlledhidebox_1(){
if (autohidebox_1[0]=="yes"){
var delayvar=(enablefade_1=="yes" && objref_1.filters)? (autohidebox_1[1]+objref_1.filters[0].duration)*1000 : autohidebox_1[1]*1000
setTimeout("hidefadebox_1()", delayvar)
}
}

function initfunction_1(){
setTimeout("displayfadeinbox_1()", 1000);
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}


if (displaymode_1=="oncepersession" && get_cookie("fadedin_1")=="" || displaymode_1=="always" || parseInt(displaymode_1)!=NaN && random_num==0){
if (window.addEventListener)
window.addEventListener("load", initfunction_1, false)
else if (window.attachEvent)
window.attachEvent("onload", initfunction_1)
else if (document.getElementById)
window.onload=initfunction_1
document.cookie="fadedin_1=yes"
}

