/* Simple AJAX Code-Kit (SACK) v1.6.1 */
/* ©2005 Gregory Wild-Smith */
/* www.twilightuniverse.com */
/* Software licenced under a modified X11 licence, see documentation or authors website for more details */
function sack(file) { this.xmlhttp = null; this.resetData = function() { this.method = "POST"; this.queryStringSeparator = "?"; this.argumentSeparator = "&"; this.URLString = ""; this.encodeURIString = true; this.execute = false; this.element = null; this.elementObj = null; this.requestFile = file; this.vars = new Object(); this.responseStatus = new Array(2);}; this.resetFunctions = function() { this.onLoading = function() { }; this.onLoaded = function() { }; this.onInteractive = function() { }; this.onCompletion = function() { }; this.onError = function() { }; this.onFail = function() { };}; this.reset = function() { this.resetFunctions(); this.resetData();}; this.createAJAX = function() { try { this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");} catch (e1) { try { this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");} catch (e2) { this.xmlhttp = null;}
}
if (! this.xmlhttp) { if (typeof XMLHttpRequest != "undefined") { this.xmlhttp = new XMLHttpRequest();} else { this.failed = true;}
}
}; this.setVar = function(name, value){ this.vars[name] = Array(value, false);}; this.encVar = function(name, value, returnvars) { if (true == returnvars) { return Array(encodeURIComponent(name), encodeURIComponent(value));} else { this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);}
}
this.processURLString = function(string, encode) { encoded = encodeURIComponent(this.argumentSeparator); regexp = new RegExp(this.argumentSeparator + "|" + encoded); varArray = string.split(regexp); for (i = 0; i < varArray.length; i++){ urlVars = varArray[i].split("="); if (true == encode){ this.encVar(urlVars[0], urlVars[1]);} else { this.setVar(urlVars[0], urlVars[1]);}
}
}
this.createURLString = function(urlstring) { if (this.encodeURIString && this.URLString.length) { this.processURLString(this.URLString, true);}
if (urlstring) { if (this.URLString.length) { this.URLString += this.argumentSeparator + urlstring;} else { this.URLString = urlstring;}
}
this.setVar("rndval", new Date().getTime()); urlstringtemp = new Array(); for (key in this.vars) { if (false == this.vars[key][1] && true == this.encodeURIString) { encoded = this.encVar(key, this.vars[key][0], true); delete this.vars[key]; this.vars[encoded[0]] = Array(encoded[1], true); key = encoded[0];}
urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];}
if (urlstring){ this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);} else { this.URLString += urlstringtemp.join(this.argumentSeparator);}
}
this.runResponse = function() { eval(this.response);}
this.runAJAX = function(urlstring) { if (this.failed) { this.onFail();} else { this.createURLString(urlstring); if (this.element) { this.elementObj = document.getElementById(this.element);}
if (this.xmlhttp) { var self = this; if (this.method == "GET") { totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString; this.xmlhttp.open(this.method, totalurlstring, true);} else { this.xmlhttp.open(this.method, this.requestFile, true); try { this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
} catch (e) { }
}
this.xmlhttp.onreadystatechange = function() { switch (self.xmlhttp.readyState) { case 1:
self.onLoading(); break; case 2:
self.onLoaded(); break; case 3:
self.onInteractive(); break; case 4:
self.response = self.xmlhttp.responseText; self.responseXML = self.xmlhttp.responseXML; self.responseStatus[0] = self.xmlhttp.status; self.responseStatus[1] = self.xmlhttp.statusText; if (self.execute) { self.runResponse();}
if (self.elementObj) { elemNodeName = self.elementObj.nodeName; elemNodeName.toLowerCase(); if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea") { self.elementObj.value = self.response;} else { self.elementObj.innerHTML = self.response;}
}
if (self.responseStatus[0] == "200") { self.onCompletion();} else { self.onError();}
self.URLString = ""; break;}
}; this.xmlhttp.send(this.URLString);}
}
}; this.reset(); this.createAJAX();}


/* UNIPortal mainscript - iCom Ltd. */

//dispTag=1:show,=0:hide, null:toggle
function xSH(ID,dispTag)
{var spI=document.getElementById(ID);
 if(spI)
  {if (!dispTag){var dispTag="none";if(spI.style.display=="none")dispTag="block";}
   spI.style.display=dispTag;
  }
}
//marquee
var marqContainer=new Array();marqScroller=new Array();
function ConstructMarquee(obj,nest)
{nest_orig=nest; nest=(!nest) ? '':'document.'+nest+'.';
this.el=document.getElementById(obj);
this.css=document.getElementById(obj).style;
this.scrollHeight=this.el.offsetHeight;
this.clipHeight=this.el.offsetHeight;
this.down=MoveAreaDown;
this.timer=null;this.initialised=null;
this.p_clipHeight;
if (nest_orig){this.p_clipHeight=marqContainer[nest_orig].clipHeight;}
this.MoveArea=MoveArea; this.x; this.y;
this.obj = obj + "Object";
eval(this.obj + "=this");
return this;
}
function MoveArea(x,y){this.x=x;this.y=y; this.css.left=this.x; this.css.top=this.y + 'px';}
function MoveAreaDown(move){if(this.y>-this.scrollHeight){this.MoveArea(0,this.y-move);}else{this.MoveArea(0,this.p_clipHeight);}}
function MoveAreaDown(move)
{clearTimeout(this.timer);if(this.y>-this.scrollHeight){this.MoveArea(0,this.y-move);this.timer=setTimeout(this.obj+".down("+move+")",this.speed);}else{this.MoveArea(0,this.p_clipHeight);this.timer=setTimeout(this.obj+".down("+move+")",this.speed);}}
function startScroll(xcontainer,xcontent,step)
{if(!marqScroller[xcontainer]){InitialiseScrollableArea(xcontainer,xcontent);}
 if(marqScroller[xcontainer].initialised){marqScroller[xcontainer].down(step);}
}
function stopScroll(xcontainer){if(marqScroller[xcontainer].timer)clearTimeout(marqScroller[xcontainer].timer);} 
function InitialiseScrollableArea(xcontainer,xcontent)
{el=document.getElementById(xcontainer);
if (el!=null)
{marqContainer[xcontainer]=new ConstructMarquee(xcontainer);
marqContainer[xcontainer].css.visibility='visible';
marqScroller[xcontainer]=new ConstructMarquee(xcontent,xcontainer);
marqScroller[xcontainer].MoveArea(0,0);
marqScroller[xcontainer].speed=15;
marqScroller[xcontainer].timer=null; 
marqScroller[xcontainer].initialised=true; 
}
}

// AJAX
function GetXmlHttpObject() {var xmlHttp=null; try{xmlHttp=new XMLHttpRequest();} catch (e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");} catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
if(xmlHttp==null)alert ("Your browser does not support AJAX!"); return xmlHttp;}
function showMSGBox(id,msg,className)
{var XEL=document.getElementById(id);XEL.innerHTML="<div align=\"right\"><a href=\"javascript:closeMSGBox('"+id+"')\"><b><font size='1'>X</font></b></a>&nbsp;</div>"+msg;
XEL.style.display="block";   // xELM.style.top="90px";// xELM.style.bottom="90px";xELM.style.left="90px";xELM.style.right="90px"; //xELM.style.width="90%";xELM.style.height="600px";xELM.style.margin="auto";
if (className)XEL.className=className;
}
function closeMSGBox(id){document.getElementById(id).style.display ="none";}

function ajaxHELP(pgurl,dispPanel)
{if (jumppoint.length>0){pgurl+="#"+jumppoint;}
  window.open(pgurl,"","width=500,height=300,right=10,resizable=1,fullscreen=0,scrollbars=1,address=0");
}

function CHANGEr(inS,oldv,newv)
{var pz0=0; var newvl=newv.length; var outS="";
 var pz1=inS.indexOf(oldv,pz0);
 while(pz1>-1)
  {if(inS.substring(pz1,pz1+newvl)!=newv){inS=inS.substring(0,pz1)+newv+inS.substring(pz1+1,inS.length); pz0=pz1+newvl;}
	else{pz0=pz1+newvl;}
    pz1=inS.indexOf(oldv,pz0);
  }
return inS;
}


function _newSearch(hftxt,loc1,tDomain)
{if(!tDomain){tDomain="";}var strg="a";if (loc1!=null){strg=getSelectedValue(loc1);};document.location=tDomain+"/ewPortal3.icom"+_jsessionid+"?ewassoc0=99&ewtarget0=0"+strg+"&shopid=ecolonia&language_code=hu&hftxt="+hftxt;}
function goGALL(gid){document.location="/ewPortal3.icom"+_jsessionid+"?gid0="+gid+"&ewassoc0=86&ewtarget0=0h4&shopid=ecolonia&language_code=hu";}
function addGALLITEM(gid){document.location="/ewPortal3.icom"+_jsessionid+"?gid0="+gid+"&ewassoc0=86&ewtarget0=0h5&shopid=ecolonia&language_code=hu";}
function modGALLITEM(id){document.location="/ewPortal3.icom"+_jsessionid+"?id0="+id+"&ewassoc0=86&ewtarget0=0h7&shopid=ecolonia&language_code=hu";}
function delGALLITEM(id){document.location="/ewPortal3.icom"+_jsessionid+"?ewassoc0=86&ewtarget0=0h5&shopid=ecolonia&language_code=hu";}
function startFPW(uname,uemail){document.location="/ewPortal3.icom"+_jsessionid+"?ewassoc0=89&ewtarget0=0c&shopid=ecolonia&language_code=hu&uname="+escape(uname)+"&uemail="+escape(uemail);}
function showReviews(nid)
{var tmpx=""+document.location;if (tmpx.indexOf("ewtarget83=")>-1){tmpx=removePAR(tmpx,"ewtarget83=");}
 var JPP=""; var pt=tmpx.indexOf("#");if (pt>0){JPP=tmpx.substring(pt,tmpx.length);tmpx=tmpx.substring(0,pt);}else{JPP="#rev01";}
document.location.replace(tmpx+"&ewtarget83=83d&aid="+nid+JPP);
}

function sendLICIT(NID,boxID)
{var newLV=eval("document.dm01.licit"+NID+".value");
var rloc=""+document.location;rloc=removePAR(rloc,"ewtarget"+boxID+"=");
if (rloc.indexOf("language_code=")<0){rloc="/ewPortal3.icom"+_jsessionid+"?ewcateg0=1&language_code=hu&shopid=ecolonia";}
rloc+="&licitid"+boxID+"="+NID+"&ewtarget"+boxID+"="+boxID+"f&licit"+boxID+"="+newLV;
document.location.replace(rloc);
}

function changeLanguageTo(langcode)
{var tmpx=""+document.location;
if (tmpx.indexOf("language_code=")>-1){tmpx=removePAR(tmpx,"language_code=");document.location=tmpx+"&language_code="+langcode;}
else{document.location="/ewPortal3.icom"+_jsessionid+"?ewcateg0=1&language_code="+langcode+"&shopid=ecolonia";}
}

function ltrim(xval){var il=xval.length;if (il>0){var cc=0;while((cc<il)&&(xval.charAt(cc)==" ")){cc++;}if (cc>0){xval=xval.substring(cc,xval.length);}}return xval;}
function rtrim(xval){var il=xval.length;if (il>0){il--;var cc=il;while((cc>-1)&&(xval.charAt(cc)==" ")){cc--;}if (cc>-1){xval=xval.substring(0,cc+1);}else{xval="";}}return xval;}
function trim(xval){return ltrim(rtrim(xval));}
function isEmpty(xval,minlen){if (minlen==null){minlen=1;} var result=false;xval=trim(xval);if (xval.length<minlen){result=true;}return result;}

var lastCateg="";
var c_column=-1;
var lastMainCateg="";
var cycleN=0;

function setCheckBox(xobj,xval){if (xval=="1"){xobj.checked=true;}}
function getSelectedValue(xobj){var spz=xobj.selectedIndex;if (spz<0){return "";}return xobj.options[spz].value;}
function setSelectByValue(xObj,selValue){var maxI=xObj.length;var ii=0;while(ii<maxI){var xtemp=xObj.options[ii].value;if (xtemp==selValue) {xObj.selectedIndex=ii; ii=maxI;}ii++;}}
function setSelectByText(xObj,selText){var maxI=xObj.length;var ii=0;while(ii<maxI){ var xtemp=xObj.options[ii].text;if (xtemp==selText) {xObj.selectedIndex=ii; ii=maxI;}ii++;}}
function writeIfNotEmpty(par1,par2){if (par1.length>0){document.write(par2);}}
function writeIfEnabled(enabled,xtext1,xtext2){if (enabled.length>0) {document.write(xtext1);}else {document.write(xtext2);}}

function isImageExists5(imgCode,alt,align,vspace,hspace,imgPreURL,imgLEAD,styl)
{if (styl==null){styl="";}if (imgLEAD.length>2){document.write("<img src='"+imgPreURL+imgLEAD+"' ALT='"+alt+"' border=0 hspace="+hspace+" vspace="+vspace+" align="+align+" "+styl+"/>");}
  else{if (imgCode.length>2){document.write("<img src='"+imgPreURL+imgCode+"' ALT='"+alt+"' border=0 hspace="+hspace+" vspace="+vspace+" align="+align+" "+styl+"/>");}
      }
}
function ow(trgs,ww,hh){window.open(trgs,"","width="+ww+",height="+hh+",resizable=1,fullscreen=0,scrollbars=1,address=1");}

function isDownload2(dlFile,xID,xSHOPID,xlangcode){if(dlFile.length>2){var outs="";outs="<a href='/ew_catdownload.icom?id="+xID+"&shopid="+xSHOPID+"&playtype=m' target='_blank'><b><font size=1 color=red>MEGTEKINTÉS</font></b></a> &nbsp;&nbsp;";outs+="<a href='/ew_catdownload.icom?id="+xID+"&shopid="+xSHOPID+"&playtype=d'><b><font size=1 color=red>LETÖLTÉS</font></b></a>";document.write(outs);}}
function cutDecoder(instr){var pz=instr.indexOf(":");if (pz>-1){instr=instr.substring(pz+1,instr.length);}return instr;}


var pcds_0="mindenki",pcds_1="regisztrált felhasználók",pcds_2="hitelesített felhasználók";
function writeProtect(cpc,lcode){return eval("pcds_"+cpc);}
function selectorMOD2(boxid,jtxindex,formobjname,shopid,shoptitle,id,id2,authtitle,price,amount,vat,lang,i_me,current_amount,xdiscrule,userdisc)
{var udisc=parseFloat(userdisc);if (isNaN(udisc)){udisc=0;}
var dscappl=0;
var tp=xdiscrule.indexOf(":"); 
if(tp>-1){dscappl=xdiscrule;}else if(udisc>0){dscappl=udisc;}
authtitle=eval(formobjname+".creator"+boxid+jtxindex+".value");if (authtitle.length>1){authtitle+=" ";}
authtitle+=eval(formobjname+".title"+boxid+jtxindex+".value");shoptitle+=eval(formobjname+".shoptitle.value");addc3a(shopid,shoptitle,id,id2,authtitle,price,amount,vat,dscappl,lang,i_me,current_amount,shopid+"_cart");
reFRESH2();
}

function getPrice(xpriceS,xvatS,xcurr,xdiscrule,userdiscount)
{var outSTR="";var xprice=parseFloat(xpriceS);if (isNaN(xprice)){xprice=0;}
if(!userdiscount){userdiscount="0";}
var udisc=parseFloat(userdiscount);if (isNaN(udisc)){udisc=0;}
var xvat=parseFloat(xvatS);if (isNaN(xvat)){xvat=0;}if (xvat==0){xvat=20;}
var dscappl=0;
var tp=xdiscrule.indexOf(";1:");
if(tp>-1)
{var tp2=xdiscrule.indexOf(";",tp+2);if(tp2<0){tp2=xdiscrule.length;}
dscappl=parseFloat(xdiscrule.substring(tp+3,tp2));if (isNaN(dscappl)){dscappl=0;}
}
else if(udisc>0){dscappl=udisc;}
var xbrutprice=xprice+Math.round(xprice*xvat/100);
var aprice="";  var bprice="";
if(dscappl>0){aprice="<b>&nbsp;&nbsp; "+Math.round(xbrutprice-(xbrutprice*dscappl/100))+"</b>";bprice="<strike>"+xbrutprice+"</strike>";}
else{bprice="<b>"+xbrutprice+"</b>";}
outSTR="<b>ÁR:</b> "+bprice+" "+aprice+" <b>"+xcurr+"</b>";
if (dscappl>0){outSTR+="<font color=red><b> !</b></font>";}
return outSTR;}

function getDISC(disc,xme)
{var outs="";cdisc+="; ";var pp1=disc.indexOf(";");
if(pp1<-1){return disc;}
while (pp1>-1){var tmp1=disc.substring(0,pp1);disc=disc.substring(pp1+1,disc.length);var pp2=tmp1.indexOf(":");
if (pp2>-1){var cce=tmp1.substring(0,pp2);tmp1=tmp1.substring(pp2+1,tmp1.length);var ncce=parseFloat(cce);outs+=ncce+" "+xme+"-tól -"+tmp1+" &nbsp;&nbsp; ";}
pp1=disc.indexOf(";");}return outs;}

function getDISC2(disc,xme)
{var outs="";var pp1=disc.indexOf(";");var lDISC=0;var preAM=0;var nxme=parseFloat(xme);
if(pp1<0){return disc;}
while (pp1>-1){var tmp1=disc.substring(0,pp1);disc=disc.substring(pp1+1,disc.length);var pp2=tmp1.indexOf(":");
if (pp2>-1){var cAM=parseFloat(tmp1.substring(0,pp2));tmp1=tmp1.substring(pp2+1,tmp1.length);
var ncAM=parseFloat(cAM);if(ncAM<=nxme){if(preAM<ncAM){lDISC=parseFloat(tmp1);preAM=ncAM;}}}
pp1=disc.indexOf(";");}return lDISC;}

function dummy1(){return false;}
function _startSearch(ftxt,xtarget,BGIMG,lngC,ord1)
{var xObj=document.dm01;var xsql="select A.*,B.hiercode,B.title as btitle from vtext A,vcateg B where (A.shopid='ecolonia')and(A.language_code='"+lngC+"')and(A.main_categ=B.categcode)and(B.language_code='"+lngC+"')and(B.shopid='ecolonia')";
if (ftxt.length>0){xsql+="and((A.title like'%"+ftxt+"%')or(A.vtext like'%"+ftxt+"%')or(A.summary like'%"+ftxt+"%')or(A.subject like'%"+ftxt+"%'))";}
xObj.updsql0.value=xsql;xObj.firstkey0.value=0;xObj.ewcateg0.value="";xObj.ewassoc0.value="99";xObj.ewtarget0.value="0a";xObj.ewitem0.value="";xObj.submit();}

function _viewCart(xObj){document.location="/ewPortal3.icom"+_jsessionid+"?shopid=ecolonia&language_code=hu&ewassoc0=77";}
function convNum(xnum,decplace){var kit=Math.pow(10,decplace);xnum=Math.round(xnum*kit);xnum=xnum/kit;var res=""+xnum;
var inn=res.indexOf(".");if (inn<0){ inn=res.length; res+=".0000000000";} else {res+="0000000000";}
res=res.substring(0,inn+decplace+1);return res;}
function getCookie2(name){var prefix = name + "="; var cSI = document.cookie.indexOf(prefix);if (cSI==-1) return null;
var cEI= document.cookie.indexOf(";", cSI + prefix.length); if (cEI==-1) cEI=document.cookie.length;
return unescape(document.cookie.substring(cSI+prefix.length,cEI));}

function writeSmallCart(tmpcookieName,_fullList,xClass,xEST)
{xMoney="HUF";xME="pcs";var scart=getCookie2(tmpcookieName);if(!scart){return;}
if (scart.length<5){return;}var x0=0;var x1=0;var fno=9-1;var cno=0;var lofs=scart.length;var subTotal=0;var fullTotal=0;var tmpVals=new Array();var tmpPrice=0,tmpAmount=0,tmpDisc="",fullAmount=0;var mainCycle=0;var line_netsum=0; line_brutsum=0; line_vat=0;var full_netsum=0;full_brutsum=0;full_vat=0;
while (x1<lofs){if (scart.substring(x1,x1+2)=="||"){tmpVals[cno]=scart.substring(x0,x1);
if(cno==fno){tmpItemID=tmpVals[0];tmpItem=tmpVals[1];netPrice=tmpVals[2];tmpAmount=tmpVals[3];tmpVat=tmpVals[4];tmpDisc=tmpVals[5];tmpME=tmpVals[6];tmpmaxamount=tmpVals[7];tmpItemID2=tmpVals[8];
var cDISC=getDISC2(tmpDisc,tmpAmount);
if(tmpItemID=="x_s_h_o_p"){ // document.write("<td ALIGN=LEFT COLSPAN=8><FONT SIZE=2><B><U>"+netPrice+"</U><input type=hidden name='shopid' value='"+tmpItem+"'>&nbsp;&nbsp;</TD></TR><TR>");
}else
{fullAmount+=(tmpAmount*1);netPriceCC=netPrice-(netPrice*cDISC/100);line_netsum=tmpAmount*netPriceCC;var brutPrice=Math.round(netPriceCC*(100+1*tmpVat))/100;var vatvalue=brutPrice-netPriceCC;line_brutsum =tmpAmount*brutPrice;line_vat=line_brutsum-line_netsum;full_netsum+=line_netsum;full_vat+=line_vat;full_brutsum+=line_brutsum;var tmpIN=mainCycle.toString();}cno=0;mainCycle++;}else{cno++;}
x1++;x0=x1+1;}x1++;}if (mainCycle>0){mainCycle--;}
var outSTR="<table class=\""+xClass+"\" style=\""+xEST+"\" cellpadding='0' cellspacing='0' width='100%'><tr><td class='hdl'> </td><td class='hd1'><span class='hdt'>KOSÁR</span></td><td class='hdr'> </td></tr><tr><td class='mdl'> </td><td class='txt'>";
outSTR+=" Tétel: "+fullAmount+"db<br>Összesen: "+convNum(full_brutsum,2)+" HUF.";
outSTR+="<div align=right><a href='javascript:_viewCart(document._rdr_x)'><font size=1>RÉSZLETEK</font></a></td><td class='mdr'> </td></tr><tr><td class='ftl'> </td><td class='ftm'> </td><td class='ftr'> </td></tr></table>";
document.write(outSTR);}


function newDownload(dlFile,xID){var outs=" <a href='/ew_catdownload.icom?id="+xID+"&shopid=ecolonia&playtype=m' target='_blank'><b><font size=1>MEGTEKINTÉS</font></b></a> ";outs+="<a href='/ew_catdownload.icom?id="+xID+"&shopid=ecolonia&playtype=d'><b><font size=1>LETÖLTÉS</font></b></a>";return outs;}

function getEB2(BOXID,NEWID,ID2,LANGUAGECODE,ISEBUSINESS,PRICE1,CURR1,VAT,DISCOUNTRULE,CURRENTAMOUNT,AUCTION,AUCTION_START,AUCTION_STOP,AUCTION_MINLIMIT,AUCTION_CURRPRICE,SERVERTIME,JTXINDEX,SHOPID,SHOPTITLE,ME,userdiscount)
{var outSSS="";if (ISEBUSINESS=="1"){if(AUCTION!="1")
{outSSS=getPrice(PRICE1,VAT,CURR1,DISCOUNTRULE,userdiscount);if(outSSS.length>0){outSSS="<br />"+outSSS;}
outSSS+="&nbsp;&nbsp;<span class='btn'><a href=\"javascript:selectorMOD2('"+BOXID+"',"+JTXINDEX+",'document.dm01','"+SHOPID+"','"+SHOPTITLE+"','"+NEWID+"','"+ID2+"','','"+PRICE1+"',1,'"+VAT+"','"+LANGUAGECODE+"','"+ME+"','"+CURRENTAMOUNT+"','"+DISCOUNTRULE+"','"+userdiscount+"');\">";outSSS+="KOSÁRBA</a></span><br/>&nbsp;"+CURRENTAMOUNT+" "+ME;}else{
var xxcp=parseFloat(AUCTION_CURRPRICE); var xxcv=parseFloat(PRICE1);
if (xxcp<xxcv){xxcp=xxcv;}else{xxcp+=parseFloat(AUCTION_MINLIMIT);}
outSSS="<br/><b> AUKCIÓ</b>";
if (AUCTION_MINLIMIT.length>0)
 { outSSS+="<b>:</b><br/> idötartam: "+AUCTION_START+"-"+AUCTION_STOP+"<br/> minimális licit: "+AUCTION_MINLIMIT+" "+CURR1+"<br/> KIKIÁLTÁSI ÁR: "+PRICE1+" "+CURR1+" &nbsp;&nbsp; AKTUÁLIS ÁR: "+AUCTION_CURRPRICE+" "+CURR1+".";
   outSSS+="<br/> AZ ÖN LICITJE: <input type=text name='licit"+NEWID+"' value='"+xxcp+"' class='inp' size=5> "+CURR1+" &nbsp;<a href='javascript:sendLICIT(\""+NEWID+"\",\""+BOXID+"\")'>licitálás</a>";
 }
}}
return outSSS;}

function fullFINISH2(boxid,newid,id2,jtx_index,shopid,ecatalog,relation1,relation2,isebusiness,price1,curr1,vat,current_amount,me,discountrule,auction,auction_start,auction_stop,auction_minlimit,auction_currprice,auctioner,voting,voter,voting_start,voting_stop,isepublish,epubcode,reviewenabled,reviewcount,rateenabled,ratingno,ratingsum,shoptitle,STime,userdiscount)
{if(!userdiscount){userdiscount="0";}
if(STime==null)STime="";var x1=getEB2(boxid,newid,id2,"hu",isebusiness,price1,curr1,vat,discountrule,current_amount,auction,auction_start,auction_stop,auction_minlimit,auction_currprice,STime,jtx_index,shopid,shoptitle,me,userdiscount);
if (ecatalog.length>2){x1+="<br>"+newDownload(ecatalog,newid);}
if (reviewenabled=="1"){x1+="<br /> <a href=\"javascript:showReviews('"+newid+"')\"><font class='INFO1'>HOZZÁSZÓLÁSOK ("+reviewcount+")</font></a>";}
if (relation1.length>1)  //hasonlok
{x1+="<br><a href='javascript:getREL1(\""+newid+"\",\""+relation1+"\",\"1\")'>TARTOZÉKOK</A>";}
if (relation2.length>1)  //tartozekok
{x1+="<br><a href='javascript:getREL1(\""+newid+"\",\""+relation2+"\",\"2\")'>HASONLÓK</A>";}
return x1;}

function endWriting2(boxid,currentPAGE,maxPAGE,prevImage,nextImage,writePGNO,formOBJ,REP)
{var outV="";var cPG=0;if (REP!=null){REP=",'N'";}else{REP="";} var bPG1="";var bPG2="";
var cib=Math.floor(currentPAGE/10)*10;
var maxpglim=cib+10-1;
if (currentPAGE>10){bPG1="<a href=\"javascript:setPAGE2_get('"+boxid+"',"+formOBJ+",'"+(cib-10)+"'"+REP+")\"><b><<</b></a>&nbsp;&nbsp;";}
if (maxpglim<=maxPAGE){bPG2="&nbsp;&nbsp;<a href=\"javascript:setPAGE2_get('"+boxid+"',"+formOBJ+",'"+(cib+10)+"'"+REP+")\"><b>>></b></a>";}
if (maxpglim>maxPAGE){maxpglim=maxPAGE;}
if (currentPAGE>0)
{cPG=currentPAGE-1;
 outV+=bPG1+"<a href=\"javascript:setPAGE2_get('"+boxid+"',"+formOBJ+",'"+cPG+"'"+REP+")\"><b><</b></a>&nbsp;";}
if ((writePGNO=="1")&&(maxPAGE>0)){var ci=cib;while (ci<=maxpglim){if (currentPAGE!=ci) outV+=" <a href=\"javascript:setPAGE2_get('"+boxid+"',"+formOBJ+",'"+ci+"'"+REP+")\">"+(ci+1)+"</a>";else outV+=" <b>"+(ci+1)+"</b>";
ci++;}}
if(currentPAGE<maxPAGE){cPG=currentPAGE+1;outV+=" &nbsp;<a href=\"javascript:setPAGE2_get('"+boxid+"',"+formOBJ+",'"+cPG+"'"+REP+")\"><b> > </b></a>"+bPG2;}
return outV;}


function endWriting2OLD(boxid,currentPAGE,maxPAGE,prevImage,nextImage,writePGNO,formOBJ,REP){var outV="";var cPG=0;if (REP!=null){REP=",'N'";}else{REP="";}
if (currentPAGE>0){cPG=currentPAGE-1; outV+="<a href=\"javascript:setPAGE2_get('"+boxid+"',"+formOBJ+",'"+cPG+"'"+REP+")\"><img src='"+prevImage+"' alt='Előző' border='0' /></a>&nbsp;";}
if ((writePGNO=="1")&&(maxPAGE>0)){var ci=0;while (ci<=maxPAGE){if (currentPAGE!=ci) outV+=" <a href=\"javascript:setPAGE2_get('"+boxid+"',"+formOBJ+",'"+ci+"'"+REP+")\">"+(ci+1)+"</A>";else outV+=" <b>"+(ci+1)+"</b>";
ci++;}}
if(currentPAGE<maxPAGE){cPG=currentPAGE+1;outV+=" &nbsp;<a href=\"javascript:setPAGE2_get('"+boxid+"',"+formOBJ+",'"+cPG+"'"+REP+")\"><img src='"+nextImage+"' alt='Következő' border=0></a>";}return outV;}

function removePAR(txtFROM,txtPAR)
{var pz1=txtFROM.indexOf("&"+txtPAR);
 if (pz1<0){pz1=txtFROM.indexOf("?"+txtPAR);}
if (pz1>-1)
{pz1++;
 var pz2=txtFROM.indexOf("&",pz1);if (pz2<0){pz2=txtFROM.length;}
 if(txtFROM.substring(pz1-1,pz1)=="?"){txtFROM=txtFROM.substring(0,pz1)+txtFROM.substring(pz2+1,txtFROM.length);}
  else{txtFROM=txtFROM.substring(0,pz1-1)+txtFROM.substring(pz2,txtFROM.length);}
}
return txtFROM;
}


function startNewTheme(_fObj,forumID,firstkey,boxID){_fObj.ewtarget0.value="0d";_fObj.ewassoc0.value="93";_fObj.submit();}
function authorThis(itemid,pcard){var trg="/ew_showusers.icom?itemid="+itemid+"&pcard="+pcard+"&template=userdata_hu.html&bgimage=<#BGIMAGE>";ow(trg,400,200);}
function answerThis(_fObj,ownID,baseID,categ,boxID){_fObj.ewtarget0.value="0e";_fObj.ewassoc0.value="93";_fObj.forumbaseid0.value=baseID;_fObj.forumitemid0.value=ownID;_fObj.submit();}
function sendGuestBook(_formOBJ){_formOBJ.ewtarget0.value="0b"; _formOBJ.ewassoc0.value="91"; _formOBJ.submit();}
function sendForum(_formOBJ){ _formOBJ.submit();}

function sendFORM(){_formOBJ=document.dm01;_formOBJ.ewassoc0.value="95";_formOBJ.ewtarget0.value="0b";_formOBJ.ewitem0.value="";_formOBJ.submit();}

function sendLOGIN(UNAME,UPW){document.location.replace("/ewPortal3.icom"+_jsessionid+"?shopid=ecolonia&language_code=hu&ewassoc0=89&ewtarget0=0a&log_username="+UNAME+"&log_password="+UPW);}
function _sendLOGIN2(UNAME,UPW,EXTCTG,AUTOL,tDomain){if(!tDomain){tDomain="";}if(AUTOL!=null){if (AUTOL.checked){AUTOL="&autologin=1"}else{AUTOL="&autologin=0";}}else{AUTOL="";};
document.location=tDomain+"/ewPortal3.icom"+_jsessionid+"?shopid=ecolonia&language_code=hu&ewassoc0=89&ewtarget0=0a&log_username="+UNAME+"&log_password="+UPW+"&extctg="+EXTCTG+AUTOL;}

function _sendLOGIN(UNAME,UPW){_formOBJ=document.dm01;_formOBJ.storey.value="ewtarget0="+_formOBJ.ewtarget0.value+" &ewassoc0="+_formOBJ.ewassoc0.value+" &ewcateg0="+_formOBJ.ewcateg0.value+" ";_formOBJ.ewtarget0.value="0a";_formOBJ.ewassoc0.value="89";_formOBJ.ewcateg0.value="";_formOBJ.submit();}
function _sendLOGOUT(tDomain){if(!tDomain){tDomain="";}document.location="/ns_logout.icom?callnext="+escape("/ewPortal3.icom?ewcateg0=1&language_code=hu&shopid=ecolonia");}

function _loadREGPAGE(){_formOBJ=document.dm01;_formOBJ.storey.value="ewtarget0="+_formOBJ.ewtarget0.value+" &ewassoc0="+_formOBJ.ewassoc0.value+" &ewcateg0="+_formOBJ.ewcateg0.value+" ";_formOBJ.ewassoc0.value="87";_formOBJ.ewtarget0.value="0";_formOBJ.updsql0.value="";_formOBJ.ewcateg0.value="";_formOBJ.ewitem0.value="";_formOBJ.submit();}
function sendRegister(){_loadREGPAGE();}
function _sendREG(){_formOBJ=document.dm01;_formOBJ.ewassoc0.value="87";_formOBJ.ewtarget0.value="0b";_formOBJ.ewitem0.value="";_formOBJ.submit();}
function _saveREG(){_formOBJ=document.dm01;_formOBJ.ewassoc0.value="86";_formOBJ.ewtarget0.value="0g";_formOBJ.ewitem0.value="";_formOBJ.submit();}
function _userPROFIL(tDomain){if(!tDomain){tDomain="";}document.location=tDomain+"/ewPortal3.icom"+_jsessionid+"?shopid=ecolonia&language_code=hu&ewassoc0=86";}
function sendCard(_formOBJ,eml1,eml2){if (isEmpty(eml1,3)||isEmpty(eml2,3)){alert("Kérjük, töltse ki mindkét email címet!");}
   else{_formOBJ.ewtarget0.value="0b";_formOBJ.submit();}
}
function goUSERPAGE(ewtarget,boxID,cstatus){document.location="/ewPortal3.icom"+_jsessionid+"?shopid=ecolonia&language_code=hu&ewassoc"+boxID+"=86&ewtarget"+boxID+"="+ewtarget+cstatus;}

function sendReview2(_formOBJ,boxID)
{eval("_formOBJ.ewtarget"+boxID+".value='"+boxID+"e'");_formOBJ.ewtarget0.value='0d';
/*var itemID=_formOBJ.ewitem0.value; eval("_formOBJ.ewitem"+boxID+".value=itemID");*/
_formOBJ.submit();
}


function backSTEP2(boxid,formOBJ){var x_id=eval("formOBJ.ewitem"+boxid+".value");var srcb=document.dm01.srcback.value;if(srcb.length>0){document.location="/ewPortal3.icom"+_jsessionid+"?ewassoc0=99&ewtarget0=0a&shopid=ecolonia&language_code=hu&updsql0="+escape(srcb);}else{goD(x_id);}}
function _sendAPRO(_formOBJ){_formOBJ.ewtarget0.value="0b"; _formOBJ.ewassoc0.value="71"; _formOBJ.submit();}
function _loadAPRO(_formOBJ){_formOBJ.ewtarget0.value="0a"; _formOBJ.ewassoc0.value="71";_formOBJ.ewcateg0.value=""; _formOBJ.submit();}
function _sendSUBUNSUB(epubidObjS,useremailObjS,userName,subunsub,tDomain)
{if(!tDomain){tDomain="";}
var uemail=eval(useremailObjS);if (uemail.length<1){return;}
var epubID=eval(epubidObjS+".value"); 
var xtrg="a";if (subunsub=="0"){xtrg="b";}
var ntrg=tDomain+"/ewPortal3.icom"+_jsessionid+"?shopid=ecolonia&language_code=hu&ewassoc0=75&ewtarget0=0"+xtrg+"&epublishcode="+epubID+"&useremail="+uemail;
document.location=ntrg;
}


function addc3a(shopid,shoptitle,i_id,i_id2,i_name,i_price,i_quant,i_vat,i_disc,langCode,i_me,i_c_amount,cookieName)
{var msg_OK=" belekerült a rendeléslistába.";var msg_notOK=" már a rendeléslistában van.";var msg_NoCookie="A rendeléslistába használata csak akkor lehetséges, ha engedélyezi a cookie-k használatát.";
if (!checkCookieEnabled2()){alert(msg_NoCookie);return;}
var scart = getCookie2(cookieName);if(!scart){scart ="";}
if (scart.length<2){var scart="x_s_h_o_p||"+shopid+"||"+shoptitle+"||x||x||x||x||x||x_s_end||";}
else{var checkseq="x_s_h_o_p||"+shopid+"||";var pz1=scart.indexOf(checkseq);
if (pz1<0){var tmpscart=scart;var ti=0;
while (ti<3){pz1=tmpscart.indexOf("||");tmps=tmpscart.substring(0,pz1);tmpscart=tmpscart.substring(pz1+2,tmpscart.length);ti++;}
if ("aáeéiíoóöuúüAÁEÉIÍOÓÖUÚÜ".indexOf(tmps.substring(1,1))>-1){tmps=" az "+tmps;}else{tmps=" a "+tmps;}
alert("Egyszerre csak egy üzletben vásárolhat. Jelenleg az Ön kosarában más üzletböl származó árucikkek is vannak.");return;}}
var tstr=i_id+"||"+i_name+"||"+i_price+"||"+i_quant+"||"+i_vat+"||"+i_disc+"||"+i_me+"||"+i_c_amount+"||"+i_id2+"||";i_id+="||";
if (scart.indexOf(i_id)<0){scart=scart+tstr;  alert(i_name+msg_OK);}else{alert(i_name+msg_notOK);}
setCookie2(cookieName,scart);return;}
function checkCookieEnabled2(){var curCookie= "test_cookie=Denebola";document.cookie=curCookie;var cSI = document.cookie.indexOf("test_cookie=");if (cSI<0){return false;}document.cookie = "test_cookie=" +"; expires=Thu, 01-Jan-70 00:00:01 GMT";return true;}
function setCookie2(name, value){var curCookie = name + "=" + escape(value);document.cookie = curCookie;}

function reFRESH2(){formOBJ=document.dm01;var lcc=document.location;var lca=""+lcc;var pz=lca.indexOf("?");if (pz>0) {eval('document.location="'+lcc+'"');}else {formOBJ.submit();}}
function SHOWHIDE(id,docobj) {if(docobj){var spI=docobj.getElementById(id);}else{var spI=document.getElementById(id);}
 if(spI.className=="genHIDENO"){spI.className="genHIDE";}else{spI.className="genHIDENO";}}

//backward comp.
function goC(xc_id){document.location="/ewPortal3.icom"+_jsessionid+"?shopid=ecolonia&language_code=hu&ewcateg0="+xc_id;}
function goD(_itemID){document.location="/ewPortal3.icom"+_jsessionid+"?shopid=ecolonia&language_code=hu&ewitem0="+_itemID;}
function startDownload(_itemID){document.location="/ew_proddownload.icom"+_jsessionid+"?itemid="+_itemID;}

// ***********
function wrtCALoxSEL(elID,xDateNum,targ)
{ var YEARscroll=false;
if(!marked){var marked="";}

var ARR_MONTHS_EN = ["January", "February", "March", "April", "May", "June","July", "August", "September", "October", "November", "December"];
var ARR_WEEKDAYS_EN = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];

var ARR_MONTHS = ["Január", "Február", "Március", "Április", "Május", "Június","Július", "Augusztus", "Szeptember", "Október", "November", "December"];
var ARR_WEEKDAYS = ["V", "H", "K", "Sze", "Cs", "P", "Szo"];

var NUM_WEEKSTART = 1; // day week starts from (normally 0-Su or 1-Mo)
var STR_ICONPATH = 'img/';  // path to the directory where calendar images are stored. trailing slash req.

var dt_selected=new Date();
var dt_current=dt_selected;
if (xDateNum>0){dt_current=new Date(xDateNum);}
var dt_firstday = new Date(dt_current);
dt_firstday.setDate(1);dt_firstday.setDate(1 - (7 + dt_firstday.getDay() - NUM_WEEKSTART) % 7);
var dt_prev_month = new Date(dt_current);dt_prev_month.setMonth(dt_prev_month.getMonth() - 1);
if (dt_prev_month.getDate() != dt_current.getDate())dt_prev_month.setDate(0);
var dt_next_month = new Date(dt_current);dt_next_month.setMonth(dt_next_month.getMonth() + 1);
if (dt_next_month.getDate() != dt_current.getDate())dt_next_month.setDate(0);
var dt_prev_year = new Date(dt_current); dt_prev_year.setFullYear(dt_prev_year.getFullYear() - 1);
if (dt_prev_year.getDate() != dt_current.getDate())dt_prev_year.setDate(0);
var dt_next_year = new Date(dt_current); dt_next_year.setFullYear(dt_next_year.getFullYear() + 1);
if (dt_next_year.getDate() != dt_current.getDate())dt_next_year.setDate(0);

var outSTR='<table class="clsOTable" cellspacing="0" border="0" width="100%"><tr><td bgcolor="#4682B4"><table cellspacing="1" cellpadding="3" border="0" width="100%"><tr><td colspan="7"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr>'+
'<td nowrap>'+(YEARscroll?'<a href=\'javascript:wrtCALoxSEL("'+elID+'",'+dt_prev_year.valueOf()+',"'+targ+'")\'><img src="'+STR_ICONPATH+'prev_year.gif" width="16" height="16" border="0" alt="previous year"></a>&nbsp;':'')+'<a href=\'javascript:wrtCALoxSEL("'+elID+'",'+dt_prev_month.valueOf()+',"'+targ+'")\'><img src="'+STR_ICONPATH+'prev.gif" width="16" height="16" border="0" alt="previous month"></a></td>'+
'<td align="center" width="100%"><font color="#ffffff">'+ARR_MONTHS[dt_current.getMonth()]+' '+dt_current.getFullYear() + '</font></td>'+
'<td nowrap><a href=\'javascript:wrtCALoxSEL("'+elID+'",'+dt_next_month.valueOf()+',"'+targ+'")\'><img src="'+STR_ICONPATH+'next.gif" width="16" height="16" border="0" alt="next month"></a>'+(YEARscroll?'&nbsp;<a href=\'javascript:wrtCALoxSEL("'+elID+'",'+dt_next_year.valueOf()+',"'+targ+'")\'><img src="'+STR_ICONPATH+'next_year.gif" width="16" height="16" border="0" alt="next year"></a>':'')+'</td>'+
'</tr></table></td></tr><tr>';

for (var n=0; n<7; n++)outSTR+='<td class="days" align="center">'+ARR_WEEKDAYS[(NUM_WEEKSTART+n)%7]+'</td>';
outSTR+='</tr>';
var dt_current_day = new Date(dt_firstday);
while (dt_current_day.getMonth() == dt_current.getMonth() ||dt_current_day.getMonth() == dt_firstday.getMonth())
 {outSTR+='<tr>';
  for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
		if (dt_current_day.getDate() == dt_selected.getDate() && dt_current_day.getMonth() == dt_selected.getMonth() && dt_current_day.getFullYear() == dt_selected.getFullYear())
			outSTR+='<td class="cday" align="center" width="14%">'; // print current date
		else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
			outSTR+='<td class="wedays" align="center" width="14%">'; // weekend days
		else 		
			outSTR+='<td bgcolor="#ffffff" align="center" width="14%">'; // print working days of current month

                outSTR+='<a href=\'javascript:setcal("'+targ+'","'+dt_current_day.getYear()+'.'+lCorr(dt_current_day.getMonth()+1,2)+'.'+lCorr(dt_current_day.getDate(),2)+'.","'+elID+'")\'>';

		if (dt_current_day.getMonth() == dt_current.getMonth()) outSTR+='<font color="#000000">'; // print days of current month
			else outSTR+='<font color="#606060">';// print days of other months
		outSTR+=dt_current_day.getDate()+'</font></a></td>';
		dt_current_day.setDate(dt_current_day.getDate()+1);
	}
	outSTR+='</tr>';
}
outSTR+='</table></td></tr></table>';
var xDIV=document.getElementById(elID);
xDIV.innerHTML=outSTR;
}
function lCorr(nm,lng){var s="000"+nm;return s.substring(s.length-lng,s.length);}
function setcal(trg,ots,calid)
{ var calDIV=document.getElementById(calid);calDIV.style.display="none";
var calTRG=document.getElementById(trg);calTRG.value=ots;}
function writeCAL(elID,xDateNum,targ)
{var calDIV=document.getElementById(elID);
//var e=window.event; calDIV.style.top=e.clientY+"px"; calDIV.style.left=e.clientX+"px";
if(calDIV.style.display=="block"){calDIV.style.display="none";}else{calDIV.style.display="block";}
wrtCALoxSEL(elID,xDateNum,targ);
}






/* dynaCREATE*/
var counters = new Array();

function addAlertWin(template, type)
{if(!counters[type]){counters[type]=0;}
 counters[type] += 1;
 var container = document.getElementById(type + "Container");
 var templateHTML = document.getElementById(template).innerHTML;
 var itemDiv = document.createElement("div");
 itemDiv.setAttribute("id", type + "_" + counters[type] + "_div");
 itemDiv.setAttribute("style", "width:300px;height:200px;border:#ff0000 1px solid;position:absolute;z-index:77;top:"+(counters[type]*15+30)+"px;left:40px;");
 itemDiv.className = "repeatedField"
 itemDiv.innerHTML = templateHTML.replace(/COUNTER/g, counters[type]);
 container.appendChild(itemDiv);
}
function addRepeatedField(template, type)
{if(!counters[type]){counters[type]=0;}
 counters[type] += 1;
 var container = document.getElementById(type + "Container");
 var templateHTML = document.getElementById(template).innerHTML;
 var itemDiv = document.createElement("div");
 itemDiv.setAttribute("id", type + "_" + counters[type] + "_div");
 itemDiv.className = "repeatedField"
 itemDiv.innerHTML = templateHTML.replace(/COUNTER/g, counters[type]);
 container.appendChild(itemDiv);
return counters[type];
}
function deleteRepeatedField(prefix, counterVal)
{var container = document.getElementById(prefix + "Container");
 var elemName;
 if(counterVal != -1){elemName = prefix + "_" + counterVal + "_div";}else{elemName = prefix + "_div";}
 var elem = document.getElementById(elemName);
 container.removeChild(elem);	
}

function scanFIELDS(fOBJ)
{alert(fOBJ.elements.length);
for(i=0;i<fOBJ.elements.length;i++)
 {alert(fOBJ.elements[i].name+"="+fOBJ.elements[i].value+"  ||"+fOBJ.elements[i].type)}
}

// googleMaps
GMAPs = function()
{var GMObj;
 var gdir; var geocoder; var ajaxMon; var latTarget; var lonTarget; var altTarget;
 var geoJSON;
 var baseDOC; var callBack;var finFN;
}
GMAPs.prototype ={
init: function(baseDOC,callBack,finFN)
{ GMObj=this;
 if (baseDOC){this.baseDOC=baseDOC;}else{this.baseDOC=document;}
 if (callBack){this.callBack=callBack;}else{this.callBack="GMObj.GEO2CNF";}
 if (finFN){this.finFN=finFN;}else{this.finFN="GMObj.GEO2FIN";}
if (GBrowserIsCompatible()){GMObj.geocoder = new GClientGeocoder();}
},
GeoCodeIt: function(address,ajaxMon,latTarget,lonTarget,altTarget)
{GMObj.ajaxMon=ajaxMon;GMObj.latTarget=latTarget;GMObj.lonTarget=lonTarget;GMObj.altTarget=altTarget;
GMObj.geocoder.getLocations(address, GMObj.GeoCoded);
},
GeoCoded: function(response)
{if (!response || response.Status.code != 200) {alert("Sorry, we were unable to geocode that address");}
else
{GMObj.geoJSON=response;
if(GMObj.geoJSON.Placemark.length>0)
 {var str1="<div id='sss' class='inp' style='display:block;border:#000 1px solid;padding:5px;height:auto;'>";
  for (var i=0;i<GMObj.geoJSON.Placemark.length;i++)
   {str1+="<input type='radio' name='pln' id='pln' value='"+i+"' onclick='javascript:"+GMObj.callBack+"("+i+")' /> "+GMObj.geoJSON.Placemark[i].address+"<br/>";}
  str1+="<div align='right' style='border-top:#000 1px solid;padding:3px;'><input type='button' value='close' class='btn' onclick='javascript:"+GMObj.finFN+"()'/></div></div>" 
  var e = GMObj.baseDOC.getElementById(GMObj.ajaxMon);e.innerHTML = str1;
 }
}
},
GEO2CNF: function(poz)
{GMObj.latTarget.value=GMObj.geoJSON.Placemark[poz].Point.coordinates[1];
 GMObj.lonTarget.value=GMObj.geoJSON.Placemark[poz].Point.coordinates[0];
},
GEO2FIN: function(){var e = document.getElementById(GMObj.ajaxMon);e.innerHTML ="";},

handleErrors: function()  // general errorhandler
{if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS) alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code);
   else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)  alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
   else if (gdir.getStatus().code == G_GEO_MISSING_QUERY) alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);
   else if (gdir.getStatus().code == G_GEO_BAD_KEY) alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);
   else if (gdir.getStatus().code == G_GEO_BAD_REQUEST) alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
   else alert("An unknown error occurred.");
}
}

/*  ALIEN  redesigned Javascript functions  */
/*   Copyright 2009, ALIEN Consulting LLC.  */


// --- DOM manipulation. elementstypes:hidden text file textarea  select-one select-multiple checkbox radio
function getHTMLVar(varName,errRetVal)
{var element = document.getElementById(varName);
if (element==null){var a1=document.getElementsByName(varName);if (a1==null){return errRetVal;}if (a1.length<1){return errRetVal;}element=a1[0];}
var res= "";
if(element.type)
switch(element.type){
case "checkbox": if(element.checked)res=element.value;break;
case "radio":var a1=document.getElementsByName(varName);for(var ii=0;ii<a1.length;ii++){if(a1[ii].checked)res=a1[ii].value;};break;
case "select-one":var si=element.selectedIndex;res=element.options[si].value;break;
case "select-multiple":for(var jj=0;jj<element.options.length;jj++){if(element.options[jj].selected)res+=element.options[jj].value+",";};break;
default:res=element.value;break;}
else{res=element.innerHTML;}
return res;
}

function setHTMLVar(varName,Value)
{var element = document.getElementById(varName);
if (element==null){var a1=document.getElementsByName(varName);if (a1==null){return errRetVal;}if (a1.length<1){return errRetVal;}element=a1[0];}
var ii=0;
if(element.type)
switch(element.type){
case "checkbox": if(element.value==Value){element.checked=true;};break;
case "radio":var a1=document.getElementsByName(varName);for(ii=0;ii<a1.length;ii++) {if(a1[ii].value==Value){a1[ii].checked=true;}}break;
case "select-one":for(ii=0;ii<element.options.length;ii++){if(element.options[ii].value==Value){element.selectedIndex=ii;}}break;
case "select-multiple":for(ii=0;ii<element.options.length;ii++){element.options[ii].selected=((Value.indexOf(element.options[ii].value)>-1)&&(element.options[ii].value.length>0));}break;
default:element.value=Value;break;}
else{element.innerHTML=Value;}
return true;
}

function showHideN(idN)
{var o1=document.getElementById(idN);
 if(o1){if (o1.style.display=="none"){o1.style.display="block";}else{o1.style.display="none";}}
}




function ox64encode(inS){return ( Base64.encode(inS).replace(/[+]/g,"_").replace(/[/]/g,"|").replace(/[=]/g,"-"));}
function ox64decode(inS){return ( Base64.decode(inS.replace(/[_]/g,"+").replace(/[|]/g,"/").replace(/[-]/g,"=")));}
/**
*
*  Base64 encode / decode
*  http://www.webtoolkit.info/
*
**/
 
var Base64=
{_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
encode : function (input) {
		var output = "";
		var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
		var i = 0;
 
		input = Base64._utf8_encode(input);
 
		while (i < input.length) {
 
			chr1 = input.charCodeAt(i++);
			chr2 = input.charCodeAt(i++);
			chr3 = input.charCodeAt(i++);
 
			enc1 = chr1 >> 2;
			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
			enc4 = chr3 & 63;
 
			if (isNaN(chr2)) {
				enc3 = enc4 = 64;
			} else if (isNaN(chr3)) {
				enc4 = 64;
			}
 
			output = output +
			this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
			this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
 
		}
 
		return output;
	},
 
	// public method for decoding
	decode : function (input) {
		var output = "";
		var chr1, chr2, chr3;
		var enc1, enc2, enc3, enc4;
		var i = 0;
 
		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
 
		while (i < input.length) {
 
			enc1 = this._keyStr.indexOf(input.charAt(i++));
			enc2 = this._keyStr.indexOf(input.charAt(i++));
			enc3 = this._keyStr.indexOf(input.charAt(i++));
			enc4 = this._keyStr.indexOf(input.charAt(i++));
 
			chr1 = (enc1 << 2) | (enc2 >> 4);
			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
			chr3 = ((enc3 & 3) << 6) | enc4;
 
			output = output + String.fromCharCode(chr1);
 
			if (enc3 != 64) {
				output = output + String.fromCharCode(chr2);
			}
			if (enc4 != 64) {
				output = output + String.fromCharCode(chr3);
			}
 
		}
 
		output = Base64._utf8_decode(output);
 
		return output;
 
	},
 
	// private method for UTF-8 encoding
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
 
		for (var n = 0; n < string.length; n++) {
 
			var c = string.charCodeAt(n);
 
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
 
		return utftext;
	},
 
	// private method for UTF-8 decoding
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;
 
		while ( i < utftext.length ) {
 
			c = utftext.charCodeAt(i);
 
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
 
		}
 
		return string;
	}
 
}

