function importantFocus() {
	/* po zavolání zaostoí na prvek s id="mustBeFocused" */
	if (document.getElementById("mustBeFocused")) {
  	document.getElementById("mustBeFocused").focus();
	}
}
/*
rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};
*/
function open_popup(dokument,sirka,vyska,scrollbars) {
  so = screen.width;
	vo = screen.height;
	zleva = ((so - sirka) / 2) - 13;
	shora = 120;
//	var a = rand(100);
  popup_win = window.open(dokument,"popup_okno","width="+sirka+",height="+vyska+",left="+zleva+",top="+shora+",location=0,menubar=0,resizable=0,scrollbars="+scrollbars+",status=0,titlebar=0,toolbar=0");
  popup_win.focus();
}

function formChecker(whichform,whichclicked) {

	/* Spoeítá poeet prvku se shodným NAME, vrátí do prominné COUNT */
//  for (var count=0; count<document.forms["detailedSearch"].elements[whichform].length; count++) {}
	count=document.forms["detailedSearch"].elements[whichform].length;
	

	/* Pokud se klikne na první prvek, všechny ostatní prvky se odznaeí */
	if (whichclicked==1) {
  	for (i=1;i<count;i++) {
  		document.forms["detailedSearch"].elements[whichform][i].checked=false;
  	};
  };

	/* Pokud se klikne na jakýkoliv prvek kromi prvního, první prvek se odznaeí */
	if (whichclicked!=1) {
  	document.forms["detailedSearch"].elements[whichform.substring(0,1)+"0"].checked=false;
  };
	
	/* Spoeítá se poeet neoznaeených prvku, vrátí do prominné COUNT_UNCHECKED */
	count_unchecked=0;
	for (i=0;i<count;i++) {
		if (document.forms["detailedSearch"].elements[whichform.substring(0,1)+i].checked==false) {
			count_unchecked++;
		}
	};

	/* Pokud je poeet neoznaeených prvku roven poetu všech prvku, oznaeí se první prvek (aby nemohlo dojít k nulovému výbiru) */
	if (count_unchecked==count) {
  	document.forms["detailedSearch"].elements[whichform.substring(0,1)+"0"].checked=true;
	};

	/* Pokud je poeet oznaeených prvku o 1 menší než poeet všech prvku, oznaeí se první prvek a odoznaeí všechny ostatní (první shrnuje ve svém významu všechny ostatní) */
	if ((count-count_unchecked)==(count-1)) {
  	document.forms["detailedSearch"].elements[whichform.substring(0,1)+"0"].checked=true;
  	for (i=1;i<count;i++) {
  		document.forms["detailedSearch"].elements[whichform.substring(0,1)+i].checked=false;
  	};
	};
}

function selectChecker(sel) {
	if(sel.options[0].selected == true) {
		sel.options[0].selected = true;
		for(i=1;i<sel.options.length;i++) {
			sel.options[i].selected = false;
		}
	}
	return true;
}

function checkFormValue(whichId,badContent) {
	/* Kontroluje jestli objekt s ID whichId neobsahuje badContent - pokud ano, neodešle formuláo a napíše hlášku */
  if(document.getElementById(whichId).value==badContent) {
		return false;
	}
}

function formatPrice(price,hal) {
	var price2;
	if(hal == false) {
		price2 = Math.round(price).toString();
		if(price2.length > 3)
			price2 = price2.substring(0,price2.length-3) + ' ' + price2.substring(price2.length-3,price2.length);
		price2 += ',– Ke';
		return price2;
	}
	else {
		p2 = Math.round(price*100)/100;
		a = Math.round(price*100)%100;

		if(a && !(a % 10)) price2 = p2.toString() + '0';
		else price2 = p2.toString();
		
		if(price2.indexOf('.') == -1) {
			if(price2.length > 3)
				price2 = price2.substring(0,price2.length-3) + ' ' + price2.substring(price2.length-3,price2.length);
		}
		else {
			if(price2.length > 6)
				price2 = price2.substring(0,price2.length-6) + ' ' + price2.substring(price2.length-6,price2.length);
		}
				
		price2 += ',– Kč';
		return price2;
	}
}

function formatPrice3(price,hal,currency) {
	var price2;
	if(hal == false) {
		price2 = Math.round(price).toString();
		if(price2.length > 3)
			price2 = price2.substring(0,price2.length-3) + ' ' + price2.substring(price2.length-3,price2.length);
		price2 += ' '+currency;
		return price2;
	}
	else {
		p2 = Math.round(price*100)/100;
		a = Math.round(price*100)%100;

		if(a && !(a % 10)) price2 = p2.toString() + '0';
		else price2 = p2.toString();
		
		if(price2.indexOf('.') == -1) {
			if(price2.length > 3)
				price2 = price2.substring(0,price2.length-3) + ' ' + price2.substring(price2.length-3,price2.length);
		}
		else {
			if(price2.length > 6)
				price2 = price2.substring(0,price2.length-6) + ' ' + price2.substring(price2.length-6,price2.length);
		}
				
		price2 += ',– '+currency;
		return price2;
	}
}

function addToPrice(val) {
	var prevtotal = document.getElementById('totalPrice').innerHTML;
	prevtotal = prevtotal.toString().replace(' ','');
	prevtotal = parseFloat(prevtotal.substring(0,prevtotal.length-4));
	
	var newtotal = prevtotal + val;
	document.getElementById('totalPrice').innerHTML = formatPrice(newtotal);

	var dph = formatPrice(newtotal*0.19,true);
	document.getElementById('DPH').innerHTML = dph;
	
	var totalwdph = formatPrice(newtotal*1.19,false);
	document.getElementById('totalPricewDPH').innerHTML = totalwdph;
}

/*******************************************************************************/
function addToPrice2(val,dph_percent,currency) {
	var prevtotal = document.getElementById('totalPrice').innerHTML;
//	prevtotal = prevtotal.toString().replace(' ','');
//	prevtotal = parseFloat(prevtotal);
	prevtotal = parseFloat(prevtotal.replace(' ',''));

	var newtotal = prevtotal + val;
	document.getElementById('totalPrice').innerHTML = formatPrice3(newtotal,false,currency);

	var dph = formatPrice3(newtotal*(dph_percent/100),false,currency);
	document.getElementById('DPH').innerHTML = dph;
	
	var totalwdph = formatPrice3(newtotal*(1+(dph_percent/100)),false,currency);
	document.getElementById('totalPricewDPH').innerHTML = totalwdph;
}
/*******************************************************************************/
function addToCDPrice(id, val) {
	var prev = document.getElementById('price' + id).innerHTML;
	prev = prev.toString().replace(' ','');
	prev = parseFloat(prev.substring(0,prev.length-4));
	
	var newv = prev + val;
	document.getElementById('price' + id).innerHTML = formatPrice(newv);

/*	var dph = formatPrice(newv*0.19,true);
	document.getElementById('DPH' + id).innerHTML = dph;
	
	var totalwdph = formatPrice(newv*1.19,false);
	document.getElementById('priceWithDPH' + id).innerHTML = totalwdph;*/
}
/******************************************************************************/
function formatPrice2(price,hal) {
	var price2;
	if(hal == false) {
		price2 = Math.round(price).toString();
		if(price2.length > 3)
			price2 = price2.substring(0,price2.length-3) + ' ' + price2.substring(price2.length-3,price2.length);
		//price2 += ',– Ke';
		return price2;
	}
	else {
		p2 = Math.round(price*100)/100;
		a = Math.round(price*100)%100;

		if(a && !(a % 10)) price2 = p2.toString() + '0';
		else price2 = p2.toString();
		
		if(price2.indexOf('.') == -1) {
			if(price2.length > 3)
				price2 = price2.substring(0,price2.length-3) + ' ' + price2.substring(price2.length-3,price2.length);
		}
		else {
			if(price2.length > 6)
				price2 = price2.substring(0,price2.length-6) + ' ' + price2.substring(price2.length-6,price2.length);
		}
				
		//price2 += ',– Kč';
		return price2;
	}
}
/********************************************************************************/
function uplatnitkredit(kredit,dph_percent,par_alert, currency) {
	var uplatneny = document.forms[0].elements['uplatnenykredit'].value;
	if(uplatneny == '1') {
		document.getElementById('kreditButtonRow').disabled = true;
		return;
	}
	var prevtotal = document.getElementById('totalPrice').innerHTML;
	prevtotal = prevtotal.toString().replace(' ','');
	//bylo-4M
	//var mena = prevtotal.substring(prevtotal.length-2,prevtotal.length)
	prevtotal = parseFloat(prevtotal);
	//prevtotal = parseFloat(prevtotal.substring(0,prevtotal.length-2));
	if(prevtotal == 0) {
		alert(par_alert);
		//alert("Nejdooíve vyberte velikosti fotografií.");
		return;
	}

	if(kredit <= prevtotal) {
		newtotal = prevtotal - kredit;
	}
	else {
		newtotal = 0;
	}
	kredit = 0;

	document.getElementById('totalPrice').innerHTML = formatPrice3(newtotal, false, currency);//formatPrice(newtotal);

	var dph = newtotal*(dph_percent/100);  //,true);//formatPrice
	document.getElementById('DPH').innerHTML = formatPrice3(dph,false, currency);
	
	//var totalwdph = formatPrice(newtotal*1.19,false);
	var totalwdph = newtotal*(1+(dph_percent/100));//,false);//formatPrice
	document.getElementById('totalPricewDPH').innerHTML = formatPrice3(totalwdph,false,currency);//.innerHTML = totalwdph;

	document.getElementById('kredit').innerHTML =  formatPrice3(kredit,false,currency);//formatPrice
	
	document.forms[0].elements['uplatnenykredit'].value = '1';
	document.getElementById('kreditButtonRow').disabled = true;
	
	return true;
}

var dodani_f = 0;
var dodani_cd = 0;

function dodani_change() {
	val = document.forms[0].dodani_f[0].checked; 
	val2 = document.forms[0].dodani_f[1].checked; 
	if(val == true && dodani_f == 500) {
		dodani_f = 0;
		addToPrice(-500);
	}
	else if(val2 == true && dodani_f == 0) {
		dodani_f = 500;
		addToPrice(500);
	}
}

function dodani_cd_change() {
	val = document.forms[0].dodani_cd[0].checked; 
	val2 = document.forms[0].dodani_cd[1].checked; 
	if(val == true && dodani_cd == 500) {
		dodani_cd = 0;
		addToPrice(-500);
	}
	else if(val2 == true && dodani_cd == 0) {
		dodani_cd = 500;
		addToPrice(500);
	}
}

function orderChecker(obj,id) {
	var krok;
	if(obj.parentNode.childNodes[1].tagName == "TR") krok = 1;
	else krok = 2;
	
	for(i=0;i<obj.parentNode.childNodes.length;i+=krok) {
		if(obj.parentNode.childNodes[i] == obj) {
			obj.parentNode.childNodes[i].className = 'rowblue';
			obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = true;
			nas = i;
			for(i+=krok;i<obj.parentNode.childNodes.length;i+=krok) {
				obj.parentNode.childNodes[i].className = '';
				obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = false;
			}
			document.getElementById('priceFormat'+id).innerHTML = obj.parentNode.childNodes[nas].childNodes[2*krok-1].innerHTML;

			var prevcena = document.getElementById('priceValue'+id).innerHTML;
			prevcena = prevcena.substring(0,prevcena.length-5);
			prevcena = prevcena.replace(' ','');
			var cena = document.getElementById('priceValue'+id).innerHTML = obj.parentNode.childNodes[nas].childNodes[3*krok-1].innerHTML;
			cena = parseFloat(cena.replace(' ',''));
			addToPrice(cena-prevcena);
			var dph = formatPrice(cena*0.19); document.getElementById('DPH'+id).innerHTML = dph;
			var sdph = formatPrice(cena*1.19); document.getElementById('priceWithDPH'+id).innerHTML = sdph;
			document.getElementById('forprice'+id).className = 'price floatLeft schovat';
			document.getElementById('price'+id).className = 'price floatLeft';
			return true;
		}	else {
			obj.parentNode.childNodes[i].className = 'rowgrey';
			obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = true;
		}
	}
}

function orderChecker2(obj,id, percent_dph,currency) {
	var krok;
	if(obj.parentNode.childNodes[1].tagName == "TR") krok = 1;
	else krok = 2;
	
	for(i=0;i<obj.parentNode.childNodes.length;i+=krok) {
		if(obj.parentNode.childNodes[i] == obj) {
			obj.parentNode.childNodes[i].className = 'rowblue';
			obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = true;
			nas = i;
			for(i+=krok;i<obj.parentNode.childNodes.length;i+=krok) {
				obj.parentNode.childNodes[i].className = '';
				obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = false;
			}
			document.getElementById('priceFormat'+id).innerHTML = obj.parentNode.childNodes[nas].childNodes[2*krok-1].innerHTML;

			var prevcena = document.getElementById('priceValue'+id).innerHTML;
//			prevcena = prevcena.substring(0,prevcena.length-5);
//			prevcena = prevcena.replace(' ','');
			prevcena = parseFloat(prevcena.replace(' ',''));
			var cena = document.getElementById('priceValue'+id).innerHTML = obj.parentNode.childNodes[nas].childNodes[3*krok-1].innerHTML;
			cena = parseFloat(cena.replace(' ',''));
			addToPrice2(cena-prevcena, percent_dph, currency);
			var dph = formatPrice3(cena*(percent_dph / 100), false, currency); document.getElementById('DPH'+id).innerHTML = dph;
			var sdph = formatPrice3(cena*(percent_dph / 100 + 1), false, currency); document.getElementById('priceWithDPH'+id).innerHTML = sdph;
			document.getElementById('forprice'+id).className = 'price floatLeft schovat';
			document.getElementById('price'+id).className = 'price floatLeft';
			return true;
		}	else {
			obj.parentNode.childNodes[i].className = 'rowgrey';
			obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = true;
		}
	}
}


/******************************************************************************************************/
function orderCheckerCD2(obj,id,dph_percent,currency) {
	var krok;
	if(obj.parentNode.childNodes[1].tagName == "TR") krok = 1;
	else krok = 2;
	
	for(i=0;i<obj.parentNode.childNodes.length;i+=krok) {
		if(obj.parentNode.childNodes[i] == obj) {
			obj.parentNode.childNodes[i].className = 'rowblue';
			obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = true;
			nas = i;
			for(i+=krok;i<obj.parentNode.childNodes.length;i+=krok) {
				obj.parentNode.childNodes[i].className = '';
				obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = false;
			}
			var prevcena = document.getElementById('priceValue'+id).innerHTML;
			//prevcena = prevcena.substring(0,prevcena.length-5);
			prevcena = parseFloat(prevcena.replace(' ',''));
			var cena = document.getElementById('priceValue'+id).innerHTML = obj.parentNode.childNodes[nas].childNodes[3*krok-1].innerHTML;
			//cena = cena.substring(0,cena.length-5)
			cena = parseFloat(cena.replace(' ',''));
			addToPrice2(cena-prevcena,dph_percent,currency)
			//addToPrice(cena-prevcena);
			var dph = formatPrice3(cena*(dph_percent / 100), false, currency); document.getElementById('DPH'+id).innerHTML = dph;
			var sdph = formatPrice3(cena*(dph_percent / 100 + 1), false, currency); document.getElementById('priceWithDPH'+id).innerHTML = sdph;
			document.getElementById('forprice'+id).className = 'price floatLeft schovat';
			document.getElementById('price'+id).className = 'price floatLeft';
			
			return true;
		}	else {
			obj.parentNode.childNodes[i].className = '';
			obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = true;
		}
	}
}
/**************************************************************************************************/
function orderCheckerCD(obj,id) {
	var krok;
	if(obj.parentNode.childNodes[1].tagName == "TR") krok = 1;
	else krok = 2;
	
	for(i=0;i<obj.parentNode.childNodes.length;i+=krok) {
		if(obj.parentNode.childNodes[i] == obj) {
			obj.parentNode.childNodes[i].className = 'rowblue';
			obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = true;
			nas = i;
			for(i+=krok;i<obj.parentNode.childNodes.length;i+=krok) {
				obj.parentNode.childNodes[i].className = '';
				obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = false;
			}

			var prevcena = document.getElementById('priceValue'+id).innerHTML;
			prevcena = prevcena.substring(0,prevcena.length-5);
			prevcena = prevcena.replace(' ','');
			var cena = document.getElementById('priceValue'+id).innerHTML = obj.parentNode.childNodes[nas].childNodes[3*krok-1].innerHTML;
			cena = cena.substring(0,cena.length-5)
			cena = parseFloat(cena.replace(' ',''));
			addToPrice(cena-prevcena);
/*			var dph = formatPrice(cena*0.19); document.getElementById('DPH'+id).innerHTML = dph;
			var sdph = formatPrice(cena*1.19); document.getElementById('priceWithDPH'+id).innerHTML = sdph;*/
			document.getElementById('forprice'+id).className = 'price floatLeft schovat';
			document.getElementById('price'+id).className = 'price floatLeft';
			return true;
		}	else {
			obj.parentNode.childNodes[i].className = '';
			obj.parentNode.childNodes[i].childNodes[krok-1].childNodes[0].checked = true;
		}
	}
}

function lostPWD() {
  so = screen.width;
	vo = screen.height;
	sirka = 485;
	vyska = 175;
	zleva = ((so - sirka) / 2) - 13;
	shora = ((vo - vyska) / 2);
  popup_win = window.open("lostpwd_popup.php","error","width="+sirka+",height="+vyska+",left="+zleva+",top="+shora+",location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0");
  popup_win.focus();
}

function notLoggedIn(params) {
  so = screen.width;
	vo = screen.height;
	sirka = 498;
	vyska = 276;
	zleva = ((so - sirka) / 2) - 13;
	shora = ((vo - vyska) / 2);
  popup_win = window.open("login_popup.php"+params,"error","width="+sirka+",height="+vyska+",left="+zleva+",top="+shora+",location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0");
  popup_win.focus();
}

// Doplnkove informace | sloupec a jeho skripty:

function focusAfterAction() {
	if (document.getElementById("mustBeFocusedAfter")) {
  	document.getElementById("mustBeFocusedAfter").focus();
	}
}

function hideThemes() {
  if (document.getElementById('FSfotky').checked==true) {
  	document.getElementById('FStemata').style.display='none';
  	if (navigator.appName == "Microsoft Internet Explorer") {document.getElementById('FS').style.height='178px';}
		else {document.getElementById('FS').style.height='175px';}
  };
	focusAfterAction();
}
  
function showThemes() {
  if (document.getElementById('FSkolekce').checked==true) {
  	document.getElementById('FStemata').style.display='block';
  	if (navigator.appName == "Microsoft Internet Explorer") {document.getElementById('FS').style.height='207px';}
		else {document.getElementById('FS').style.height='204px';}
  };
	focusAfterAction();
}

function checkAddress2(form,par_alert) {
	chyba = false;
	if(form.elements['jmeno'].value == '') chyba = true;
	if(form.elements['prijmeni'].value == '') chyba = true;
	if(form.elements['ulice'].value == '') chyba = true;
	if(form.elements['obec'].value == '') chyba = true;
	if(form.elements['psc'].value == '') chyba = true;
	if(form.elements['f_nazev'].value == '') chyba = true;
	//if(form.elements['f_ico'].value == '') chyba = true;
	//if(form.elements['f_dic'].value == '') chyba = true;
	if(form.elements['f_ulice'].value == '') chyba = true;
	if(form.elements['f_obec'].value == '') chyba = true;
	if(form.elements['f_psc'].value == '') chyba = true;

	if(chyba == true) {
		alert(par_alert);
		return false;
	}
	else
		return true;
}

function checkAddress(form) {
	chyba = false;
	if(form.elements['jmeno'].value == '') chyba = true;
	if(form.elements['prijmeni'].value == '') chyba = true;
	if(form.elements['ulice'].value == '') chyba = true;
	if(form.elements['obec'].value == '') chyba = true;
	if(form.elements['psc'].value == '') chyba = true;
	if(form.elements['f_nazev'].value == '') chyba = true;
	if(form.elements['f_ico'].value == '') chyba = true;
	if(form.elements['f_dic'].value == '') chyba = true;
	if(form.elements['f_ulice'].value == '') chyba = true;
	if(form.elements['f_obec'].value == '') chyba = true;
	if(form.elements['f_psc'].value == '') chyba = true;

	if(chyba == true) {
		alert('Vyplote prosím všechny údaje.');
		return false;
	}
	else
		return true;
}

function otevrit_promo(url) { 
	window.open(url,'SundayPhoto','status=no,scrollbars=no,c,menubar=no,directories=no,toolbars=no,location=no,width=650,height=557');
}

function registrationFormHandler() {
	
  var form = document.forms[2] ? document.forms[2] : document.forms[1];
  
  var souhlas = form.elements['souhlas'].checked;
  var souhlas2 = form.elements['souhlas2'].checked;
  var spotlight = form.elements['newsletter'].checked;

  
  if(!souhlas || !souhlas2) {
  	window.document.getElementById('potvrdit').disabled = true;
  }
  else {
  	window.document.getElementById('potvrdit').disabled = false;
  } 
}
function registrationFormHandler_popup() {
	
  var form = document.forms[0];
  
  var souhlas = form.elements['souhlas'].checked;
  var souhlas2 = form.elements['souhlas2'].checked;
  var spotlight = form.elements['newsletter'].checked;
  
  if(!souhlas || !souhlas2) {
  	window.document.getElementById('potvrdit').disabled = true;
  }
  else {
  	window.document.getElementById('potvrdit').disabled = false;
  } 
}

function fullScreen(theURL) {
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto,resizable=yes');
}

function CalcFlashBannerPos() {
    this.fb = document.getElementById("flash-banner");
    if (this.fb == null)
        return;

    this.GetScrollXY = function () {
        var scrX = 0;
        var scrY = 0;

        if (typeof(window.pageYOffset) == 'number') {
            scrX = window.pageXOffset;
            scrY = window.pageYOffset;
        } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
            scrX = document.body.scrollLeft;
            scrY = document.body.scrollTop;
        } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
            scrX = document.documentElement.scrollLeft;
            scrY = document.documentElement.scrollTop;
        }

        return [scrX, scrY];
    }

    this.GetWindowWH = function () {
        var width = 0;
        var height = 0;

        if(typeof(window.innerWidth) == 'number') {
            width = window.innerWidth;
            height = window.innerHeight;
        } else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
            width = document.documentElement.clientWidth;
            height = document.documentElement.clientHeight;
        } else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
            width = document.body.clientWidth;
            height = document.body.clientHeight;
        }

        return [width, height];
    }

    var IE = /^.*Microsoft.*$/.test(navigator.appName);
    var OPERA = /^.*Opera.*$/.test(navigator.appName);
    //var CHROME = /^.*Netscape.*$/.test(navigator.appName);
        
    this.wh = this.GetWindowWH();
    this.shl = 14;
    this.sht = 94;

    if (IE)
        this.shl = 4;
    if (IE)
        this.sht = 92;
    /*else if (CHROME) {
        this.sht = 92;
        this.shl = 15;
    } */else if (OPERA) {
        this.sht = 80;
        this.shl = 15;
    }

    this.RecalcPos = function () {
        this.fb.style.left = ((this.wh[0] - 750) / 2) - 160 - this.shl + "px";
        this.fb.style.top = this.sht + "px";
    }
    
    this.RecalcPos();
    
    document.body.ref = this;
    document.body.onresize = function () {
        document.body.ref.RecalcPos();        
    }
    
    if (IE) {
        document.body.onscroll = function () {
            var ref = document.body.ref;
            var sy = ref.GetScrollXY();
            ref.fb.style.top = sy[1] + ref.sht + "px";
        }
    }
}