/*PDATA
	compress = yes
PDATA*/

function in_array(mxd, arr, strict)
{
	if( strict )
	{
		for(var i=arr.length-1;i>=0;i--)
			if(arr[i] === mxd)
				return true;
	}
	else
	{
		for(var i=arr.length-1;i>=0;i--)
			if(arr[i] == mxd)
				return true;
	}

	return false;
}

function trim(str)
{
	return str.replace(/^\s+/,'').replace(/\s+$/,'');
}

function array_rtrim(arr)
{
	for(var i=arr.length-1;i>=0;i--)
		if( typeof(arr[i]) == "object" )
			array_rtrim(arr[i]);
		else
			arr[i] = trim(arr[i]);

	return true;	
}

function array_trim(arr)
{
	var res = [];
	for(var i=0;i<arr.length;i++)
		res[i] = trim(arr[i]);

	return res;
}

function array_noempty(arr)
{
	var res = [];
	for(var i=0;i<arr.length;i++)
		if( arr[i] != '' )
			res[i] = arr[i];

	return res;
}

function delFromList(item, list)
{
	var temp = [];
	for(var i=0;i<list.length;i++)
		if( list[i] != item )
			temp.push(list[i]);

	return temp;
}

function object_merge(o1, o2)
{
	for(var i in o2)
		o1[i] = o2[i];

	return true;
}

// Visszadja egy objektum másolatát
function copyOf( obj )
{
	if( obj && typeof(obj) == "object" )
	{
		var copy = new obj.constructor();
		for(var i in obj)
			copy[i] = copyOf(obj[i]);
		return copy;
	}
	
	return obj;
}

function getLeft(node)
{
	if( node.offsetParent )
		return getLeft(node.offsetParent) + node.offsetLeft;

	return node.offsetLeft;
}

function getTop(node, limit)
{
	if( node.offsetParent )
		return getTop(node.offsetParent) + node.offsetTop;

	return node.offsetTop;
}

function getRelLeft(node, rel)
{
	return (getLeft(node) - getLeft(rel.offsetParent));
}

function getRelTop(node, rel)
{
	return (getTop(node) - getTop(rel.offsetParent));
}

// Eseménykezelő létrehozása
// n : célobjektum
// e : esemény neve 'on' nélkül
// o : az eseménykezelő függvény vagy objektum (ha f adott)
// f : ha adott akkor o[f] lesz az esemény kezelője
function addEventHandler(n,e,o,f)
{
	if( o && f )
	{
		if( n.attachEvent )
			n.attachEvent("on"+e, function(e){return o[f](e)} );
		else
			n.addEventListener(e, function(e){return o[f](e)} ,false);
	}
	else
	{
		if( n.attachEvent )
			n.attachEvent("on"+e,o);
		else
			n.addEventListener(e,o,false)
	}
}

// Eseménykezelő megszüntetése
function delEventHandler(n,e,o,f)
{
	if( o && f )
	{
		if( n.detachEvent )
			n.detachEvent("on"+e, function(e){return o[f](e)} );
		else
			n.removeEventListener(e, function(e){return o[f](e)} ,false);
	}
	else
	{
		if( n.detachEvent )
			n.detachEvent("on"+e,o);
		else
			n.removeEventListener(e,o,false)
	}
}

function gId(id)
{
	return document.getElementById(id);
}

function gTags(id)
{
	return document.getElementsByTagName(id);
}

function cElement(name)
{
	return document.createElement(name);
}

function getTime()
{
	return new Date().getTime();
}

function pad_left(str, pad, n)
{
	var i=0;
	var res = str.toString();

	while(res.length < n )
	{
		res = pad.charAt(i%pad.length) + res;
		i++;
	}

	return res;
}

function parseDate(str)		// csak "Y-m-d H:i:s" formátumot fogad el!
{
	var temp	= str.split(" ");
	var ymd		= temp[0].split("-");
	var his		= temp[1].split(":");

	var date = new Date();
	date.setFullYear(ymd[0]);
	date.setMonth(parseFloat(ymd[1])-1);
	date.setDate(parseFloat(ymd[2]));
	date.setHours(parseFloat(his[0]));
	date.setMinutes(parseFloat(his[1]));
	date.setSeconds(parseFloat(his[2]));

	return date.getTime();
//	return Date.parse(months[parseFloat(ymd[1])-1]+" "+ymd[2]+", "+ymd[0]+" "+temp[1]);
}

function getDayOfWeek(time)  // time lehet timestamp és "Y-m-d H:i:s" formátumú string is!
{
	var date = new Date();

	if( time )
	{
		if( (typeof(time) == "string") && isNaN(time) )
			var time = parseDate(time);

		date.setTime(time);
	}

	return date.getDay();	// 0 - vasárnap, 1 - hétfő, ...
}

function getDate(format, time)	// time lehet timestamp és "Y-m-d H:i:s" formátumú string is!
{
	var date = new Date();

	if( time && (time != "undefined") )
	{
		if( (typeof(time) == "string") && isNaN(time) )
			var time = parseDate(time);

		date.setTime(time);
	}

	var res = format;

	res = res.replace(/Y/g, date.getFullYear());
	res = res.replace(/m/g, pad_left(date.getMonth()+1,"0",2));
	res = res.replace(/d/g, pad_left(date.getDate(),"0",2));
	res = res.replace(/H/g, pad_left(date.getHours(),"0",2));
	res = res.replace(/i/g, pad_left(date.getMinutes(),"0",2));
	res = res.replace(/s/g, pad_left(date.getSeconds(),"0",2));

	return res;
}

function isOpera()
{
	return (navigator.userAgent.toUpperCase().indexOf("OPERA")!=-1);
}

function isMSIE(ver)
{
	if( ver )
		return ((navigator.userAgent.indexOf("MSIE "+ver)!=-1) && !isOpera());

	return ((navigator.userAgent.indexOf("MSIE")!=-1) && !isOpera());
}

function getMouse()
{
	return {x:getMouse.prototype.x,y:getMouse.prototype.y};
}

getMouse.prototype =
{
	instance : null,
	x : 0, 
	y : 0,
	
	onMove : function(e)
	{
		this.x = e.clientX;
		this.y = e.clientY;
	}
}

addEventHandler(document, "mousemove", function(e){getMouse.prototype.onMove(e||event)});

function execJS(id)
{
	var code = gId(id);
	if( code )
	{
		eval(code.innerHTML);
		removeNode(id);	
	}
}

// Eltávolítja a megadott node-t a hierarchiából
function removeNode( node )
{
	if( typeof(node) == "string" )
		var node = gId(node);

	try{node.parentNode.removeChild(node);}catch(e){};
}

// A megadott html forrást hozzáadja a megadott node tartalmához.
function addHTML( node, html )
{
	if( typeof(node) == "string" )
		var node = gId(node);

	var tempNode = document.createElement('div');
	tempNode.innerHTML = html;
	for(var n=tempNode.firstChild;n;n=n.nextSibling)
		node.appendChild(n.cloneNode(true));
}

// A megadott html forrásra cseréli a node tartalmát
function replaceHTML( node, html )
{
	if( typeof(node) == "string" )
		var node = gId(node);

	while(node.firstChild)
		node.removeChild(node.firstChild);

	var tempNode = document.createElement('div');
	tempNode.innerHTML = html;
	for(var n=tempNode.firstChild;n;n=n.nextSibling)
		node.appendChild(n.cloneNode(true));
}

// A source node tartalmát a target node tartalmához mozgatja
function moveContent( source, target )
{
	if( typeof(source) == "string" )
		var source = gId(source);

	if( typeof(target) == "string" )
		var target = gId(target);

	while(source.firstChild)
	{
		target.appendChild(source.firstChild.cloneNode(true));
		source.removeChild(source.firstChild);
	}
}

// A source node tartalmát a target node tartalmához adja
function copyContent( source, target )
{
	if( typeof(source) == "string" )
		var source = gId(source);

	if( typeof(target) == "string" )
		var target = gId(target);

	for(var n=source.firstChild;n;n=n.nextSibling)
		target.appendChild(n.cloneNode(true));
}

// Törli a node tartalmát
function clearNode( node )
{
	if( typeof(node) == "string" )
		var node = gId(node);

	while(node.firstChild)
		node.removeChild(node.firstChild);
}

// JS unserialize 
function jsu( sv )
{
  try
	{eval("var d=decodeURIComponent;var o=(" + sv + ");");return o;}
  catch (e)
	{return null}
}

function jss( v )
{
	var res = null;

	if( v == null )
		return 'null';

	if( v === false )
		return 'false';

	if( v === true )
		return 'true';

	switch( typeof(v) )
	{
		case 'string'	:	return 'd("'+encodeURIComponent(v)+'")';
		case 'object'	:	if( v.constructor == Array )
							{
								var sub = [];
								for(var i=0;i<v.length;i++)
									sub.push(jss(v[i]));
								return '['+sub.join(',')+']';
							}

							var sub = [];
							for(var i in v)
								sub.push('d("'+encodeURIComponent(i)+'"):'+jss(v[i]));
							return '{'+sub.join(',')+'}';

		default			:	return v;
	}
}

function canvasWidth()
{
	return (document.width) ? document.width : document.body.offsetWidth;
}

function canvasHeight()
{
	if( gId('canvas_bottom') )
		return gId('canvas_bottom').offsetTop+gId('canvas_bottom').offsetHeight;

	return (document.height) ? document.height : document.body.offsetHeight;
}

function hideNode( node )
{
	if( typeof(node) == "string" )
		var node = gId(node);

	node.style.visibility = 'hidden';
}

function showNode(node)
{
	if( typeof(node) == "string" )
		var node = gId(node);

	node.style.visibility = 'visible';
}

function setHTML(node, html)
{
	if( typeof(node) == "string" )
		var node = gId(node);

	node.innerHTML = html;
}

function setStyle(node, style)
{
	if( typeof(node) == "string" )
		var node = gId(node);

	for(var i in style)
		node.style[i] = style[i];
}

function alphaFixIE( css ) {
	var s, i, j;

	if( !isMSIE() )
		return true;

	// IMG
	var els = document.getElementsByTagName("IMG");
	for (i=0; i<els.length; i++) {
		s = els[i].src;
		if (s.toLowerCase().indexOf(".png") != -1) {
			els[i].src = "images/blank.gif";
			els[i].style.filter += "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + s + "', sizingMethod=image);";
		}
	}

	if( css )
	{
		// CSS: background
		for (i=0; i<document.styleSheets.length; i++) {
			var pos = document.styleSheets[i].href.lastIndexOf("/");
			var cssDir = (pos != -1) ? document.styleSheets[i].href.substring(0, pos + 1) : "";
			for (j=0; j<document.styleSheets[i].rules.length; j++) {
				var style = document.styleSheets[i].rules[j].style;
				if (style.backgroundImage.toLowerCase().indexOf(".png") != -1) {
					var filename = style.backgroundImage.substring(4, style.backgroundImage.length - 1);
					if (filename.indexOf("http://") != 0 && filename.indexOf("/") != 0)
						filename = cssDir + filename;
					style.backgroundImage = "none";
					style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + filename + "', sizingMethod='crop');";
				}
			}
		}
	}
}

function encodeUTF8(str) {  // encode multi-byte string into utf-8 multiple single-byte characters 
  str = str.replace(
      /[\u0080-\u07ff]/g,  // U+0080 - U+07FF = 2-byte chars
      function(c) { 
        var cc = c.charCodeAt(0);
        return String.fromCharCode(0xc0 | cc>>6, 0x80 | cc&0x3f); }
    );
  str = str.replace(
      /[\u0800-\uffff]/g,  // U+0800 - U+FFFF = 3-byte chars
      function(c) { 
        var cc = c.charCodeAt(0); 
        return String.fromCharCode(0xe0 | cc>>12, 0x80 | cc>>6&0x3F, 0x80 | cc&0x3f); }
    );
  return str;
}

function decodeUTF8(str) {  // decode utf-8 encoded string back into multi-byte characters
  str = str.replace(
      /[\u00c0-\u00df][\u0080-\u00bf]/g,                 // 2-byte chars
      function(c) { 
        var cc = (c.charCodeAt(0)&0x1f)<<6 | c.charCodeAt(1)&0x3f;
        return String.fromCharCode(cc); }
    );
  str = str.replace(
      /[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,  // 3-byte chars
      function(c) { 
        var cc = (c.charCodeAt(0)&0x0f)<<12 | (c.charCodeAt(1)&0x3f<<6) | c.charCodeAt(2)&0x3f; 
        return String.fromCharCode(cc); }
    );
  return str;
}

function formatPrice(input)
{
	try{
		var value = input.value.replace(/[^0-9]/g,'');

		var l = value.length;
		var res = [];
		for(var i=1;i<=l;i++)
			if( (i>1) && (i%3 == 1) )
				res.unshift(value.charAt(l-i)+" ");
			else
				res.unshift(value.charAt(l-i));

		input.value = res.join("");
	}
	catch(e){}
}

try {
	document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}


function fetch(str, _tpl_vars)
{
	var res = str.replace(/\{\$[a-zA-Z0-9\_\.]+\}/g, function(token,pos,str) {
		var token = token.substring(2,token.length-1).replace(/[\.]/g,"']['");
		try	{eval("var res = _tpl_vars['"+token+"'];");} catch(e) {var res = ""};
		return res;
	});

	var res = res.replace(/\{if ([^\}]+)\}(.*)\{\/if\}/g, function(token,eq,content,pos,str) {

		eq = eq.replace(/\$[a-zA-Z0-9\_\.]+/g, function(token,pos,str) {
			var token = token.substring(1).replace(/[\.]/g,"']['");
			try	{eval("var res = _tpl_vars['"+token+"'];");} catch(e) {var res = null};
			if( typeof(res) == "string" )
				return '"'+res.replace(/([\"\\])/g,'\$1')+'"';

			return res;
		});

		var res = "";
		try{eval("if ("+eq+") var res = content;")} catch(e){};

		return res;
	});

	return res;
}

function watchEnter(node, e, fn)
{
	if( e.keyCode == 13 )
	{
		eval(fn);
		return false;
	}
}


function setSelectValue(node, value)
{
	if( typeof(node) == "string" )
		var node = gId(node);

	for(var i=0;i<node.options.length;i++)
		node.options[i].selected = ( node.options[i].value == value );

	return true;
}

function initClassInstance(proto, obj, list)
{
	var list = list.split(",");
	for(var i=list.length-1;i>=0;i--)
		obj[list[i]] = copyOf(proto[list[i]]);
}

function setSafeFocus(id)
{
	try{
		var id = id.split("::");
		if( id.length > 1 )
			document.forms[id[0]][id[1]].focus();
		else
			gId(id[0]).focus();
	}catch(e){};
}
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
function initPage(area, host, loaded)
{
	try {document.execCommand("BackgroundImageCache", false, true);} catch(err) {}

	if( area == 'fooldal' )
		areaProc();

	if( area == 'init' )
	{
		gId('preload').style.display = 'block';

		var so = new SWFObject("preload.swf", "preload", "530", "300", "8", "#ffffff");
		so.addVariable("href", host+"fooldal/");
		so.addVariable("list","images/fooldal.bg.jpg");
		so.addVariable("wait","yes");
		so.write("preload");
		delete so;
	}
}

function fieldFocus(node)
{
	if( node && node.style )
		node.className = node.className.replace(" focused","") + " focused";
}

function fieldBlur(node)
{
	if( node && node.style )
		node.className = node.className.replace(" focused","");
}

function openPopupPage(url,wndName,width,height,paramStr, returnWithInstane)
{
	var res 	= [];
	var left	= 10;
	var top		= 10;
	var sb		= false;
	var mb		= false;
	var op = (navigator.userAgent.search("Opera")!=-1);
	var ms = (navigator.userAgent.search("MSIE")!=-1) && (!op);

	var	param = paramStr.split(";");
	for(var i in param)
	{
		var nam = param[i].split(":")[0].toLowerCase();
		var val = param[i].split(":")[1];

		switch( nam )
		{
			case "fullscreen" 	: res.push("fullscreen="+val);	break;
			case "location" 	: res.push("location="+val);	break;
			case "menubar" 		: res.push("menubar="+val);
								  mb=(val == 'yes');			break;
			case "resizable" 	: res.push("resizable="+val);	break;
			case "scrollbars" 	: res.push("scrollbars="+val);
								  sb=(val == 'yes');			break;
			case "status" 		: res.push("status="+val);		break;
			case "titlebar" 	: res.push("titlebar="+val);	break;
			case "toolbar" 		: res.push("toolbar="+val);		break;
			case "left"			: left	= val; break;
			case "top"			: top 	= val; break;
			case "center"		: if( val == 'yes' )
								  {
								  	left= Math.round((screen.width - width)/2);
									top	= Math.round((screen.height - height)/2);
								  }
								  break;
		}
	}

	if( ms )
	{
		width	+= (sb) ? 13 : -4;
		height	+= (sb) ? 0 : -4;
		if( mb ) height -= 20;
	}

	res.push("width="+width);
	res.push("height="+height);
	res.push("left="+left);
	res.push("top="+top);

	var win = window.open(url, wndName, res.join(","));
	win.focus();

	if( returnWithInstane )
		return win;
}

function zoomImage(img, host)
{
	openPopupPage(host+"zoom.php?img="+img, "zoomed", 980, 735, "center:yes");
}

var area_index = 0;
var area_alpha = [0,0,0,0,0,0,0,0];

function areaMove(e)
{
	var obj = e.originalTarget ? e.originalTarget : e.srcElement;
	area_index = (obj && obj.id && (obj.id.substring(0,3) == 'ao_')) ? obj.id.substring(4,5) : 0;
}

function areaProc()
{
	try{
		for(var i=1;i<=7;i++)
		{
			var item = gId('ao_m'+i+'_item');
			if( item )
			{
				var o = area_alpha[i] + ((area_index == i) ? +10 : -10);
							
				if( o<0 )	o = 0;
				if( o>100 ) o = 100;

				area_alpha[i] = o;

				var o = 40+60*(1-Math.pow(1-o/100,1.2));

				try{item.style.opacity=o/100;}catch(e){};
				try{item.style.MozOpacity=o/100;}catch(e){};
				try{if(isMSIE())item.style.filter="alpha(opacity="+o+")";}catch(e){};
			}
		}

		setTimeout('areaProc()', 33);
	}
	catch(e){};
}

addEventHandler(document, 'mousemove', function(e){areaMove(e||event)});
