function createCookie(name,value,days) {
        if (days) {
                var date = new Date();
                date.setTime(date.getTime()+(days*1*60*60*1000));
                var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
                var c = ca[i];
                while (c.charAt(0)==' ') c = c.substring(1,c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
}

function eraseCookie(name) {
        createCookie(name,"",-1);
}

var width = screen.width
var height = screen.height

//if (width >= 800)
/***********************************************
* Floating Iframe script-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
//Specify iframe to display. Change src and other attributes except "position" and "left/top":
var iframetag='<iframe id="floatbanner_1" src="/Ext/banners/FloatSideBanner.php?z=25" width="100px" height="590px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" style="position: absolute; left: 0px; top: 0px; z-index:500"  allowTransparency="true"></iframe>';

//specify x coordinates of iframe ("right" for right corner, or a pixel number (ie: "20px")):
var floatbanner_1left="0px";

//specify y coordinates of iframe ("bottom" for bottom of page, or a pixel number (ie: "20px")):
var floatbanner_1top="0px";

var ie=(document.all || window.opera) && document.getElementById
var iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body

if (ie && width > 800) {
document.write(iframetag)
}

function positionit(){
floatbanner_1obj=document.getElementById("floatbanner_1")
var window_width=ie && !window.opera? iebody.clientWidth : window.innerWidth-20
window_height=ie && !window.opera? iebody.clientHeight : window.innerHeight
var dsocleft=ie? iebody.scrollLeft : pageXOffset
var floatbanner_1width=floatbanner_1obj.width
floatbanner_1height=floatbanner_1obj.height
floatbanner_1obj.style.left=(floatbanner_1left=="right")? window_width-floatbanner_1width-20 : floatbanner_1left
setInterval("repositionit()", 100)
}
/*
function repositionit(){
if (ie){
dsoctop=ie? iebody.scrollTop : pageYOffset
floatbanner_1obj.style.top=(floatbanner_1top=="bottom")? window_height-floatbanner_1height-14+dsoctop : parseInt(floatbanner_1top)+dsoctop
}
}
*/
var pageHight
function repositionit(){
	if (ie) {
		window_height=iebody.clientHeight;
		dsoctop=ie? iebody.scrollTop : pageYOffset
		var SetNeu=window_height-floatbanner_1height-14+dsoctop;
			if ((pageHight-floatbanner_1height) < SetNeu ) {
			floatbanner_1obj.style.bottom="0";
			//window_height=0;
			return;
		}

		if (floatbanner_1top=="bottom") {
			floatbanner_1obj.style.top=SetNeu;
		} else {
			floatbanner_1obj.style.top=parseInt(floatbanner_1top)+dsoctop
		}
	}
}

if (window.attachEvent)
window.attachEvent("onload", positionit)
