
AOJSObject = function() { };
AOJSObject.actions = [];

AOJSObject.minClientWidth = 630;
AOJSObject.limitClientWidth = 660;
AOJSObject.lastTop = 0;
AOJSObject.headerOffset = 180;

AOJSObject.setAction = function (type, action) {
	AOJSObject.actions[type] = action;
}

AOJSObject.fireAction = function (type, arg) {
	var curAction = function(arg) {};
	if (AOJSObject.actions[type]) {
		curAction = AOJSObject.actions[type];
	}
	curAction(arg);
}

AOJSObject.changeHeight = function (height) {
  var flexApp = document.getElementById("AO4All");
	if (flexApp != null) {				
    try {
      flexApp.style.height = height + "px";
    } catch(e) {}
  }
  return true;
}

AOJSObject.updateProperties = function ()  {
	var currentTop = 0;
	var currentWidth = 0;
	if (document.body && document.body.scrollTop > document.documentElement.scrollTop) {
    currentTop = document.body.scrollTop;
    currentWidth = document.body.clientWidth;
	} else {
		currentTop = document.documentElement.scrollTop;
		currentWidth = document.documentElement.clientWidth;
	}

 	var flexApp = document.getElementById("AO4All");
		
	if (flexApp != null) {
    if (currentWidth < AOJSObject.limitClientWidth) {
        			flexApp.style.width = AOJSObject.minClientWidth + "px";
    } else {
        			flexApp.style.width = "100%";
    }
  }

  /*
  posouvani hlavicky
  if (flexApp != null && (currentTop - AOJSObject.headerOffset != AOJSObject.lastTop)) {				
    try {
      flexApp.winScrollFunction(Math.max(currentTop - AOJSObject.headerOffset, 0));
      AOJSObject.lastTop = currentTop - AOJSObject.headerOffset;
    } catch(e) {}
  }
  */

}

	
setInterval("AOJSObject.updateProperties()",200);	

params4AO = {bgcolor: "#ffffff", wmode: "opaque", allowscriptaccess: "always", flashvars: "cust=MALL&colors=FAFDFF,FFE0E0,F5F5F5,7FC6FF,B5C4CF,99A6AF&tags=" + escape('<tags><tag id="INSTOCK" image="http://cs.s.mall.cz/com/img/ico_skladem.gif" name="Skladem" /><tag id="ACTION" image="http://cs.s.mall.cz/com/img/ico_akce.gif" name="Akční cena" /><tag id="NEW" image="http://cs.s.mall.cz/com/img/ico_new.gif" name="Novinka" /><tag id="TIP" image="http://cs.s.mall.cz/com/img/ico_tip.gif" name="Doporučujeme" /></tags>').replace(/\%/g, "*")};
attributes4AO = ""; 
