var browserName=navigator.appName;var browserVer=parseInt(navigator.appVersion);var version="";var msie4=(browserName=="Microsoft Internet Explorer"&&browserVer>=4);if((browserName=="Netscape"&&browserVer>=3)||msie4||browserName=="Konqueror"||browserName=="Opera"){version="n3";}else{version="n2";}
function blurLink(theObject){if(msie4){theObject.blur();}}


var _=function(root, query){
	if(!root) return undefined;
	if(JJ.type(root, "String")){
		var el;
		if(/^#?[a-z0-9_]+$/i.test(root)) el=document.getElementById(root.replace(/#/,"")); //root as id
		if(el) root=el;
		else{query=root; root=document;} //root as query
	}
	if(!query && root._extended) return root;
	var els=root;
	if(query) els=JJ.getElements.parse(query, root);
	
	if(!els) return ""; //if no element return empty string
	
	if(!JJ.type(els, "Array")) JJ.extend(els, JJ.element); //exend one element
	else JJ.foreach(els, function(){ JJ.extend(this, JJ.element)}); //exend elements group (array object)
	return els;
};

//-------------------------------------------- JJ ------------------------------------------------
var JJ={};

//Base JJ function

JJ.type=function(obj, _type){
	var t=typeof obj;
	if(!_type) return t;
	if(obj==undefined) return _type==undefined;
	_type=_type.toLowerCase();
	switch(_type){
		case "object":   return obj.constructor==Object;
		case "array":    return obj.constructor==Array; //t=="object" && obj.length; 
		case "number":   return t=="number" || !isNaN(obj);
		case "element":  return t=="object" && obj.nodeType==1;
		case "date":     return obj.constructor==Date;
		case "string":     return obj.constructor==String;
		case "boolean":     return obj.constructor==Boolean;
		case "function":     return t=="function";
		default: return t==_type; 
	}
};
JJ.foreach=function(obj, func){
	if(!JJ.type(obj, "Array")) return func.call(obj);
	for(var i=0, arr=[], l=obj.length; i<l; i++)
		arr.push(func.call(obj[i], i));
	return arr;
};
JJ.extend=function(obj, methods){
	var call=function(obj, name, args){
		if(!JJ.type(obj, "Array") || name=="repeat"){
			return methods[name].exec(obj, args[0], args[1], args[2], args[3]);
		}
		else{
			//execute functions and return elements
			var res=JJ.foreach(obj, function(){ return methods[name].exec(this, args[0], args[1], args[2], args[3])});
			if(res[0]){
				if(res[0]._extended) JJ.extend(res, methods); //re-extend root element
				
				//play elements group events (overload result with functions)
				if(JJ.type(res[0], "Function") && name=="event"){ 
					var _res=res; 
					res=function(){
						for(var i=0, l=_res.length; i<l; i++) 
							if(_res[i]) 
								_res[i].apply(obj[i], arguments); 
					};
				}
			}
			return res;
		}
	};
	var attach=function(obj, name){
		//attach property to element or to elements group
		obj[name]=function(){return call(this, name, arguments)};
	};
	
	if(obj._extended) return false;
	obj._extended=true;
	for(var i in methods) attach(obj, i);
	
	return obj;
};

//wait for loading needed function or from other file
JJ.wait=function(func){
	try{ func() }catch(e){ setTimeout(func,10) }
};

JJ.create=function(tag){
	return JJ.extend(document.createElement(tag), JJ.element);
};


/*
Find Elements in DOM
	"*"                   //any tags
	"h1"                  //all <h1>
	"p a"                 //all nesting childs A <p><b><a>
	"p>a"                 //all siblings A <p><a>
	"p>*"                 //all siblings
	"p a, div a"          //multiply selection
	"#id"                 //id="id"
	".classname"          //class="classname"
	"[attr]"              //has this attr
	"[!attr]"             //hasn't this attr
	"[attr=value]"        //attr=value
	"[attr!=value]"       //attr!=value
	":^" ":0"             //first child
	":$"                  //last child
	":4"                  //child in position 4 (from 0)
	"<"                   //parent node
	"<div.classname"      //search div parent node with className
	"<:1"                 //return second parent node
	"+a"                  //next sibling element
	"+a:2"                //next (nearest with position) sibling element
	"-.classname"         //previous sibling element
	"()"                  //groups...
*/
JJ.getElements={
	parse:function(query, root){
		
		query=query.replace(/((^)|([ ><+\-,]))(([#.:\[,])|($))/g, "$1*$4")+" "; //set * for any tag
		root=root || document;
		
		var sep=" ><+-,", //levels separations
			breakset=" ><+-,:[", // breakset for conditions
			cond={"#":  breakset, ".":  breakset, ":":  breakset, "[":  "]"}, //out of fit condition
			prop={"#":"id", ".":"className", ":":"pos", "[":"attr", "<":"parentNode", "+":"nextSibling", "-":"previousSibling"}, //operations

			i=-1, c, fit, match, root_arr=[root], multi_arr=[], len=query.length;
		while(c=query.charAt(++i)){
			if(fit){
				if(cond[fit].indexOf(c)!=-1){ //out from fit
					fit=null;
					if(c=="]") match.attr=this.attr2struct(match.attr); //parse attribute
					else i--;
					continue;
				}
				match[prop[fit]]+=c; //add filter chars if in fit
			}
			else{
				if(sep.indexOf(c)!=-1){//if find separator
					if(match){
						this.init_match(match);
						root_arr=this.walk(match, root_arr); //search previous match
					}
					if(c==","){ //set next matches set
						multi_arr=multi_arr.concat(root_arr);
						root_arr=[root];
						match=null; 
						continue;
					}
					if(i==len-1) break; //exit if this is last instruction
					match={tag:"", child:c!=" ", move_to:prop[c]}; //init match if first sep
					continue;
				}
				if(!match){ //init match if first tag
					match={tag:c, child:false};
					continue;
				}
				if(c in cond){ //find filter fit
					match[prop[fit=c]]=""; //init current filter & set current prop
					continue;
				}
				match.tag+=c;
			}
		}
		if(multi_arr.length) root_arr=multi_arr.concat(root_arr);
			////alert(MATCH_DEBUG+"\n"+(root_arr.length==1?root_arr[0]:root_arr));
		return root_arr.length==1?root_arr[0]:(root_arr[0]?root_arr:undefined); //element or array
	},
	walk:function(match, root_arr){
			////MATCH_DEBUG.push(match);
		var root_el, i=0, new_arr=[];
		while(root_el=root_arr[i++]){
			var el, j=0, match_arr=[];
			if(match.only_id){
				if(el=document.getElementById(match.id)) new_arr[new_arr.length]=el;
				continue;
			}
			if(match.move_to){
				if(el=this.move(match, root_el)) new_arr[new_arr.length]=el;
				continue;
			}
			var nodes=match.child?root_el.childNodes:root_el.getElementsByTagName(match.tag); //get elements
			//filter nodes
			while(el=nodes[j++]){
				if(match.single_tag || this.check_filters(match, el))
					match_arr[match_arr.length]=el;
			}
			//position filter 
			if(match.pos){
				if(el=this.pos(match, match_arr)) new_arr[new_arr.length]=el;
				continue;
			}
			new_arr=new_arr.concat(match_arr); //add all mathes to array
		}
		return new_arr;
	},
	init_match:function(match){
		match.tag=match.tag.toUpperCase();
		if(match.tag=="*" && match.id && !match.className && !match.attr) match.only_id=1;
		if(!match.id && !match.className && !match.attr) match.no_prop=1;
		if(!match.child && match.no_prop) match.single_tag=1;
	},
	check_filters:function(match, el){
		if(match.child && (el.nodeType!=1 || (match.tag!="*" && match.tag!=el.tagName))) return false;
		if(match.no_prop) return true; //fast instruction [no_prop]
		if(match.id && match.id!=el.id) return false;
		if(match.className && !JJ.element.classname.exist(el, match.className)) return false;
		if(match.attr){
			var attr=JJ.element.attr.get(el, match.attr.key, 1);
			if(match.attr.equal==false && attr!=match.attr.value) return false;
			if(match.attr.equal==true && attr==match.attr.value) return false;
		}
		return true;
	},
	attr2struct:function(expr){
		var equal;
		if(expr.indexOf("!")==0){ expr=[expr.substr(1)]; equal=false;}
		else if(expr.indexOf("!")>0){ expr=expr.split("!="); equal=true;}
		else if(expr.indexOf("=")!=-1){ expr=expr.split("="); equal=false;}
		else {expr=[expr]; equal=true;}
		return {key:expr[0], value:expr[1], equal:equal};
	},
	pos:function(match, match_arr){ //return element by some position
		var pos;
		if(match.pos=="^") pos=0;
		else if(match.pos=="$") pos=match_arr.length-1;
		else if(JJ.type(match.pos, "Number")) pos=Number(match.pos);
		if(pos!=undefined && pos<match_arr.length) return match_arr[pos]; //match element
		return;
	},
	move:function(match, el){ //go to parentNode||nextSibling||previousSibling
		var pos=0;
		while(el=el[match.move_to])
			if(this.check_filters(match, el))
				if(Number(match.pos||0)==pos++) 
					break;
		return el;
	}
};

//Base methods for elements-----------------------------------------------------------------
JJ.element={};


/*
*Element foreach function
*(function(){})
*/
JJ.element.repeat={
	exec:function(obj, func){
		if(JJ.type(obj, "String")) return obj; //check obj for compatibility
		JJ.foreach(obj, func);
		return obj;
	}
};



/*
*Element attributes functions
*("id")                         //get attribute  #String
*(["id", "name", "href"])       //get attributes  #Hash
*("id", "ppp")                  //set attribute "id"="ppp"  #Element
*({name:"abc", param:1})        //set attributes from hash  #Element
*/
JJ.element.attr={
	exec:function(obj, name, value){
		if(JJ.type(obj, "String")) return obj; //check obj for compatibility
		if(JJ.type(name, "String")){
			if(value!=undefined) return this.set(obj, name, value);
			else return this.get(obj, name);
		}
		else if(JJ.type(name, "Object")){
			for(var i in name)
				this.set(obj, i, name[i]);
			return obj;
		}
		else if(JJ.type(name, "Array")){
			var hash={};
			for(var i=0, l=name.length; i<l; i++)
				hash[name[i]]=this.get(obj, name[i]);
			return hash;
		}
	},
	get:function(obj, name, only_tag_attr){
		var attr=obj.getAttribute?obj.getAttribute(name):undefined;
		if(attr==undefined && !only_tag_attr) attr=obj[name];
		if(attr=='' && obj.attributes && obj.attributes[name] && !obj.attributes[name].specified) attr=undefined; //for IE 
		return attr;
	},
	set:function(obj, name, value){
		if(obj.setAttribute && !JJ.type(value, "Function")) obj.setAttribute(name, value);
		obj[name]=value;
		return obj;
	}
};


/*
*Element events functions
*("onclick", function(){})                      //set event  #Element
*("onclick", "alert(1)")                        //set event  #Element
*({onclick:function(){}, onblur:"alert(1)"})    //set event set  #Element
*("onclick", null)                              //remove event  #Element
*("oncomplete")                                 //return event  #Function [default]
*("oncomplete(arg1, arg2,... )")            //return event and init arguments  #Function [default]
*("oncomplete(:Array)")                         //return all event entries  #Array of functions
*("oncomplete(:String)")                        //return event body  #String
*(["onclick","oncomplete"])                     //return set of events in Array #Array of functions [default]
*/
JJ.element.event={
	exec:function(obj, name, value){
		if(!obj.attachEvent && !obj.addEventListener) return obj; //check obj for compatibility
		if(JJ.type(name, "String")){
			if(value!==undefined) return this.set(obj, name, value);
			else return this.get(obj, name); 
		}
		else if(JJ.type(name, "Object")){
			for(var i in name)
				this.set(obj, i, name[i]);
			return obj;
		}
		else if(JJ.type(name, "Array")){
			var hash={};
			for(var i=0, l=name.length; i<l; i++)
				hash[name[i]]=this.get(obj, name[i]);
			return hash;
		}
	},
	set:function(obj, ev, func){
		if(func===null) return this.remove(obj, ev);
		var prev_func=this.get(obj, ev);
		func=this.toFunc(func, obj);
		var call=function(_this, args){
			if(prev_func) prev_func.apply(_this, args);
			return func.apply(_this, args);
		};
		this.rec(obj, ev, func); //write event to data array _onevent_=[]
		obj[ev]=function(){return call(this, arguments)}; //reinit element event
		return obj;
	},
	get:function(obj, ev){
		if(ev.indexOf("(")!=-1){
			var param=ev.split("(");
			ev=param[0];
			var _return=param[1].substr(0, param[1].length-1);
			var args="";
			switch(_return){
				case ":String": return this.toStr(obj["_"+ev+"_"]);
				case ":Array": return obj["_"+ev+"_"];
				default: args=_return;
			}
		}
		var attr=JJ.element.attr.get(obj, ev);
		var func=this.toFunc(attr, obj, args);
		return func;
	},
	remove:function(obj, ev){
		obj[ev]=function(){};
		return obj;
	},
	toFunc:function(attr, obj, args){
		var func;
		if(!attr) return function(){};
		if(JJ.type(attr, "String")) func=new Function(args, attr);
		else func=attr;
		return function(){return func.apply(obj, arguments)};
	},
	toStr:function(_evs){
		if(!_evs) return '';
		var str='';
		for(var i=0, l=_evs.length; i<l; i++){
			var s=_evs[i].toString();
			s=s.replace(/^function[^{]*\{(.*)/gi,"$1");
			s=s.substr(0, s.length-2);
			str+=s+"\n";
		}
		str=str.replace(/;([^\n])/gi,";\n$1");
		return str;
	},
	rec:function(obj, ev, func){

		var _ev="_"+ev+"_";
		if(!obj[_ev]){
			obj[_ev]=[];
			var prev_func=this.get(obj, ev);
			if(prev_func) obj[_ev].push(prev_func);
		}
		obj[_ev].push(func);
	}
};


/*
*Element styles functions (with isNaN check)
*("top")                           //get: "top"  #String or #Number
*(["top", "left"])                 //get: ["top", "left"]  #Hash     
*(["marginLeft", "height"], true)  //get all not empty: ["height"]  #Hash     
*("top", "20")                     //set: "top"="20px"  #Element
*("display", "none", "block")      //toogle: if(display==none) display=block  #Element
*({top:100,left:50})               //set: {top:"20px", left:"10px"}  #Element
*/
JJ.element.css={
	exec:function(obj, name, value, value2){
		if(!JJ.type(obj, "Element")) return obj; //check obj for compatibility
		if(JJ.type(name, "String")){
			if(value!=undefined){
				if(value2!=undefined && this.get(obj, name)==value) value=value2;
				return this.set(obj, name, value);
			}
			else return this.get(obj, name); 
		}
		else if(JJ.type(name, "Object")){
			for(var i in name)
				this.set(obj, i, name[i]);
			return obj;
		}
		else if(JJ.type(name, "Array")){
			var hash={};
			for(var i=0, l=name.length; i<l; i++){
				var val=this.get(obj, name[i]);
				if(!val && value) continue; //if (["top", "left"], true) - return only not empty values 
				hash[name[i]]=val;
			}
			return hash;
		}
	},
	//convert js style property to css property (zIndex -> z-index)
	js2css:function(prop){
		return prop.replace(/([A-Z])/g,"-$1").toLowerCase();
	},
	//get style
	get:function(obj, name){
		var value;
		if(obj.currentStyle) value=obj.currentStyle[name]; //IE, opera
		else if(window.getComputedStyle) value=window.getComputedStyle(obj, null).getPropertyValue(this.js2css(name)); //other Gesco
		else value=obj.style[name]; //other
		if(/^[0-9]+px/.test(value)) value=parseInt(value); //remove "px" [default] from number
		return value;
	},
	//set style 
	set:function(obj, name, value){
		var no_px={"zIndex":1, "opacity":1};
		if(value && JJ.type(value, "Number") && !(name in no_px)) value+="px"; //add "px" [default] to number
		if(name=="opacity" && BROWSER.ie){
			name="filter";
			value=(value==1?"":"Alpha(opacity="+(value*100)+")");
		}
		if(name=="float") name=BROWSER.ie?"styleFloat":"cssFloat";
		try{obj.style[name]=value;}catch(e){throw "element.css.set() -> obj.style."+name+"="+value};
		return obj;
	},
	//check style
	check:function(obj, name){
		return true;
	}
};


/*
*Element className functions
*()             //get className  #String
*("*")          //get all defined names in className  #Array
*("^")          //get first name  #String
*("$")          //get last name  #String
*("+name")      //add name to className  #Element
*("-name")      //remove name from className  #Element
*("!name")      //toogle name  #Element
*("?name")      //check name existing  #Boolean
*("name")       //set className  #Element
*("")           //clear className  #Element
*/
JJ.element.classname={
	exec:function(obj, query){
		if(obj.className==undefined) return obj; //check obj for compatibility
		if(query==null) return obj.className;
		var c=query.charAt(0);
		var name=query.substr(1);
		with(this){
			switch(c){
				case "*": return all(obj);
				case "^": return get(obj, 0);
				case "$": return get(obj, 1);
				case "+": add(obj, name); break;
				case "-": remove(obj, name); break;
				case "!": toogle(obj, name); break;
				case "?": return exist(obj, name);
				default:  set(obj, query);
			}
		}
		return obj;
	},
	empty:function(obj){
		return obj.className.replace(/\s/g,"")==""?true:false;
	},
	exist:function(obj, name){
		return (new RegExp('((^)|(\\s))'+name+'((\\s)|($))')).test(obj.className);
	},
	all:function(obj){
		return !this.empty(obj)?obj.className.split(/\s+/):[];
	},
	get:function(obj, pos){
		var arr=this.all(obj);
		if(!arr.length) return "";
		pos=pos?arr.length-1:0;
		return arr[pos];
	},
	set:function(obj, name){
		obj.className=name;
	},
	add:function(obj, name){
		this.remove(obj, name);
		obj.className+=obj.className?' '+name:name;
	},
	remove:function(obj, name){
		obj.className=obj.className.replace(new RegExp("((^)|(\\s))"+name+"((\\s)|($))"),"$3");
	},
	toogle:function(obj, name){
		this.exist(obj, name) ? this.remove(obj, name) : this.add(obj, name);
	}
};


/*
*Element insert functions
*("span")                       //append <span>
*("span:^")("span:0")           //insert <span> before first element
*("span:2")                     //insert <span> before second sibling
*("span", beforeElement)        //insert <span> before beforeElement
*("input", {type:"submit"})     //insert <input> and set attribute "type" before insert
*/
JJ.element.insert={
	exec:function(obj, tag, opt){
		if(!obj.appendChild) return obj; //check obj for compatibility
		var elem=tag;
		var beforeElement;
		if(JJ.type(tag, "String")){
			if(tag.indexOf(":")!=-1){
				var params=tag.split(":");
				tag=params[0];
				beforeElement=JJ.getElements.parse(">:"+params[1], obj);
			}
			elem=document.createElement(tag);
		}
		
		if(JJ.type(opt, "Object") && !opt.nodeType) JJ.element.attr.exec(elem, opt); //set element attributes before insert
		else beforeElement=opt; 
		
		beforeElement ? obj.insertBefore(elem, beforeElement) : obj.appendChild(elem);
		return _(elem);
	}
};

/*
*Element inner html
*("code")             //set innerHTML
*()                   //get innerHTML
*/
JJ.element.html={
	exec:function(obj, str){
		if(obj.innerHTML==undefined) return obj; //check obj for compatibility
		if(str==undefined) return obj.innerHTML;
		obj.innerHTML=str;
		return obj;
	}
};

/*
*Element remove function
*()                   //remove current element & return parent
*(child_el)           //remove child element & return current element
*/
JJ.element.remove={
	exec:function(obj, child_el){
		if(!obj.removeChild) return obj; //check obj for compatibility
		if(child_el==undefined){
			var par=obj.parentNode;
			par.removeChild(obj);
			return null;
		}
		else{
			var el=_(child_el);
			obj.removeChild(el);
			return obj;
		}
	}
};


/*
*Element activate or activate child (set classname="act")
*()                   //activate current element
*(2)                  //activate specified child element 
*/
JJ.element.act={
	exec:function(obj, num){
		var _this=this;
		if(!obj || !obj.tagName || !obj.parentNode) return false;
		if(obj.attr("noact")!=undefined) return false;
		var par=_(obj, "<");
		if(par.tagName=="LI" || par.tagName=="DT") par=_(par, "<");
		if(num!=undefined){
			par=obj; 
			obj=_(par, 'a:'+num);
		}
		if(!par.deact) par.deact=function(){_this.deact(this)}; //init funtion [set]
		if(par.cur==obj) return false;
		this.act(par, obj);
		obj.event("onact")(); //call [onact] event
		return false;
	},
	
	act:function(par, obj){
		if(!par.cur) par.cur=_(par, "a.act"); // if no [cur] try to find it
		if(par.cur) par.cur.classname("-act");
		obj.classname("+act");
		par.cur=obj;
	},
	deact:function(par){
		if(!par.cur) return false;
		par.cur.classname("-act");
		par.cur=null; 
		return false;
	}
};


JJ.element.offset={
	exec:function(obj){
		var left=0, top=0;
		if(obj.getBoundingClientRect){
			var box=obj.getBoundingClientRect();
			left=box.left+Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
			top=box.top+Math.max(document.documentElement.scrollTop, document.body.scrollTop);
		}
		else{
			
		}
		return {left:left, top:top};
	}
};



JJ.element.display={
	exec:function(obj, b, sender){
		var no_display=(obj.css("display")=="none");
		var no_visibility=(obj.css("visibility")=="hidden");
		if(!obj.display_default) obj.display_default=no_display?"block":obj.css("display");
		var b=(b==undefined?(no_display||no_visibility?1:0):b);
		obj.css({display:b?obj.display_default:"none"});
		return obj;
	}	
};

//element effects--------------------
JJ.element.slide={
	exec:function(obj, b, opt){
		if(!window.EFX) return obj;
		obj.smooth_slide=EFX.slide(obj, b, opt);
		//fade effect for Gesco
		if(obj.smooth_fade || obj.css("visibility")=="hidden"){
			if(!BROWSER.ie && !BROWSER.opera) obj.fade();
			else obj.css({visibility:"visible"});
		}
		return obj;
	}
};
JJ.element.fade={
	exec:function(obj, b, opt){
		if(!window.EFX) return obj;
		obj.smooth_fade=EFX.fade(obj, b, opt || {dyn:30});
		return obj;
	}
};
//---------------------------------------



//DOM extends
if(!String.prototype._extend) JJ.extend(String.prototype, JJ.element);
if(!Array.prototype._extend) JJ.extend(Array.prototype, JJ.element);
document.event=function(ev, func){JJ.element.event.exec(document, ev, func)};





//Externals-----------------------------------------------------------

var BROWSER={
	ie:(document.all && !window.opera)?true:false,
	ie6:navigator.appVersion.indexOf("MSIE 6")!=-1,
	ie7:navigator.appVersion.indexOf("MSIE 7")!=-1,
	chrome:navigator.appVersion.indexOf("Chrome")!=-1,
	safari:navigator.appVersion.indexOf("Safari")!=-1 && navigator.appVersion.indexOf("Chrome")==-1,
	opera:window.opera
};



var Class=function(proto){
	var obj=function(){this.init.apply(this, arguments)};
	obj.prototype=proto;
	obj.prototype.constructor=obj;
	return obj;
};



var Event=function(e){
	e=window.event?window.event:e;
	return {
		key:function(key){
			if(typeof key=="string"){
				var sysKey={ctrl:1, shift:1, alt:1};
				var customKey={enter:13, escape:27, space:32, tab:9, left:37, up:38, right:39, down:40};
				if(key in sysKey) return e[key+"Key"];
				else if(key in customKey) key=customKey[key];
				else key=key.charCodeAt(0);
			}
			var code=window.event?e.keyCode:e.which; 
			return key!=undefined?code==key:code;
		},
		target:function(){
			var target=window.event?e.srcElement:e.target; 
			return target;
		},
		mouse:function(v){ 
			var c={
				x:window.event?e.clientX+document.documentElement.scrollLeft:e.pageX, 
				y:window.event?e.clientY+document.documentElement.scrollTop:e.pageY
			};
			return v!=undefined?c[v]:c;
		},
		prevent:function(){ 
			if(window.event){ e.cancelBubble=true; e.returnValue=false;} 
			else if(e.preventDefault) e.preventDefault();
		},
		stop:function(){ 
			if(window.event){ e.cancelBubble=true; e.returnValue=false;} 
			else if(e.preventDefault) e.stopPropagation();
		}
	}
};




var Forms={}
//Custom select control
//--------------------------------
//> INITIALIZE
//  new Forms.Select(select_obj)

Forms.select=new Class({
	init:function(obj, active_classname){
		var _this=this;
		
		this.obj=_(obj);
		this.active_classname=active_classname || "select_active";
		
		this.root=JJ.create("span").classname("select "+obj.classname());
		this.root.event({
			onclick:function(){ if(!_this.renderComlete) _this.showhide(); _this.input.focus(); }, 
			onmousedown:function(){_this.lockBlur=1}, 
			onmouseup:function(){_this.lockBlur=0}
			});
		this.field=this.root.insert("span").classname("field").event({onclick: function(){if(_this.renderComlete) _this.showhide()}});
			
		//create hidden input element for submit
		this.input=this.field.insert("input", {type:"text"});
		this.input.attr({
			value:obj.value
		});
		this.input.attr({
			update:function(){_this.update()},
			reset:function(){_this.set(_this.input.defaultElement)},
			disable:function(b){_this.disable(b)}
		});
		//external events
		this.input.event({
			onchange:obj.onchange,
			onfocus:obj.onfocus,
			onblur:obj.onblur
		});
		this.input.event({
			onfocus:function(){ _this.active(1); },
			onblur:function(){if(!_this.lockBlur) _this.active(0)},
			onkeydown: function(e){ return _this.onkey(e)}
		});
		//copy all inline external attributes from select to input
		for(var i in obj.attributes){
			var item=obj.attributes[i];
			if(!item || !item.specified || (obj[item.name] && typeof obj[item.name]!="string" && typeof obj[item.name]!="boolean")) continue;
			this.input[item.name]=item.value;
		}
		this.holder=this.field.insert("span").classname("holder").attr({classdef:"holder"}).html("&nbsp;");
		this.arrow=this.field.insert("span").classname("arrow");
		this.dropdown=this.root.insert("span").classname("dropdown");
		
		this.root.input=this.input;
		this.input.root=this.root;
		
		this.input.options=[];
		if(obj.options.length)
			for(var i=0; i<obj.options.length; i++) {
				var el=_(obj.options[i]);
				var a=this.dropdown.insert("a")
					.classname(el.classname())
					.attr({value:el.value, i:i})
					.html(el.html()?el.html():"&nbsp;")
					.event({onclick:function(){return _this.set(this)}})
					;
				this.input.options.push(a);
				if(el.selected || obj.value==a.value) this.input.selected=this.input.defaultElement=a;
				if(el.attr("image")) a.insert("img", a.firstChild).attr({src:el.attr("image")});
			}
		
		//rendering ------------------------------------------------------------------------------
		this.obj.css({display:"none"});
		this.inherit={
			width:this.obj.css("width"),
			margin:this.obj.css(["marginTop", "marginRight", "marginBottom", "marginLeft"], true)
		};
		this.obj.parentNode.replaceChild(this.root, this.obj);
		
		if(!this.constructor.array) this.constructor.array=[];
		this.constructor.array.push(this.root); //add to constructor array (Forms.select.array)
		
		if(this.input.options.length) this.set(this.input.selected?this.input.selected:this.input.options[0]); //set default or act
		
		this.preRender(); //css rendering
		
		if(this.input.disabled) this.disable(1);
		this.isCreated=true;
	},
	
	preRender:function(){
		this.root.inherit={
			line:this.root.css("lineHeight"),
			paddingTB:this.root.css("borderTopWidth")+this.root.css("borderBottomWidth"),
			paddingLR:this.root.css("borderLeftWidth")+this.root.css("borderRightWidth")
		};
		this.root.inherit.height=this.root.inherit.line+this.root.inherit.paddingTB;
		if(this.root.css("position")=="static") this.root.css({position:"relative"});
		if(this.root.css("display")=="inline") this.root.css({display:"inline-block"});
		if(this.inherit.width && !isNaN(this.inherit.width)) this.root.css({width:this.inherit.width}); //set inherit width if exist
		this.root.css(this.inherit.margin); //set inherit not empty margins
		if(BROWSER.ie) [this.root, _(this.root, "<")].css({zIndex:100-this.constructor.array.length}); //fix z-index for IE
		this.input.css({position:"absolute", border:0, padding:0/*});*/, width:1, height:1, opacity:0, marginLeft:-2});/**/
		this.field.css({display:"block", whiteSpace:"nowrap", cursor:"default"});
		this.dropdown.css({position:"relative", visibility:"hidden", overflowX:"hidden", overflowY:"auto", zIndex:2});
		this.input.options.css({display:"block", whiteSpace:"nowrap", textDecoration:"none"});
		this.arrow.css({position:"absolute", display:"block", top:this.field.css("borderTopWidth"), right:this.field.css("borderRightWidth"), cursor:"pointer", height:this.root.inherit.line});
		////fix
		this.dropdown_inherit=this.dropdown.css(["display", "marginLeft", "height"]);
		this.dropdown.css({display:BROWSER.ie?"":"table-row-group",  marginLeft:-this.root.inherit.paddingLR, height:0});
		this.root_inherit=this.root.css(["verticalAlign"]);
		this.root.css({height:this.root.inherit.height, verticalAlign:"middle"});/**/
		
		if(this.root.offsetWidth) this.postRender(); //render if element is visible
	},
	
	postRender:function(){
		////unfix
		this.root.css(this.root_inherit);
		this.root.css({height:"auto"});
		this.dropdown.css(this.dropdown_inherit);/*end*/
		
		this.root.css({width:this.root.offsetWidth-this.root.inherit.paddingLR}); //fix width
		this.field.css({width:this.root.clientWidth-this.field.css("borderLeftWidth")-this.field.css("borderRightWidth")-this.field.css("marginRight")-this.field.css("marginLeft"), overflow:"hidden"});
		this.dropdown.css({position:"absolute"});
		this.dropdown.css({top:this.root.clientHeight, left:-this.root.css("borderLeftWidth"), width:this.root.clientWidth});
		if(BROWSER.ie6 && this.dropdown.currentStyle["max-height"]) this.dropdown.css({height:this.dropdown.currentStyle["max-height"]}); //fix for ie6
		this.renderComlete=true;
	},
	
	showhide:function(d){
		if(this.input.disabled) return false;
		if(d==undefined) d=this.dropdown.css("visibility")!="visible";
		this.dropdown.css({visibility:d?"visible":"hidden"});
		this.isOpen=d;
		return false;
	},
	
	set:function(obj, lock_hide){
		var _this=this;
		this.input.prevValue=this.input.value;
		this.input.value=obj.value;
		this.input.selected=obj;
		
		if(BROWSER.opera) setTimeout(function(){_this.holder.html(obj.html())},0);  //setTimeout for opera inline select
		else _this.holder.html(obj.html());
		this.holder.classname(this.holder.classdef+" "+obj.classname());
		
		if(!lock_hide && this.isCreated) this.showhide(0);
		
		if((this.isCreated && this.input.prevValue!=this.input.value) || (!this.isCreated && this.input.autoload!=undefined)){
			if(this.input.aref) GET(this.input); //call ajax
			if(this.input.onchange) this.input.onchange(); //call onchange event
		}
		
		//act element in dropdown
		if(this.cur) this.cur.classname("-act");
		this.cur=obj;
		this.cur.classname("+act");
		
		return false;
	},
	
	update:function(){
		for(var i=0; i<this.input.options.length; i++) {
			if(this.input.options[i].value==this.input.value){
				this.set(this.input.options[i]);
				break;	
			}				
		}
	},
	
	disable:function(b){
		this.input.disabled=b;
		this.root.css({opacity:b?0.5:1});
	},
	
	active:function(b){
		if(!this.renderComlete) this.postRender();
		this.root.classname((b?"+":"-")+this.active_classname);
		if(!b && this.isOpen) this.showhide(0); //hide dropdown if select blur
	},
	
	onkey:function(e){
		if(Event(e).key("tab") || Event(e).key("ctrl") || Event(e).key("alt") || (Event(e).key()>111 && Event(e).key()<124)) return true;
		if(Event(e).key("up") && this.cur.i) this.set(this.input.options[this.cur.i-1], true);
		if(Event(e).key("down") && this.cur.i<this.input.options.length-1) this.set(this.input.options[this.cur.i+1], true);
		if(Event(e).key("enter") || Event(e).key("space")) this.showhide(this.isOpen?0:1);
		if(Event(e).key("escape") && this.isOpen) this.showhide(0);
		return false;
	}
	
});




<!--//
function enable_menues_for_ie()
{
	//if (document.all&&document.getElementById) {
		
		var allDivs = document.getElementsByTagName( 'div' );

		for ( i = 0; i < allDivs.length; ++i ) {
			if ( allDivs[i].className && allDivs[i].className.indexOf( 'navlink' ) != -1 ) {
				allDivs[i].onmouseover=function()	{
					this.className+=" over";
				}
				allDivs[i].onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}		
			}
		}
	//}
	return;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  f1 = window.open(theURL,winName,features);
  f1.focus();
}

function MM_openSmallWindow(theURL) { //v2.0
  f1 = window.open("http://wellnessfinder.com/"+theURL,"window","scrollbars=Yes,width=650,height=600");
  f1.focus();
}

function MM_openZimmerpreiseWindow(theURL) { //v2.0
  f1 = window.open("http://wellnessfinder.com/"+theURL,"ziprswindow","scrollbars=Yes,width=650,height=350");
  f1.focus();
}

function galeriePopup(anhang) {
	var top = screen.height/2/2;
	var left = screen.width/2/2;
	//var domain = "http://www.wellness-finden.info";
	var domain = "http://www.wellnessfinder.com";

	if (partner=="amica"){
		domain = "http://amica.wellnessfinder.de";
	};
	if (partner=="elle"){
		domain = "http://elle.wellnessfinder.de";
	}
	f1 = window.open(domain+"/fileadmin/tmpl_web_2010/ext_popups/galerie/gal_frame.php?"+anhang,"bigpicture","width=400,height=412,resizable=no,scrollbars=yes,top="+top+",left="+left);
	f1.focus();
}

function MM_openMusicWindow() { //v2.0
  var theURL = 'http://wellnessfinder.com/fileadmin/tmpl_web/ext_popups/music.php';
  fmusic = window.open(theURL,"fmusic","scrollbars=No,left=0,top=0,width=300,height=80");
  fmusic.focus();
}

function showDesc(objektidNo,show) { //v2.0
  objektid = 'description'+objektidNo;
  objektidA = 'aopen'+objektidNo;
  var descrDiv = document.getElementById( objektid );
  var aopenAnchor = document.getElementById( objektidA );
  if (show==1){
        descrDiv.style.display = "";
        aopenAnchor.style.display = "none";
  }else{
        descrDiv.style.display = "none";
        aopenAnchor.style.display = "";
  }
}


//-->
var partner = "wellnessfinder";
function openPic(url,winName,winParams)	{	//
		var theWindow = window.open(url,winName,winParams);
		if (theWindow)	{theWindow.focus();}
	}

