$ = function (id) {
	//gibt einen element Zurück oder null, falls element nicht gefunden wird
	return document.getElementById(id);
	}

$each = function (list, fn) {
	//fürt function fn für jeder element von list
	if (! list instanceof Array) return;
	for (var i=0; i<list.length;i++) { fn(list[i]); }
	}

$defined = function(obj) {
	return (typeof(obj)!="undefined" && obj!=null);
	}


String.prototype.startsWith = function(str) {
	try { return (this.match("^"+str)==str); }
	catch (e) { return false; }
	}
String.prototype.trim = function()	{
	return(this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""));
	}
String.prototype.endsWith = function(str) {
	return (this.match(str+"$")==str);
	}


extend = function (obj,fname,fn) {
	//erweitert ein belibiges object um eine function fn
	if (!obj[fname]) { obj[fname] = fn; }
	}

childTags = function(obj) {
	var ret = [];
	for (var i=0; i<obj.childNodes.length;i++) {
		if (obj.childNodes[i].nodeType==1) { ret.push(obj.childNodes[i]); }
		}
	return ret;
	}

function addEvent (element,event,cb) {
	if (typeof(element)=="string") { element = $(element); }
	if (element==null) { return; }
	if (element.addEventListener) {// firefox, w3c
		element.addEventListener ( event, cb, false);
		}
	else if (element.attachEvent){ //IE
		element.attachEvent ("on"+event, cb);
		}
	}

function cancelEvent(e) {
	e = e ? e : window.event;
	if(e.stopPropagation) e.stopPropagation();
	if(e.preventDefault) e.preventDefault();
	e.cancelBubble = true;
	e.cancel = true;
	e.returnValue = false;
	return false;
	}


function detectIE6(){
	//bestimmt, ob ein Browser IE6 ist
	var browser = navigator.appName;
	if (browser == "Microsoft Internet Explorer") {
		var b_version = navigator.appVersion;
		var re = /\MSIE\s+(\d\.\d\b)/;
		var res = b_version.match(re);
		if (res[1] <= 6) { return true; }
		}
	return false;
	}


opacity = function(obj, newopacity) {
	obj.style.opacity = newopacity;
	obj.style.MozOpacity = newopacity;
	obj.style.filter = "alpha(opacity=" + (newopacity*100) + ")";
	}

fade = function (to, duration, obj) {
	if (typeof(obj)=="undefined") obj=this;
	if (typeof(obj.setOpacity!="function")){
		obj.setOpacity = function(newopacity) {
			if (!$defined(newopacity)) { newopacity = this.xOpacity; }
			opacity(this,newopacity);
			}
		}
	if (typeof(obj.xOpacity)=="undefined") obj.xOpacity = 1;
	if ( obj.xOpacity > 1 ) { obj.xOpacity = 1; obj.setOpacity(); return; }
	if (obj.xOpacity < 0 ) { obj.xOpacity = 0; obj.setOpacity(); return; }
	if (Math.abs(obj.xOpacity-to)<.05) { obj.xOpacity = to; obj.setOpacity(); return; }
	//var delta = (to>obj.xOpacity)?.05:-.05;
	obj.xOpacity = obj.xOpacity;
	obj.setOpacity();
	//setTimeout(function() { obj.fade(to,duration,obj) },duration/20);
	}


function addWheelInterface (container, fUp, fDown) {
	container.wheelUp = fUp;
	container.wheelDown = fDown;
	container.myscroll = function (e) {
		e = e ? e : window.event;
		var raw = e.detail ? e.detail : e.wheelDelta;
		var normal = e.detail ? e.detail * -1 : e.wheelDelta / 40;
		if (e.type == "mousewheel") { raw = -raw; } //for doof IE
		if (normal>0) { container.wheelDown(Math.abs(normal)); }
		else { container.wheelUp(Math.abs(normal)); }
		cancelEvent(e);
		}
	if (container.addEventListener) {
		container.addEventListener("DOMMouseScroll", container.myscroll, false);
		container.addEventListener("mousewheel", container.myscroll, false);
		}
	else if (container.attachEvent) {
		container.attachEvent("onmousewheel",container.myscroll, false);
		}
	else {
		container.onmousewheel = container.myscroll;
		}
	}

animate = function (attr, to, duration, obj) {
	//TODO: noch nicht vertig
	if ( !$defined(obj)) obj=this;
	var curAttr = obj.style[attr];
	if ( !$defined(curAttr)) { return; }
	else
		if (typeof(curAttr)=="string" && curAttr.endsWith("px") ) {
			curAttr = parseInt(curAttr.replace(/px/, ""));
			var pxflag=true;
			}
		else { var pxflag=false; }
	var delta = parseInt(duration/(to-curAttr));
	if (Math.abs(curAttr-to)<=Math.abs(delta)) {
		if (pxflag) { obj.style[attr] = to+"px"; }
		else { obj.style[attr] = to; }
		return;
		}
	else {
		if (pxflag) { obj.style[attr] = curAttr+delta+"px"; }
		else { obj.style[attr] = curAttr+delta; }
		setTimeout(function() { obj.animate(attr,to,duration,obj) },duration/Math.abs(delta));
		}
	}

function createSetInterface (container, objects, fOnActivate, fOnDeactivate) {
	if ( typeof(container) == string ) { container=$(container); }
	if ( container == null || typeof(objects) != "object" ) return;
	container.currentIndex = 0;
	container.objectsCount = objects.length;
	container.getNextIndex = function() {
		return ((this.currentIndex+1)==this.objectsCount)?0:this.currentIndex+1;
		}
	container.getPreviosIndex = function() {
		if ( this.objectsCount==1 ) return 0;
		return (this.currentIndex==0)?this.objectsCount-1:this.currentIndex-1;
		}
	//for var obj in objects {
		//TODO:
	//	}
	}



//################################################


function required_fields() {
  var fields = new Array('CSALUTATION','CNAME1', 'CNAME2', 'CEMAIL', 'reg_pw', 'reg_re_pw');
  var field_title;
  var field;
  for ( i = 0 ; i < fields.length ; i++ ) {
    field_title = eval("$('TITLE_" + fields[i] + "')");
    field = eval("document.getElementsByName('" + fields[i] + "')[0]");
    if ( !field.value ) {
      field_title.style.color = '#e20800';
      field.style.border = '2px solid #e20800';
    }
  }
  if ( document.getElementsByName('CNAME1')[0].value.length < 2 )
    document.getElementsByName('CNAME1')[0].style.border = '2px solid #e20800';
  if ( document.getElementsByName('reg_pw')[0].value.length < 6 )
    document.getElementsByName('reg_pw')[0].style.border = '2px solid #e20800';
  if ( document.getElementsByName('reg_pw')[0].value != document.getElementsByName('reg_re_pw')[0].value ) {
    document.getElementsByName('reg_pw')[0].style.border = '2px solid #e20800';
    document.getElementsByName('reg_re_pw')[0].style.border = '2px solid #e20800';
  }
  var Email = document.getElementsByName('CEMAIL')[0];
  if ( Email.value.search(/^[0-9A-Za-z\._\-\!%\+]+@[0-9A-Za-z\._\-\!%\+]+\.[0-9A-Za-z\._\-\!%\+]+$/) == -1 ||
Email.value.search(/^www\./) != -1 || Email.value.search(/(@[\_\-]|\+)/) != -1 || Email.value.search(/[A-Za-z]{2,}$/) == -1 )
    Email.style.border = '2px solid #e20800';
}


//###########################TATIANA#################################
function do_change_viewport(art_id) {
	var art_obj = ARTICLES[art_id];
	if ( typeof(art_obj) == "undefined" ) return;

	var preview_photo_container = $("preview_photo_container");
	var preview_logo_container = $("preview_logo_container");
	var preview_name_container = $("preview_name_container");
	var preview_size_container = $("preview_size_container");
	//var preview_brand_logo = $("preview_brand_logo");
	var jsz = $("jeans_sizes_women");
	var jsz_lee = $("jeans_sizes_women_lee");
	var jsz2 = $("jeans_sizes_men");
	var tocheck = [preview_photo_container,
			preview_logo_container,
			preview_name_container,
			jsz,jsz2,jsz_lee,preview_size_container];

	for (var i=0; i<tocheck.length; i++) {
		if (tocheck[i]==null) {
			setTimeout(function(){do_change_viewport(art_id);},200);
			return;
			}
		}

	preview_photo_container.src = art_obj["big_image"];
	preview_logo_container.innerHTML = art_obj["brand"];
	//preview_brand_logo.src = art_obj["brandimagepath"];
	preview_name_container.innerHTML = art_obj["name"];
	var preferred_cat = art_obj["preferred_cat"];

	var sizes = art_obj["size_list"];
	var group_name = art_obj["group_name"];

	if (group_name.toLowerCase().indexOf("jeans")>-1 && sizes[0].indexOf("-")>-1) {
		//startlog();
		//log('preferred_cat = ' + art_obj["preferred_cat"]);
		if (art_obj["preferred_cat"]=="1") {

			jsz.style.display = "none";
			jsz_lee.style.display = "none";
			jsz2.style.display = "none";

			var jsz_obj = ( art_obj["brand"] == "Lee" || art_obj["art_nr"] == "3MAV-0558" || art_obj["art_nr"] == "3MAV-0620" || art_obj["art_nr"] == "3MAV-0793" ) ? jsz_lee : jsz;
			jsz_obj.style.display="block";

			var blendes = jsz_obj.getElementsByTagName("div");
			}
		else {
			jsz2.style.display = "block";
			jsz.style.display = "none";
			jsz_lee.style.display = "none";
			var blendes = jsz2.getElementsByTagName("div");
			}

		preview_size_container.style.display = "none";
		for (var i=0; i<blendes.length; i++) { blendes[i].style.visibility="visible"; }

		for (var i=0; i<sizes.length; i++) {
			var blende_name = preferred_cat+"_jeans_sizes_blende_"+sizes[i].replace(/\D/g,"");
			//log (blende_name);
			var blende_obj = $(blende_name);
			if (blende_obj != null) {
				blende_obj.style.visibility = "hidden";
				//log ("opened: ", blende_name);
				}
			else {
				//log("not found: ", blende_name);
				}
			}
		}
	else {
		jsz.style.display = "none";
		jsz2.style.display = "none";
		jsz_lee.style.display = "none";
		preview_size_container.style.display = "block";

		var my_sizes = "";
		for (var i=0; i<art_obj["size_list"].length; i++) {
			var spclass = (art_obj["size_list"][i].length>4)?"big":"small";
			my_sizes = my_sizes + '<span class="size_item '+spclass+'">'+art_obj["size_list"][i]+'</span>';
			}
		my_sizes = my_sizes + '<span class="clear"></span>';

		preview_size_container.innerHTML = my_sizes;
		}
	}


function add_article_to_cart ( form, error_id, title ) {
	var article_to_cart_request = new ajax_engine( "article_to_cart_request", "/tmpl/detail.tmpl",
    function (res) {
      try {
    		var response = eval( res );
        if ( response["reserved_quantity"] > 0 ) {
          close_generic_popup();

          if ( response["number_of_items"] ) { $("head_cart_number_of_items").innerHTML = response["number_of_items"]; }
          if ( response["total_value"] ) { $("head_cart_total_value").innerHTML = response["total_value"]; }

          add_to_cart_tracking( response["art_nr"], response["price_actual"], response["price_list"], response["currency"], response["reserved_quantity"], response["affilinet_site_id"], response["affilinet_url"] );

          if ( $("cart_page") ) {
	          location.reload();
          } else {
            open_generic_popup_params(
              title,
              "id=" + SESSION_ID + ";popup=info.tmpl&amp;pg=" + response['pg'] + "&amp;sub_pg=" + response['sub_pg'] + "&amp;sub_designer=" + response['sub_designer'] + "&amp;designer=" + response['designer'] + "&amp;count_cat_sel=" + response['count_cat_sel'] + "&amp;opened=" + response['opened'] + "&amp;main_cat=" + response['main_cat'] + "&amp;cat=" + response['cat'] + "&amp;art_id=" + response['art_id'] + "&amp;size=" + response['size'] + "&amp;reserved_quantity=" + response['reserved_quantity'] + "&amp;with_video=" + response['with_video'],
              "info_popup");
          }
        } else if ( response["error"] ) {
          var error_div = $( error_id );
          error_div.style.display = "block";
          error_div.innerHTML = response["error"];
        }
    } catch (e) {
       var error_div = $( error_id );
       error_div.style.display = "block";
       error_div.innerHTML = e;
    }
  },
    $(form) );
	article_to_cart_request.start();
}

function add_to_cart_tracking(art_nr, price_actual, price_list, currency, reserved_quantity, affilinet_site_id, affilinet_url) {
	if ( affilinet_site_id ) {
		// Affilinet
		var rts_Tx = Math.random(); rts_Tx = rts_Tx * 100000000000000000;

		var type = "AddToCart";
		var site = affilinet_site_id;
		var product_id =  art_nr;
		var product_price = price_actual;
		var product_oldprice = price_list;
		var currency = currency;
		var product_quantity = reserved_quantity;

		//compose Querystring parameters
		var rts_para = "type=" + type + "&site=" + site + "&product_id=" + product_id + "&product_price="+ product_price + "&currency=" + currency + "&product_oldprice=" + product_oldprice + "&product_quantity=" + product_quantity;

		//set protocol
		try { rts_Protx = (("https:" == document.location.protocol) ? "https" : "http"); }
		catch (err) { rts_Protx = "https"; }

		//create div and iframe to call affilinet
		var d = document.createElement("div");
		d.setAttribute("style", "left: 0px; top: 0px; width: 0px; height: 0px; position: absolute;");
		d.setAttribute("id", "ppx_div_" + rts_Tx , 0);
		var f = document.createElement("iframe");
		with (f){
			setAttribute("id", "ppx_ifr_" + rts_Tx, 0);
			setAttribute("name", "ppx_ifr_" + rts_Tx, 0);
			setAttribute("src", affilinet_url + "?" + rts_para + "&rtspin=true", 0);
			setAttribute("allowtransparency","true",0);
			setAttribute("framespacing","0",0);
			setAttribute("frameborder","no",0);
			setAttribute("scrolling","no",0);
			setAttribute("width","1",0);
			setAttribute("height","1",0);
		}
		d.appendChild(f);
		document.getElementsByTagName("body")[0].appendChild(d);
		// /Affilinet
	}
}

function add_article_to_wishlist ( form, error_id, title ) {
	var article_to_wishlist_request = new ajax_engine( "article_to_wishlist_request", "/tmpl/detail.tmpl",
    function (res) {
      try {
    		var response = eval( res );
        if ( response["wished_quantity"] > 0 ) {
          open_generic_popup_params(
            title,
            "id=" + SESSION_ID + ";popup=info.tmpl&amp;art_id=" + response['art_id'] + "&amp;size=" + response['size'] + "&amp;wished_quantity=" + response['wished_quantity'],
            "info_popup");
        } else if ( response["error"] ) {
          var error_div = $( error_id );
          error_div.style.display = "block";
          error_div.innerHTML = response["error"];
        }
    	} catch (e) {
        var error_div = $( error_id );
        error_div.style.display = "block";
        error_div.innerHTML = e;
    	}
    },
    $(form) );
	article_to_wishlist_request.start();
}

function article_tellafriend ( form, error_id ) {
	var article_tellafriend_request = new ajax_engine( "article_tellafriend_request", "/tmpl/tellafriend.tmpl",
    function (res) {
      try {
    		var response = eval( res );
        if ( response["confirm"] ) {
          close_generic_popup();
          open_confirm_popup(response["title"], response["message"], "confirm_popup_tellafriend");
					setTimeout("close_generic_popup()", 7000);
        } else if ( response["error"] ) {
          var error_div = $( error_id );
          error_div.innerHTML = response["error"];
        }
    	} catch (e) {
        var error_div = $( error_id );
        error_div.innerHTML = e;
    	}
    },
    $(form) );
	article_tellafriend_request.start();
}


//###########################STINER#################################

function show_layer (id) {
	var l = $(id);
	if ( l!= null ) {
		l.style.display = "block";
		}
	}

function hide_layer (id) {
	var l = $(id);
	if ( l!= null ) {
		l.style.display = "none";
		}
	}

function stripScripts (txt) {
	var script = "";
	var html = txt.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function() {
			script += arguments[1] + "\n";
			return "";
		});
	return {"html":html, "script":script};
	}

function getChildsByTagName(obj, tn) {
	var res = [];
	var childnodes = obj.childNodes;
	for ( var i=0; i<childnodes.length; i++ ) {
		if ( childnodes[i].nodeName == tn.toUpperCase()) {
			res.push(childnodes[i]);
			}
		}
	return res;
	}

function startlog() {
	JS_DEBUG = true;
	}

function log(message, message2) {
	if (typeof(JS_DEBUG)=="undefined") return;
	var ld = $("log");
	if (ld==null) {
		var ldcnt = document.createElement("div");
		ld = document.createElement("div");
		ld.id = "log";
		ld.counter = 0;
		ld.style.border = "1px solid blue";
		ld.style.overflow ="auto";
		ld.style.width="300px";
		ld.style.height="200px";
		ldcnt.style.position ="fixed";
		ldcnt.style.right = "5px";
		ldcnt.style.top ="120px";
		ld.style.backgroundColor = "white";
		ldcnt.style.zIndex="1000";
		ld.ondblclick = function () {
			this.innerHTML = "";
			}

		ldcnt.innerHTML='<div id="log_drag" style="width: 300px; height: 20px; border: solid blue 1px; text-align:center; background-color: gray;"><b>LOG</b></div>';
		ldcnt.appendChild(ld);
		document.body.appendChild(ldcnt);
		try { new DragObject(ldcnt, $("log_drag") ); }
		catch (e) {}
		}
	ld.counter = ld.counter + 1;
	message2 = (typeof(message2)=="undefined")?"":message2;
	ld.innerHTML = ld.counter+": "+ message + " "+message2 +"<br/>" + ld.innerHTML;
	}


function loadScripts(id,scrCode) {
	var head  = document.getElementsByTagName("head").item(0);
	if ($("dynamic_script_"+id)!=undefined) {
		head.removeChild($("dynamic_script_"+id));
		}
	scrHandle = document.createElement("script");
	scrHandle.type = "text/javascript";
	scrHandle.id = "dynamic_script_"+id;
	scrHandle.text = scrCode;
	try { void(head.appendChild(scrHandle)); }
	catch (e) { alert(e) }
	}

function loadCSS (src_) {
	//TODO: timestampts abschneiden
	var head  = document.getElementsByTagName("head").item(0);
	nodes = head.getElementsByTagName("link");
	css_file = src_.split("/").pop();
	if ( css_file.indexOf("?")!=-1 ) {
		css_file = css_file.split("?").shift();
	}
	for (i=0; i<nodes.length; i++) {
		node_file = nodes[i].href.split("/").pop();
		if ( node_file.indexOf("?")!=-1 ) {
			node_file = node_file.split("?").shift();
		}
		if ( node_file == css_file ) {
			head.removeChild(nodes[i]);
			break;
		}
	}
	ncss = document.createElement("link");
	env_time = new Date().getTime();
	ncss.href = src_+"?no_cache="+env_time;
	ncss.rel = "stylesheet";
	head.appendChild(ncss);
}


function addLoadEvent(func) {
	if (typeof(STINER_DOM_READY_FLAG)!= "undefined" && STINER_DOM_READY_FLAG==true) {
		func();
		return;
		}

	var oldonload = window.onload;
	if ( typeof(oldonload) != "function") {
		window.onload = function() {
			func();
			STINER_DOM_READY_FLAG = true;
			}
		}
	else {
		window.onload = function() {
			oldonload();
			func();
			STINER_DOM_READY_FLAG = true;
			}
		}
	}

function whenDOMReady(fn) {
	var f = arguments.callee;
	if ("listeners" in f) { // already initialized
		if (f.listeners) // still loading
			f.listeners.push(fn);
		else // DOM is ready
			fn();
		return;
		}
	f.listeners = [fn];
	f.callback = function() {
		removeEvent(window, "load", f.callback);
		if (document.removeEventListener)
			document.removeEventListener("DOMContentLoaded", f.callback, false);
		if (f.listeners) {
			while (f.listeners.length)
				f.listeners.shift()();
			f.listeners = null;
			}
		}
	if (document.addEventListener)
		document.addEventListener("DOMContentLoaded", f.callback, false);
	/*@cc_on @if (@_win32) else
		document.write("<script defer src=\"//:\""+
		               " onreadystatechange=\"if (this.readyState == 'complete')"+
		               " whenDOMReady.callback();\"><\/script>");
	@end @*/
	addEvent(window, "load", f.callback);
	}



function generic_popup_div_request_cb (res) {
	var r = stripScripts(res);
	$("generic_popup_div_content").innerHTML=r["html"];
	if (r["script"]!="") {
		loadScripts("generic_popup_div",r["script"]);
		}
	}

function set_shadow() {
	blackbox = document.createElement("div");
	blackbox.id = "blackbox";
	document.body.appendChild(blackbox);
	blackbox.onclick = function () {
		close_generic_popup();
		}
	}

function unset_shadow() {
	var blb = $("blackbox");
	if (typeof(blb)!="undefined") {
		document.body.removeChild(blb);
		}
	}

function open_confirm_popup (title_, confirmstring, className) {
	var gpp = document.createElement("div");
	gpp.id = "generic_popup_div";
	gpp.style.zIndex = "9999";

	var sct = document.body.scrollTop;
	if ( sct == 0 ) {
		if (window.pageYOffset) {
			sct = window.pageYOffset
		}
		else {
			sct = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
		}
	}
	gpp.style.top = ( 80 + sct ) + "px" ;

	if ( typeof(className) == "undefined" ) { gpp.className = "generic_popup_div confirm_popup"; } else { gpp.className = "generic_popup_div " + className; }
	gpp.innerHTML='<div class="header" id="gpp_dragger"><h1>'+title_+'</h1><span onclick="close_generic_popup()">X</span></div><div class="content"><div id="generic_popup_div_content">'+
	'<span>'+confirmstring+'</span>'
	+'</div></div>';
	set_shadow();
	document.body.appendChild(gpp);
	try { new DragObject(gpp, $("gpp_dragger") ); }
	catch (e) {}
	}


function open_generic_popup_params (title_, params, className) {
	var gpp = document.createElement("div");
	gpp.id = "generic_popup_div";
	gpp.style.zIndex = "9999";

	var sct = document.body.scrollTop;
	if ( sct == 0 ) {
		if (window.pageYOffset) {
			sct = window.pageYOffset
		}
		else {
			sct = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
		}
	}
	gpp.style.top = ( 80 + sct ) + "px" ;

	if ( typeof(className) == "undefined" ) { gpp.className = "generic_popup_div"; } else { gpp.className = "generic_popup_div " + className; }
	gpp.innerHTML='<div class="header" id="gpp_dragger"><h1>'+title_+'</h1><span onclick="close_generic_popup()">X</span></div><div class="content"><div id="generic_popup_div_content"></div></div>';

	gpp_request = new ajax_engine("gpp_request","/ajax/popup_params.html","generic_popup_div_request_cb",params);
	gpp_request.start();

	set_shadow();
	document.body.appendChild(gpp);
	try { new DragObject(gpp, $("gpp_dragger") ); }
	catch (e) {}
	//layer_effect(gpp,"open");
	}

function open_generic_popup (title_, src_, className) {
	var gpp = document.createElement("div");
	gpp.id = "generic_popup_div";
	gpp.style.zIndex = "9999";

	var sct = document.body.scrollTop;
	if ( sct == 0 ) {
		if (window.pageYOffset) {
			sct = window.pageYOffset
		}
		else {
			sct = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
		}
	}
	gpp.style.top = ( 80 + sct ) + "px" ;

	if ( typeof(className) == "undefined" ) { gpp.className = "generic_popup_div"; } else { gpp.className = className; }
	gpp.innerHTML='<div class="header" id="gpp_dragger"><h1>'+title_+'</h1><span onclick="close_generic_popup()">X</span></div><div class="content"><div id="generic_popup_div_content"></div></div>';

	gpp_request = new ajax_engine("gpp_request","/ajax/popup.html","generic_popup_div_request_cb","popup="+src_+";id="+SESSION_ID);
	gpp_request.start();

	set_shadow();
	document.body.appendChild(gpp);

	try { new DragObject(gpp, $("gpp_dragger") ); }
	catch (e) {}
	//layer_effect(gpp,"open");
	}

function close_generic_popup() {
	//layer_effect($("generic_popup_div"),"close");
	var popup = $("generic_popup_div");
	if ( popup != null ) {
		unset_shadow();
		popup.parentNode.removeChild( popup );
		}
	}

function layer_effect (obj, act) {
	this.step = 35;
	this.timeout = 15;
	var w = obj.offsetWidth;
	this.left = w;
	this.right = w;
	this.obj = obj;

	this.open = function () {
		this.obj.style.display = "block";

		if (this.left > 0) {
			this.right += this.step;
			this.left -= step;
			this.obj.style.clip = "rect(auto, "+ this.right +"px, auto, "+ this.left +"px)";
			setTimeout(this.open, this.timeout);
			}
		}

	this.close = function () {
		if (this.left < this.right) {
			this.right -= this.step;
			this.left += this.step;
			var rect = "rect(auto, "+ this.right +"px, auto, "+ this.left +"px)";
			this.obj.style.clip = rect;
			setTimeout(this.close, this.timeout);
			}
		else {
			this.obj.style.display = "none";
			}
		}

	if ( act=="open" ) {
		this.left = w/2;
		this.right = w/2;
		this.open();
		}
	else {
		this.left = 0;
		this.right = w;
		this.close();
		}
	}



var getElementsByClassName = function (className, tag, elm){
	/*
		Developed by Robert Nyman, http://www.robertnyman.com
		Code/licensing: http://code.google.com/p/getelementsbyclassname/
	*/
	if (document.getElementsByClassName) {
		getElementsByClassName = function (className, tag, elm) {
			elm = elm || document;
			var elements = elm.getElementsByClassName(className),
				nodeName = (tag)? new RegExp("\\b" + tag + "\\b", "i") : null,
				returnElements = [],
				current;
			for(var i=0, il=elements.length; i<il; i+=1){
				current = elements[i];
				if(!nodeName || nodeName.test(current.nodeName)) {
					returnElements.push(current);
				}
			}
			return returnElements;
		};
	}
	else if (document.evaluate) {
		getElementsByClassName = function (className, tag, elm) {
			tag = tag || "*";
			elm = elm || document;
			var classes = className.split(" "),
				classesToCheck = "",
				xhtmlNamespace = "http://www.w3.org/1999/xhtml",
				namespaceResolver = (document.documentElement.namespaceURI === xhtmlNamespace)? xhtmlNamespace : null,
				returnElements = [],
				elements,
				node;
			for(var j=0, jl=classes.length; j<jl; j+=1){
				classesToCheck += "[contains(concat(' ', @class, ' '), ' " + classes[j] + " ')]";
			}
			try	{
				elements = document.evaluate(".//" + tag + classesToCheck, elm, namespaceResolver, 0, null);
			}
			catch (e) {
				elements = document.evaluate(".//" + tag + classesToCheck, elm, null, 0, null);
			}
			while ((node = elements.iterateNext())) {
				returnElements.push(node);
			}
			return returnElements;
		};
	}
	else {
		getElementsByClassName = function (className, tag, elm) {
			tag = tag || "*";
			elm = elm || document;
			var classes = className.split(" "),
				classesToCheck = [],
				elements = (tag === "*" && elm.all)? elm.all : elm.getElementsByTagName(tag),
				current,
				returnElements = [],
				match;
			for(var k=0, kl=classes.length; k<kl; k+=1){
				classesToCheck.push(new RegExp("(^|\\s)" + classes[k] + "(\\s|$)"));
			}
			for(var l=0, ll=elements.length; l<ll; l+=1){
				current = elements[l];
				match = false;
				for(var m=0, ml=classesToCheck.length; m<ml; m+=1){
					match = classesToCheck[m].test(current.className);
					if (!match) {
						break;
					}
				}
				if (match) {
					returnElements.push(current);
				}
			}
			return returnElements;
		};
	}
	return getElementsByClassName(className, tag, elm);
};

function build_tabs(el) {
	if (typeof(el)=="undefined") { return false; }
	var nodes = el.childNodes;
	var flag_header = false;
	var flag_footer = false;
	for (i=0; i<nodes.length; i++) {
		if ( nodes[i].nodeName == "DIV" ) {
			if ( flag_header == false ) {
				el.tabs_header = nodes[i].getElementsByTagName("ul")[0];
				flag_header = true;
				}
			else if ( flag_footer == false) {
				el.tabs_footer = nodes[i];
				break;
				}
			}
		}

	el.change_tab = function (nr) {
		var ch_header = el.tabs_header.getElementsByTagName("li");
		var ch_footer = el.tabs_footer.getElementsByTagName("div");
		for ( i=0; i<ch_header.length; i++ ) {
			ch_header[i].className = "";
			ch_footer[i].style.display="none";
			}
		ch_header[nr].className = "selected";
		ch_footer[nr].style.display="block";
		}

	var ch_header = el.tabs_header.getElementsByTagName("li");
	for ( i=0; i<ch_header.length; i++ ) {
		ch_header[i].number = i;
		ch_header[i].onclick = function () {
			el.change_tab(this.number);
			}
		}
	}

function insertAfter( referenceNode, newNode ) {
    referenceNode.parentNode.insertBefore( newNode, referenceNode.nextSibling );
	}

function stiner_slideshow (containerobj, duration) {
	containerobj.change = function () {
		if (containerobj.is_is_show || containerobj.is_it_hide) {
			setTimeout(function() {
				containerobj.change();
				},containerobj.duration);
			return;
			}

		var nIndex = containerobj.imgs[containerobj.current+1]?containerobj.current+1:0;
		var cur_img = containerobj.imgs[containerobj.current];
		var next_img = containerobj.imgs[nIndex];
		setTimeout(function() {
			containerobj.hide (cur_img);
			},1);
		setTimeout(function(){
			containerobj.show (next_img);
			},1);

		containerobj.current = nIndex;
		setTimeout(function() {
			containerobj.change();
			},containerobj.duration);
		}

	containerobj.setOpacity = function (obj) {
		//log("setOpacity");
		if(obj.xOpacity>1) { obj.xOpacity = 1; }
		obj.style.opacity = obj.xOpacity;
		obj.style.MozOpacity = obj.xOpacity;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")";
		}

	containerobj.hide = function (obj) {
		if ( obj.xOpacity >= 1 ) { obj.xOpacity = 1; }
		if ( obj.xOpacity > 0 ) {
			obj.xOpacity = obj.xOpacity-.05;
			containerobj.setOpacity(obj);
			containerobj.is_it_hide = true;
			setTimeout(function() {
				containerobj.hide(obj)
				},50);
			}
		else {
			obj.xOpacity = 0;
			obj.style.display = "none";
			containerobj.is_it_hide = false;
			}
		}

	containerobj.show = function (obj) {
		if ( obj.style.display != "block" ) {
			try { obj.style.display = "block"; }
			catch (e) { log(e); }
			obj.xOpacity = 0;
			}
		if ( obj.xOpacity < 1 ) {
			containerobj.is_is_show = true;
			obj.xOpacity = obj.xOpacity+.05;
			setTimeout(function(){
				containerobj.show(obj);
				},50);
			}
		else {
			obj.xOpacity = 1;
			containerobj.is_is_show = false;
			}
		containerobj.setOpacity(obj);
		}

	containerobj.imgs = containerobj.getElementsByTagName("img");
	containerobj.current = Math.floor( ( containerobj.imgs.length-1 ) * Math.random() );

	containerobj.is_it_hide = false;
	containerobj.is_is_show = false;

	for ( i=1; i<containerobj.imgs.length; i++) {
		containerobj.imgs[i].xOpacity = 0;
		containerobj.imgs[i].style.display = "none";
		}

	containerobj.imgs[containerobj.current].style.display = "block";
	containerobj.imgs[containerobj.current].xOpacity = 1;

	containerobj.duration = ( typeof(duration)=="undefined" )?3000:duration;

	setTimeout(function () {
		containerobj.change();
		}, containerobj.duration);
	}


function stiner_tooltiper(obj, contentobj, add_class, dx, dy) {
	obj.dx = (typeof(dx)=="undefined")?-20:dx;
	obj.dy = (typeof(dy)=="undefined")?-12:dy;
	obj.contentobj = contentobj;
	obj.getCurPos = function (e) {
		var x=0, y=0;
		if (document.all) {//IE
			x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
			y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
			x += window.event.clientX;
			y += window.event.clientY;
			}
		else {//Good Browsers
			if (!e) { x = 0; y = 0; }
			else { x = e.pageX; y = e.pageY; }
			}
		return {"x":x,"y":y};
		}

	obj.onmouseover = function (e) {
		if (typeof(STINER_DOM_READY_FLAG) == "undefined") { return; }
		var tt = document.createElement("div");
		tt.id = "stiner_ToolTip";
		tt.className = "toolTip_big";
		if ( typeof(add_class) != "undefined" ) { tt.className = tt.className+" "+add_class; }
		tt.backgroundColor = "green";
		tt.innerHTML = obj.contentobj.innerHTML;
		document.body.appendChild(tt);

		obj.onmousemove(e);
		}

	obj.start = function () { obj.onmouseover() }

	obj.onmousemove = function (e) {
		var curpos = this.getCurPos(e);
		var tt = $("stiner_ToolTip");
		if ( tt == null ) return;
		tt.style.top = curpos.y-tt.offsetHeight+obj.dy+"px";
		tt.style.left = curpos.x+obj.dx+"px";
		}

	obj.onmouseout = function() {
		var obj = $("stiner_ToolTip");
		if (obj != null) obj.parentNode.removeChild(obj);
		}
	}

function stiner_moover(control_up, control_down, container, add_mouse_wheel) {
	container.movecontent = container.getElementsByTagName("div")[0];
	container.style.position = "relative";
	container.movecontent.style.position = "absolute";
	container.movecontent.style.top = "0px";
	container.act = false;
	container.duration = 30;
	container.step = 4;

	container.doMove = function (direction, offset) {
		var offset = (parseInt(offset))?offset:container.step;
		if ( container.movecontent.offsetHeight < container.offsetHeight ) { return; }
		var mypos = parseInt(container.movecontent.style.top.substr(0,container.movecontent.style.top.length-2));
		if ( direction == "up" ) {
			container.movecontent.style.top = mypos-offset+"px";
			if ( -(mypos-1) + container.offsetHeight > container.movecontent.offsetHeight ) {
				container.stop();
				container.movecontent.style.top = container.offsetHeight-container.movecontent.offsetHeight+"px";
				}
			}
		else if ( direction == "down" ) {
			if ( mypos > 0 ) {
				container.stop();
				container.movecontent.style.top = "0px";
				}
			else {
				container.movecontent.style.top = (((mypos+offset)>0)?0:(mypos+offset))+"px";
				}
			}
		if (container.act) {
			setTimeout( function() { container.doMove(direction) }, container.duration);
			}
		}


	if (typeof(add_mouse_wheel)!="undefined") {
		if (add_mouse_wheel) {

			container.myscroll = function (e) {
				e = e ? e : window.event;

				var raw = e.detail ? e.detail : e.wheelDelta;
				var normal = e.detail ? e.detail * -1 : e.wheelDelta / 40;

				if (e.type == "mousewheel") { raw = -raw; }

				if (raw>0) {
					container.doMove("up", 10);
					}
				else {
					container.doMove("down", 10);
					}
				cancelEvent(e);
				}

			if (container.addEventListener) {
				container.addEventListener("DOMMouseScroll", container.myscroll, false);
				container.addEventListener("mousewheel", container.myscroll, false);
				}
			else if (container.attachEvent) {
				container.attachEvent("onmousewheel",container.myscroll, false);
				}
			else {
				container.onmousewheel = container.myscroll;
				}

			}
		}

	container.stop = function () {
		container.act = false;
		}


	control_up.onmouseover = function () {
		container.act = true;
		container.doMove("up");
		}
	control_up.onmouseout = function () {
		container.stop()
		}

	control_down.onmouseover = function () {
		container.act = true;
		container.doMove("down");
		}
	control_down.onmouseout = function () {
		container.stop()
		}
	}

function stiner_moover3 (control_up, control_down, container, items) {
	container.loop_timeout = 5000;
	container.duration = 500;
	container.do_automatic_loop = true;
	container.items = items;
	container.curpos = 0;
	container.lock = false;

	container.onmouseover = function () { container.do_automatic_loop = false; }
	container.onmouseout = function () { container.do_automatic_loop = true; }
	container.getNext = function() { return (this.curpos==this.items.length-1)?0:this.curpos+1; }
	container.getPrevios = function() { return (this.curpos==0)?this.items.length-1:this.curpos-1; }
	container.setLock = function() {
		container.lock = true;
		setTimeout(function(){ container.lock=false }, this.duration+10);
		}

	$each(items,
		function (item) {
			opacity(item,0);
			extend(item,"fade",fade);
			item.fade(0,1);
			item.style.zIndex=1;
			}
		);
	opacity(items[0],1);
	items[0].style.zIndex=2;


	container.set_loop_timeout = function (sec) {
		if (sec<1) {sec=1;}
		this.loop_timeout = sec*1000;
		}

	container.do_loop = function () {
		//startlog();
		//log("change "+this.curpos+" to "+this.getNext());
		if ( this.do_automatic_loop && !this.lock ) {
			this.setLock();
			this.items[this.curpos].fade(0,this.duration);
			this.items[this.curpos].style.zIndex=1;
			this.items[this.getNext()].fade(1,this.duration);
			this.items[this.getNext()].style.zIndex=2;
			this.curpos=this.getNext();
			}
		setTimeout(function(){ container.do_loop(); }, this.loop_timeout);
		}

	container.change_up = function () {
		if (container.lock) return;
		container.setLock();
		container.items[container.curpos].fade(0,container.duration);
		container.items[container.curpos].style.zIndex=1;
		container.items[container.getNext()].fade(1,container.duration);
		container.items[container.getNext()].style.zIndex=2;
		container.curpos=container.getNext();
		}

	control_up.onclick = function () {
		container.change_up();
		}

	container.change_down = function () {
		if (container.lock) return;
		container.setLock();
		container.items[container.curpos].fade(0,container.duration);
		container.items[container.curpos].style.zIndex=1;
		container.items[container.getPrevios()].fade(1,container.duration);
		container.items[container.getPrevios()].style.zIndex=2;
		container.curpos=container.getPrevios();
		}

	control_down.onclick = function () {
		container.change_down();
		}

	container.do_loop();
	}



function stiner_moover2 (control_up, control_down, container, offset) {
	container.offset = offset;
	container.movecontent = container.getElementsByTagName("div")[0];
	container.style.position = "relative";
	container.movecontent.style.position = "absolute";
	container.movecontent.style.top = "0px";
	container.duration = 10;
	container.step = 5;
	container.topos = null;
	container.ismooving = false;
	container.do_automatic_loop = true;
	container.automatic_loop_direction = "down";
	container.loop_timeout = 5000;

	container.set_loop_timeout = function (sec) {
		this.loop_timeout = sec*1000;
		}

	container.do_loop = function () {
		var pos = container.get_pos();
		if ( container.do_automatic_loop && !container.ismooving ) {
			if ( this.isonbottom() || this.isontop() ) {
				if (this.automatic_loop_direction=="up") { this.automatic_loop_direction="down"; }
				else { this.automatic_loop_direction="up"; }
				}

			if (this.automatic_loop_direction=="up") { this.move_up(); }
			else { this.move_down(); }
			}
		setTimeout(function(){ container.do_loop(); }, this.loop_timeout);
		}

	container.get_pos = function() {
		var pos = parseInt(container.movecontent.style.top.substr(0,container.movecontent.style.top.length-2));
		return pos;
		}

	container.move_up = function(isreq) {
		var pos = container.get_pos();
		if ( isreq == undefined ) {
			this.ismooving = true;
			this.topos = pos - this.offset;
			setTimeout(function(){ container.move_up(true); },this.duration);
			}
		else {
			if ( pos > this.topos ) {
				this.movecontent.style.top = pos-this.step+"px";
				setTimeout(function(){ container.move_up(true); },this.duration);
				}
			else {
				this.movecontent.style.top = this.topos+"px";
				this.ismooving = false;
				//if (this.isontop()) { this.automatic_loop_direction = "down"; }
				}
			}
		}

	container.isontop = function () {
		var pos = container.get_pos();
		return ( pos >= 0 )?true:false;
		}

	container.isonbottom = function() {
		var pos = container.get_pos();
		return (pos+this.movecontent.offsetHeight-15 <= this.offsetHeight) ? true : false;
		}

	container.move_down = function (isreq) {
		var pos = container.get_pos();
		if ( isreq == undefined ) {
			this.ismooving = true;
			this.topos = pos + this.offset;
			setTimeout(function(){ container.move_down(true); },this.duration);
			}
		else {
			if ( pos < this.topos ) {
				this.movecontent.style.top = pos+this.step+"px";
				setTimeout(function(){ container.move_down(true); },this.duration);
				}
			else {
				this.movecontent.style.top = this.topos+"px";
				this.ismooving = false;
				//if (this.isonbottom()) { this.automatic_loop_direction = "up"; }
				}
			}
		}

	if (container.movecontent.offsetHeight>container.offsetHeight) {
		setTimeout(function(){ container.do_loop(); }, container.loop_timeout);
		}

	container.movecontent.onmouseover = function () { container.do_automatic_loop = false; }
	container.movecontent.onmouseout = function () { container.do_automatic_loop = true; }

	control_up.onclick = function () {
		if ( !container.ismooving && !container.isonbottom() ) { container.move_up(); }
		}

	control_down.onclick = function () {
		if ( !container.ismooving && !container.isontop() ) {container.move_down();}
		}


	}



function tatis_images_changer( obj, target, list, mover_left, mover_right ) {
	obj.nr = 0;
	if (typeof(list) != "object") return;
	obj.list = list;

	if (target==null) target=obj;
	obj.target = target;
	obj.clear_nr = function() {
		this.nr = 0;
		}
	obj.show_prev_image = function () {
		if (typeof(this.target) == "string") this.target = $(this.target);
		this.nr--;
		if ( this.nr == -1 ) { this.nr = this.list.length - 1; }
		this.target.src = this.list[this.nr];
		}
	obj.show_next_image = function () {
		if (typeof(this.target) == "string") this.target = $(this.target);
		this.nr++;
		if ( this.nr == this.list.length ) { this.nr = 0; }
		this.target.src = this.list[this.nr];
		}
	if ( typeof(mover_left) == "object" ) {
		mover_left.onclick = function(e) {
			obj.show_prev_image();
			if (!e) var e = window.event;
			cancelEvent(e);
			}
		}
	if ( typeof(mover_right) == "object" ) {
		mover_right.onclick = function (e) {
			obj.show_next_image();
			if (!e) var e = window.event;
			cancelEvent(e);
			}
		}
	}

function tatis_quick_shopping( obj, art_id, quick_shopping, with_video ) {
	if ( typeof(quick_shopping) == "object" ) {
		quick_shopping.onclick = function(e) {
			var query_string = 'id='+SESSION_ID+'&amp;popup=article_details.tmpl&amp;art_id='+art_id;
			if ( with_video == 1 ) query_string += '&amp;with_video=1';
			open_generic_popup_params('', query_string, 'detail_popup');
			if (!e) var e = window.event;
			cancelEvent(e);

			var sct = document.body.scrollTop;
			if ( sct == 0 ) {
				if (window.pageYOffset) { sct = window.pageYOffset }
				else { sct = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0; }
				}
			$('generic_popup_div').style.top = ( 80 + sct ) + "px" ;
			}
		}
	}

function tatis_cliplister_video( obj, art_id, header, cliplister_video ) {
	if ( typeof(cliplister_video) == "object" ) {
		cliplister_video.onclick = function(e) {
			open_generic_popup_params(header, 'id='+SESSION_ID+'&amp;popup=article_clip.tmpl&amp;art_id='+art_id, 'article_clip');
			if (!e) var e = window.event;
			cancelEvent(e);

			var sct = document.body.scrollTop;
			if ( sct == 0 ) {
				if (window.pageYOffset) { sct = window.pageYOffset }
				else { sct = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0; }
				}
			$('generic_popup_div').style.top = ( 80 + sct ) + "px" ;
			}
		}
	}

try {
	var blabels_request = new ajax_engine("blabels_request",
							"/ajax/brand_labels.js",
							function (res) {
									 loadScripts("brand_labels_hash",res);
								});
	blabels_request.start();
	}
catch (e) { }

brand_labels_hash = {}

function change_brand_label(mhref) {
	var mymhref = unescape(mhref).replace(" ","_");
	brand_name = "none";

	if (mymhref.indexOf("designer")>-1) {
		var brand_name = mymhref.split("designer=")[1];
		if (brand_name.indexOf(";")>-1) { brand_name = brand_name.split(";")[0]; }
		if (brand_name.indexOf("&")>-1) { brand_name = brand_name.split("&")[0]; }
		}

	if (brand_labels_hash[brand_name] != undefined) {
		var brand_akr = brand_labels_hash[brand_name.replace(" ","_")];
		document.body.style.backgroundImage = "url('/images/brand_labels/"+brand_akr+"_1.jpg')";
		}
	else {
		document.body.style.backgroundImage = "none";
		}
	}

function check_email(mail) {
	var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
	return filter.test(mail);
	}

//###########################ALEX#################################

function raise_event (event, element) {
	if (document.createEvent) {
		var evObj = document.createEvent("Events");
		evObj.initEvent(event, true, false);
		element.dispatchEvent(evObj);
	}
	else if (document.createEventObject) {
		var evObj = document.createEventObject();
		element.fireEvent('onkeyup',evObj);
	}
}

function remove_so_box (obj) {
	var parent = obj.parentNode;
	parent.removeChild(obj);
}

function make_dd_box(obj) {
	obj.style.display = "block";
	obj.span = obj.getElementsByTagName("span")[0];
	obj.container = obj.getElementsByTagName("div")[0];
	obj.list = obj.getElementsByTagName("ul")[0];
	obj.anchor = obj.getElementsByTagName("a")[0];
	obj.container.style.display = "none";
	obj.closed = true;

	if (obj.addEventListener) {
		obj.parentNode.parentNode.addEventListener ("hide", function(e){
			if (e.target.id != obj.id) {
				obj.container.style.display = "none";
				obj.closed = true;
			}
		}, false);
		obj.span.addEventListener ("click", function(e){
			obj.toggle();
			raise_event("hide", obj);
		}, false);
		obj.addEventListener ("mouseout", function (e){
			var source = e.target;
			var target = e.relatedTarget;
			obj.disappear(source, target);
		}, false);
	}
	else if (obj.attachEvent){
		obj.parentNode.parentNode.attachEvent ("onkeyup", function(e){
			if (e.srcElement.id != obj.id) {
				obj.container.style.display = "none";
				obj.closed = true;
			}
		});
		obj.span.attachEvent ("onclick", function(e){
			if (e.srcElement.id != obj.id) {
				obj.toggle();
				raise_event("hide", obj);
			}
		});
		obj.attachEvent ("onmouseout", function(e){
			var source = e.srcElement;
			var target = e.toElement;
			obj.disappear(source, target);
		});
	}
	obj.disappear = function(source, target) {
		//console.log('source: ' + source.nodeName + ' target: ' + target.nodeName);
		if (source.nodeName == 'SPAN') {
			if (target == obj.container || target.parentNode.parentNode.parentNode == obj.container || target.parentNode == obj.span) {return;}
			if (!obj.closed) {obj.toggle();}
			return;
		} else if (source.nodeName != 'DIV') {return;}
		if (target.nodeName == 'SPAN') {return;}
		while (target != source && target.nodeName != 'BODY') {
			target= target.parentNode;
			if (target == source) return;
		}
		//ab hier: mouseout nur auf div-container, keine mouseout events innerhalb des containers!
		obj.toggle();
	}
	obj.toggle = function() {
		if (!this.closed) {
			this.container.style.display = "none";
			this.closed = true;
			this.span.focus();
		}
		else {
			this.container.style.display = "block";
			this.closed = false;
			this.container.focus();
			var tmp = this.container.getElementsByTagName("a");
			for (var i = 0; i < tmp.length; i++) {
				if (tmp[i].getAttribute("class") == "dd_item_anchor selected") {
					this.container.scrollTop = tmp[i].offsetTop;
				}
				else if (tmp[i].getAttributeNode("class").value == "dd_item_anchor selected") {
					this.container.scrollTop = tmp[i].offsetParent.offsetTop;
				}
			}
		}
	}
}

function tatis_moover(control_up, control_down, container) {
	container.act = false;

	container.stop = function () {
		container.act = false;
	}

	container.move = function (step) {
		container.scrollTop += step;
		if (container.act) {
			setTimeout( function() { container.move(step) }, 30);
		}
	}

	control_up.onmouseover = function () {
		var step = 10;
		container.act = true;
		container.move(step);
	}

	control_up.onmouseout = function () {
		container.stop();
	}

	control_down.onmouseover = function () {
		var step = -10;
		container.act = true;
		container.move(step);
	}

	control_down.onmouseout = function () {
		container.stop()
	}
}

function ticker(element, padding, max_padding) {
	padding = (padding < max_padding) ? 0 : padding - 1;
	element.style.left = padding + 'px';
	setTimeout( function() {
		ticker(element, padding, max_padding)
	}, 50);
}
//################################################################

