 var ATCLabel = undefined;//if(THIS_WEB == undefined)  THIS_WEB = "http://localhost/auktiva/";//if(LTHIS_WEB == undefined) LTHIS_WEB = THIS_WEB;   // kontrola cookie a jejich ulozeni do pole _COOKIES_  // v tomto poli jsou vsechny cookie a je mozno je pouzivat dale ve vsech nactenych strankachfunction nedelejnic(){}var RecaptchaOptions = {   custom_translations : {         instructions_visual : "Opište 2 slova:",         instructions_audio : "Napište písmena která slyšíte",          play_again : "Přehrát znovu",          cant_hear_this : "Stáhnout ve formátu MP3",          visual_challenge : "Zobrazit text",          audio_challenge : "Přehrát",          refresh_btn : "Nový obrázek",          help_btn : "Nápověda",          incorrect_try_again : "Text nebyl opsán správně. Opište ho prosím znovu"      },   theme : 'clean',   lang : 'cs'};   var _COOKIES_ = new Array();    _COOKIES_['login'] = '';   cookies = document.cookie.split('; ');  var a;   i = 0;   while(cookies[i]){       prom = cookies[i].split('=');       if(prom[1] != null){          prom[1] = prom[1].replace(/%2F/g,'/');          prom[1] = prom[1].replace(/%3F/g,'?');          prom[1] = prom[1].replace(/%3D/g,'=');       }       _COOKIES_[prom[0]] = prom[1];      // document.write(prom[0]+' = '+prom[1]+'<br>');                                                                                                                                          i++;   }// zobrazi ve vypisu aukce menu pro prodejcefunction AuctionSellerMenu(SellerID,AuctionID){   if(SellerID == _user_id){      var SE = document.getElementById('SellerMenu');      $(SE).append('<div><a href="'+THIS_WEB+'newauction.php?aid='+AuctionID+'">Prodat podobný předmět</a></div>');      $(SE).append('<div><a href="'+THIS_WEB+'changeauction.php?aid='+AuctionID+'">Změnit aukci</a></div>');      $(SE).append('<div><a href="'+THIS_WEB+'cancelauction.php?aid='+AuctionID+'">Zrušit aukci</a></div>');         }}// upravuje navigacni menu podle toho jestli je uzovatel prihlasen ci nikolivfunction nav_menu(){   var navmacc = document.getElementById('nav_mac');   var navsell = document.getElementById('nav_sell');      var link = document.createElement('a');   link.href = LTHIS_WEB + 'myaccount.php';         if(_user_logged==1){         // uzivatel je prihlasen         link.innerHTML = 'Můj účet';         navmacc.appendChild(link);         // Uzivatel neni prihlasen      } else {               var reg = document.createElement('td');         var reglink = document.createElement('a');                  reglink.href = LTHIS_WEB + 'registrace.php';         reglink.innerHTML = 'Registrace';                           reg.appendChild(reglink);               navsell.parentNode.insertBefore(reg,navsell);               link.innerHTML = 'Přihlášení';         navmacc.appendChild(link);                          }}function userRequest(req,url){   //alert('ahojky');   w = wmCreateWindow('userrequest','Uživatelský požadavek');   wbody = w.wbody;      lbform = document.createElement('form');   lbform.id = 'log';   lbform.method = 'post';   //loginboxHTML ='<div><table><tr><td>Uživatelské jméno:</td><td><input id="login" type="text" name="username"></td></tr><tr><td>Heslo:</td> <td><input type="password" name="password"></td></tr></table></div>'   lbform.innerHTML = 'Pro požadovanou akci musíte být přihlášen/a';   wbody.appendChild(lbform);      w.form = lbform;      document.body.appendChild(w);   wmMoveToMousePosition(w);}// zobrazi hlasku o nacitanifunction pleas_wait(param){    if(param == 'hide'){     //alert('Hide');     pw = document.getElementById('pleas_wait');       //alert(pw.className);     if(pw){        pw.className = "displaynone";    }    return true;  }        var scrOfX = 0, scrOfY = 0;  if( typeof( window.pageYOffset ) == 'number' ) {    //Netscape compliant    scrOfY = window.pageYOffset;    scrOfX = window.pageXOffset;  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {    //DOM compliant    scrOfY = document.body.scrollTop;    scrOfX = document.body.scrollLeft;  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {    //IE6 standards compliant mode    scrOfY = document.documentElement.scrollTop;    scrOfX = document.documentElement.scrollLeft;  }    wh = document.documentElement.clientHeight;    scl=scrOfY+(wh/2)-50+"px";  //scl = 0;    pw = document.getElementById('pleas_wait');  if(pw==null){          body = document.getElementsByTagName("body");     a  = ('<div id="pleas_wait" class="displaynone">');     a += ('<img src="'+THIS_WEB+'ikony/spinner.gif" alt="Prosím počkejte">');     a += ('<br>Načítám');     a += ('</div>');       $(body).append(a);    }    pw = document.getElementById('pleas_wait');    //alert(pw.className);  if(pw){     if(pw.className == "displaynone"){        //alert('ahoj');        pw.style.top = scl;        pw.className = "displayblock";     } else {        //alert('nazdar');        pw.className = "displaynone";     }  }}// prepise cas aukce v danem tagufunction evalAuctionEndTime(e,time){   if((_SERVER_TIME != null) || (_SERVER_TIME != '')){      var now      =  _SERVER_TIME;      var est      = '';      var rest     = ((time*1000) - now);             var label = '';        if(ATCLabel != undefined) label = ATCLabel; else label = "Skončeno"       if(rest <0) est = '<font class="auctionended">'+label+'</font>';      else{                     var rdays    = Math.floor(rest / (60*60*24*1000));               var rhours   = Math.floor((rest % (60*60*24*1000))/(60*60*1000));         var rmins    = Math.floor((rest % (60*60*1000))/(60*1000));         var rseconds = Math.floor((rest % (60*1000))/1000);         if(rdays >0){   est += rdays;                           if(rdays==1) est += " den";                           else if((rdays>1) && (rdays<=4)) est += " dny"; else  est += " dní";                           }                           est += " "+rhours+" h";         if(rdays == 0)     est += " "+rmins+" m "+rseconds+" s";      }            $(e.firstChild).replaceWith(est);   }}// meni cas konce aukce v aukcifunction AuctionEndTimeClock(){   var e  = document.getElementById('endtime');   var time = e.childNodes[1].innerHTML;      if((_SERVER_TIME != null) || (_SERVER_TIME != '')){      var curr     = (new Date()).getTime();      var now      =  _SERVER_TIME + (curr -  _COMPUTER_TIME);      var est      = '';      var rest     = ((time*1000) - now);      var label = '';        if(ATCLabel != undefined) label = ATCLabel; else label = "Skončeno"       if(rest <0) est = '<font class="auctionended">'+label+'</font>';      else{         var rdays    = Math.floor(rest / (60*60*24*1000));               var rhours   = Math.floor((rest % (60*60*24*1000))/(60*60*1000));         var rmins    = Math.floor((rest % (60*60*1000))/(60*1000));         var rseconds = Math.floor((rest % (60*1000))/1000);       if(rdays>0)   est += rdays+" d ";       if(rhours>0)  est += rhours+" h ";       if(rmins>0)   est += rmins+" m ";                     est += rseconds+" s";      }      $(e.firstChild).replaceWith(est);      e.className= 'AuctionEndTime b';   }}// vytvari hlavicku okna     function CreateWindowHead(name,style){    }    // vytvari hlavicku okna     function CreateWait(img){           var cont = document.createElement('div');              cont.className = 'waitClock';           var pic = document.createElement('img');              pic.src = THIS_WEB + 'ikony/spinner.gif';                            $(cont).append(pic);              return(cont);               }    				function choosenAuctions(){    }		function choosenAuctionMainPage(){    }   function gallery_show_picture(pindex,pwidth,pheight){      for(i = mini;i<maxi;i++){         p = document.getElementById('gallery'+i);         sp = document.getElementById('smallgallery'+i);         if(p){            if(pindex == i){             p.className = 'displayblock';            //alert(p.resized);                            if(p.resized == undefined){                  // jeste jsem obrazek nezmensil                  pictureResize(p,pwidth,pheight);                  p.resized = 1;               }               if(sp){                  sp.oldClassName = sp.className;                  sp.className += "selected";               }             } else {               p.className = 'displaynone';               if(sp && sp.oldClassName){                  sp.className = sp.oldClassName;               } else {                  sp.className = '';               }                        }         }      }      }   function gallery_resize_pictures(pwidth,pheight){      for(i = mini;i<maxi;i++){         p = document.getElementById('gallery'+i);         //alert(i+' / '+pwidth+' / '+pheight);         if(p){            pictureResize(p,pwidth,pheight);         }      }      }				function showBigAuctionPictures(maxWidthOfBigPicture,maxHeightOfBigPicture){           var pictures = document.getElementById('smallauctionpictures');       var bigpictures = document.getElementById('bigauctionpictures');               var img;               var TheAuctionVisiblePicture = null;                var aNodes = pictures.childNodes;       var pic = new Array();       var first = 1;       //alert(aNodes.length);       for(var i=0;i < aNodes.length; i++){       //alert(i);         if(aNodes[i].tagName == 'A'){            var sNodes = aNodes[i].childNodes;            //alert(sNodes.length);                        for(var j=0;j < sNodes.length; j++){               if(sNodes[j].className == 'picture displaynone'){                                    img = document.createElement('img');                  img.src = sNodes[j].innerHTML;                  img.alt = 'obrazek';                  if(first == 1) {                     img.className='';                      TheAuctionVisiblePicture = img;                     img.onload = function() { pictureResize(this,maxWidthOfBigPicture,maxHeightOfBigPicture); };                     first = 0;                  } else img.className = 'displaynone';                                                      aNodes[i].picture = img;                  aNodes[i].picturesrc = sNodes[j].innerHTML;                  aNodes[i].onmouseover = function() {                         if(TheAuctionVisiblePicture != null) TheAuctionVisiblePicture.className = 'displaynone';                         this.picture.className ='';                         pictureResize(this.picture,maxWidthOfBigPicture,maxHeightOfBigPicture)                         TheAuctionVisiblePicture = this.picture;                       }                  //aNodes[i].style.border = '1px solid red';                  $(bigpictures).append(img);                  }            }         }                  //aNodes[i].onmouseover = function() { MWNahled(this); }         //aNodes[i].onmouseout  = function() { $('#MWNahled').css('display','none'); }                 }       //alert(TheAuctionVisiblePicture.width);           }    function pictureResize(img,maxw,maxh){                      height = img.height;                  width = img.width;                 //alert(height+' / '+width);                  var h = height / maxh;                  var w = width / maxw;                                    if((height > maxh) && (width > maxw)){                                         if(w >h){                       img.width = maxw;                       img.height = height / w;                       img.style.left = '-'+((width - maxw) / 2) +'px';                     } else {                       img.height = maxh;                        img.width = width / h;                       img.style.left = '-'+((width - maxw) / 2) +'px';                                         }                  } else if((height > maxh)){                     img.height = maxh;                      img.width = width / h;                     img.style.left = '-'+((width - maxw) / 2) +'px';                  } else if((width > maxw) ){                       img.width = maxw;                       img.height = height / w;                       img.style.left = '-'+((width - maxw) / 2) +'px';                                       }        }    function mainPictureResize(img,maxw,maxh){                      height = img.height;                  width = img.width;                                   var h = height / maxh;                  var w = width / maxw;                                                      if((height > maxh) && (width > maxw)){                                         if(w >h){                       img.height = maxh;                        img.width = width / h;                        } else {                       img.width = maxw;                       img.height = height / w;                     }                  } else if((height > maxh)){                       img.width = maxw;                       img.height = height / w;                    } else if((width > maxw) ){                     img.height = maxh;                      img.width = width / h;                                     }        }     // vraci pocet znaku, ktery zbyva   function  CharCount(obj,printarea,max){     c = obj.value.length;     if(c>max) obj.value = obj.value.substr(0,max);     c = max-c;     if(c<0) c=0;     $(printarea).empty();     $(printarea).append("Zbývá: "+c);    }  // vraci pocet znaku, ktery zbyva  function CharCounterExt(textbox,tmax){   if(!tmax) tmax = 1000;   ttext = textbox.value.length;   if(ttext > tmax) textbox.value = textbox.value.substr(0,tmax);   ttext = tmax-ttext;   if(ttext<0) ttext=0;   ttext = 'Zbývá: '+ttext;   if(textbox.charcounter){      textbox.charcounter.innerHTML = ttext;   } else {         var charbox = document.createElement('div');      charbox.innerHTML = ttext;      //charbox.style.position = 'relative';      textbox.parentNode.insertBefore(charbox, textbox.nextSibling);      charbox.className = 'charCounter';      textbox.charcounter = charbox;         }}  function AuctionQuickCopy(form,aid){     document.forms[form]['quickcopy'].value = aid;     document.forms[form].submit();  }    function BeforeTextareaSubmit(form){           ta = document.getElementsByTagName('textarea');     ok = 1;          for( var i=0; i<ta.length;i++){        // pouze pokud je to textarea pro formular        if(ta[i].name.substring(0,4) == "comm"){           if(ta[i].value.length <= 0){              ok = 0;           }        }        }     if(ok > 0){       document.forms[form].submit();     } else alert('Nejdřív prosím vyplňte formulář.');    }      function BeforeInputBoxSubmit(boxes,form){          ib = document.forms[form][boxes];     ok = 0;     if((ib != undefined) || (ib != null)){        for( i=0; i<ib.length;i++){          if(ib[i].checked == true){          ok = 1;           }        }     }                 if(ok > 0){       document.forms[form].submit();     } else alert('Vyberte prosím nějaké položky.');    }    function checkSelectBoxes(boxes,form){          ib = document.forms[form].elements[boxes];     ok = 0;     //alert(boxes+' / '+form+' / '+document.forms[form].elements['aitem[]']+' | '+ib);     if(ib){        if(ib.length == undefined){             if(ib.checked == true) ok = 1;                } else {           for(i=0; i<ib.length;i++){             if(ib[i].checked == true) ok = 1;           }                }     }     if(ok > 0){       return 1;     } else return 0;    }    // zaskrtne/odskrtne vsechy checkboxy podle hodnytycheckboxu box  function checkAllCheckboxes(box,boxes,form){     if((box != undefined) && (box.checked != undefined)){        if(box.checked == true){           InputBoxesSelectAll(boxes,form);        } else{           InputBoxesUnselectAll(boxes,form)        }     }  }    function InputBoxesSelectAll(boxes,form){       ib = document.forms[form][boxes];                if((ib != undefined) || (ib != null)){        if(ib.length == undefined){   // je to jen jeden prvek          ib.checked = true;        } else {           for( i=0; i<ib.length;i++){              if(ib[i].disabled != true) ib[i].checked = true;           }            }     }  }    function InputBoxesUnselectAll(boxes,form){       ib = document.forms[form][boxes];       if((ib != undefined) || (ib != null)){        if(ib.length == undefined){   // je to jen jeden prvek          ib.checked = false;        } else {             for( i=0; i<ib.length;i++){              ib[i].checked = false;           }        }         }  }      function InputBoxesInverse(boxes,form){       ib = document.forms[form][boxes];       if((ib != undefined) || (ib != null)){        if(ib.length == undefined){   // je to jen jeden prvek              if(ib.disabled != true){                 if(ib.checked == true) ib.checked = false;                 else ib.checked = true;              }        } else {           for( i=0; i<ib.length;i++){              if(ib[i].disabled != true){                 if(ib[i].checked == true) ib[i].checked = false;                 else ib[i].checked = true;              }           }        }         }  }     function isdefined( variable)  {     return (typeof(window[variable]) == "undefined")?  false: true;  }  function getCookie(c_name){     if (document.cookie.length>0){      c_start=document.cookie.indexOf(c_name + "=");      if (c_start!=-1){         c_start=c_start + c_name.length+1;         c_end=document.cookie.indexOf(";",c_start);         if (c_end==-1) c_end=document.cookie.length;         return unescape(document.cookie.substring(c_start,c_end));      }   }   return "";}function setCookie(c_name,value,expiredays,path){   var exdate=new Date();   exdate.setDate(exdate.getDate()+expiredays);   var cookie_string = c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());      if ( path )        cookie_string += "; path=" + escape ( path );      document.cookie = cookie_string;}  function formFillIn(lparams,formular,valid){// Foreach    if(!formular) formular = 'main_form';   var myform = document.forms[formular];  // hledani podle name    if(myform == null) myform = document.getElementsById(formular); // hledani podle ID    if(valid == undefined) valid = 1;   for ( var i in lparams )   {      //alert('ahoj: '+i);       var obj = myform.elements[i];            if((obj != null)){                 //document.write(i+" = "+obj.type+'<br>');         switch(obj.type)         {           case 'text':             //alert(i+" = "+obj.type+" "+lparams[i][1]);             if(lparams[i][0] !='') obj.value = lparams[i][0];             if(valid){                if(lparams[i][1]==2) obj.className = obj.className + " wrong";                if(lparams[i][1]==1) obj.className = obj.className + " missing";             }                          break;           case 'password':             //alert(i+" = "+obj.type+" "+lparams[i][1]);             if(lparams[i][0] !='') obj.value = lparams[i][0];             if(valid){                if(lparams[i][1]==2) obj.className = obj.className + " wrong";                if(lparams[i][1]==1) obj.className = obj.className + " missing";             }                          break;                              case 'checkbox':             if(((lparams[i][0]>0)||(lparams[i][0] == 'on'))) { obj.checked = true; }             if(valid){                if(lparams[i][1]==2) obj.parentNode.className  += " wrong";                if(lparams[i][1]==1) obj.parentNode.className += " missing";             }             break;           case 'textarea':             if(lparams[i][0] !='') obj.value = lparams[i][0];             if(valid){                if(lparams[i][1]==2) obj.className = obj.className + " wrong";                if(lparams[i][1]==1) obj.className = obj.className + " missing";             }                               break;                       case undefined:    // to nejspise bude radio             r_obj = obj[0];             if((r_obj != null)&&(r_obj.type ='radio')){                formSelectRadiotWithValue(obj,lparams[i][0]);;             }             break;           case 'select-one':             formSelectSelectWithValue(obj,lparams[i][0]);              if(lparams[i][1]){                var d = document.getElementById(i);                if(d != null && valid) {                   d.style.border = '2px solid #ffcc00';                   d.style.background = '#f9e378';                } else obj.className = obj.className + " wrong_s";                          }             break;           default:             //alert('default: '+i);             break;                   }      }   }}// funkce se pokusi najit v danem selectboxu prvek s// danou hodnotou a priradi ho jako SELECTfunction formSelectSelectWithValue(s,val){   if((s != null)&&((s.type == 'select-one')||(s.type == 'select-multiple'))){    //document.write('-------------- '+val+' ---------------');    for(var i=0;i<s.length;i++){           //document.write('- '+s[i].value);       if(s[i].value == val){          s.selectedIndex = i;         // document.write('- Select<br>');          return(1);       } // else document.write('<br>');    }  }}// funkce se pokusi najit v danem selectboxu prvek s// danou hodnotou a priradi ho jako SELECTfunction formSelectRadiotWithValue(s,val){   if(s != null){        l = s.length;        //document.write('-------------- '+l+' __ '+val+' ---------------<br>');    if(l>1){  // prvku je vic, mucim je projit a zjistit ktery odpovida hodnote    for(var i=0;i<l;i++){           //document.write('- '+s[i].value);       if(s[i].value == val){          //s.selectedIndex = i;          s[i].click();         // document.write('- Select<br>');          //return(1);       }  //else document.write('<br>');    }            } else {  // je to jedinej prvek typu radio, oznacim tedy jej    } }}   function helpCreate(){   var Help   = document.createElement('div');   //var Head   = document.createElement('div');  Head.className = "head";   var Main   = document.createElement('div');  Main.className = "main";   var LeftS  = document.createElement('div');  LeftS.className = "left_shad";   var RightS = document.createElement('div');  RightS.className = "right.shad";   var HT     = document.createElement('div');  HT.className = "helptext";   var Bottom = document.createElement('div');  Bottom.className = "arrow";      HT.innerHTML   = "Nápovědu se nepodařilo nalézt";   //Head.innerHTML = "Nápověda";      //Main.appendChild(Head);   Main.appendChild(HT);      LeftS.appendChild(Main);   Help.appendChild(LeftS);   Help.appendChild(RightS);   Help.appendChild(Bottom);      Help.id = "help2";   Help.visibility = 'hidden';      document.body.appendChild(Help);   return Help;}   function helpHide(){    $("#help2").hide();}function helpShow(e,hid,nohelp){   H = document.getElementById('help2');     if(H == undefined){  H = helpCreate(); }  //opera Netscape 6 Netscape 4x Mozilla    if (window.innerWidth || window.innerHeight){       docwidth = window.innerWidth;       docheight = window.innerHeight;    }   //IE Mozilla    if (document.body.clientWidth || document.body.clientHeight){       docwidth = document.body.clientWidth;       docheight = document.body.clientHeight;    }     //help width    $("#help2 .helptext").remove();    if(HELP[hid] != null){ hlp = HELP[hid] } else if(nohelp == undefined) hlp = 'Nápovědu pro toto téma se nepodařilo nalézt.'; else hlp = hid;    $("#help2 .main").append('<div class="helptext">'+hlp+'</div>');    var right = docwidth - $(e).position().left;     H.style.top = $(e).position().top-$("#help2").height()-9+'px';    if($(e).position().left>(docwidth/2)) { H.style.left = 'auto'; H.style.right = right-25+'px'; $("#help2 .arrow").css('left','auto'); $("#help2 .arrow").css('right','10px'); }                                  else  { H.style.left  = $(e).position().left-10+'px'; H.style.right = 'auto'; $("#help2 .arrow").css('left','10px'); $("#help2 .arrow").css('right','auto');}    $("#help2").show(); }  function smallFormRequest(req,prom,val){  f = document.createElement('form');  r = document.createElement('input');  f.appendChild(r);  p = document.createElement('input');  f.appendChild(p);    f.method = 'post';    r.name  = 'request';  r.value = req;    p.name  = prom;  p.value = val;      document.body.appendChild(f);  f.submit();}function smallFormRequestArr(req,proms){  f = document.createElement('form');  r = document.createElement('input');  f.appendChild(r);  f.method = 'post';    r.name  = 'request';  r.value = req;  // promenne typu {'a':'1','b':'2'}  for(i in proms){     p = document.createElement('input');     p.name  = i;     p.value = proms[i];     f.appendChild(p);  }    document.body.appendChild(f);  f.submit();}  function submitMyaccList(f,s,i){   if(i== undefined) i = 'aitem[]';      if(checkSelectBoxes(i,f)){      var selbox = document.forms[f][s];      if(selbox[selbox.selectedIndex].value != undefined) eval(selbox[selbox.selectedIndex].value);      } else {      alert('Vyberte prosím nějaké položky.');   }}  function myaccFormSubmit(form,request){   f = document.forms[form];   formAddRequest(form,request)         f.submit(); // odeslu   }function auctionsMaccDelete(form,request){   f = document.forms[form];   formAddRequest(form,request)         f.submit(); // odeslu   }function auctionsAddreqAndSub(form,request){   f = document.forms[form];   formAddRequest(form,request)         f.submit(); // odeslu   }// zkopiruje dane promenne z jednoho formulare do druheho// fo - zdrojovy formular [string/object]// so - cilovy formular  [string/object]// elementy ke zkopirovani [array]function formsInputCopy(fo,so,par){   //alert(fo+' /// '+so+' // '+par);   if(typeof(fo) == 'object') fform = fo; else fform = document.forms[fo];   if(typeof(so) == 'object') sform = so; else sform = document.forms[so];   val = 0;     for(i in par){      //alert(i+' / '+par[i]+' / '+fform.elements['request'].value);      if(fform.elements[par[i]]){                  val = fform.elements[par[i]].value;         //alert(par[i]+' >  = '+val);         if(sform.elements[par[i]]) sform.elements[par[i]].value = val;         else formAddInputByName(so,par[i],val);      }         }}function ppt(){   var f = document.getElementById('listform');   var d = document.createElement('div');   var l = '';   for(i in f.elements) l += (i+' = '+f.elements[i]+'<br>');   d.innerHTML = l;   document.body.appendChild(d); }function pps(a){   var f = document.forms(a);   var d = document.createElement('div');   var l = '';   for(i in f.elements) l += (i+' = '+f.elements[i]+'<br>');   d.innerHTML = l;   document.body.appendChild(d); }function ppr(f){   d = document.createElement('div');   l = '';   for(i in f.elements) l += (i+' = '+f.elements[i]+'<br>');   d.innerHTML = l;   document.body.appendChild(d); }function formAddRequest(form,request){   f = document.getElementById(form);      formAddInput(form,'request',request)}function formRedirectData(form,page){   f = document.getElementById(form);      if(f) f.action = page;   else f = document.forms[form];   if(f) f.action = page;}function formAddInput(form,name,value){   if(typeof(form) == 'object') f = form;   else f = document.forms[form];      myinp = document.createElement('input');   myinp.name = name;   myinp.type = 'hidden';   myinp.value = value;    f.appendChild(myinp);} function formAddInputByName(form,name,value){   f = document.forms[form];   var ra = document.createElement('input');   ra.name = name;   ra.type = 'hidden';   ra.value = value;    f.appendChild(ra);}// vytori formular a elementyfunction createForm(name,par,elem){   // defaultni parametry   def = {'action':'','enctype':'multipart/form-data','method':'post','onsubmit':'this.submit()'};   myform = document.createElement('form');      // doplneni parametru   if(par == undefined) par = def;   else for(i in def) if(par[i] == undefined) myform[i]=def[i];  else myform[i] = par[i];         // skryjeme   myform.style.display = 'none';   //myform.style.border = '10px solid red';      // elementy formulare   for(i in elem){      formAddInput(myform,i,elem[i])      }       document.body.appendChild(myform);   return myform;} function addCssFile(cssname){      auktiva_cssFile = document.createElement('link');      auktiva_cssFile.setAttribute("rel", "stylesheet");      auktiva_cssFile.setAttribute("media", "screen,projection");      auktiva_cssFile.setAttribute("type", "text/css");      auktiva_cssFile.setAttribute("href", cssname);      document.getElementsByTagName("head")[0].appendChild(auktiva_cssFile);      }function userAlertBox(bhead,bmsg,btype){   if(bhead == undefined) bhead = '';   if(btype == undefined) btype = 0;      if(btype == 99){      bhead = 'Přihlaste se prosím';      bmsg = 'Pro provedení dané operace je potřeba se přihlášit! <br/> <br/> <a href="myaccount.php">Přihlásit se nyní</a>';   }   if(btype == 98){      bhead = 'Chyba';      bmsg = 'Při zpracování požadavku došlo k chybě, pokuste se akci za chvíli zopakovat.';   }   uAlBox = document.createElement('div');      uAlBox.className                      = 'userAlertBox';   if(btype==2 || btype==99 || btype==98) uAlBox.className += ' error';    if(btype==1) uAlBox.className    += ' ok';       uAlBox.closeMe     = function() { document.body.removeChild(this);};   uAlBox.timeout     = setTimeout(function(){uAlBox.closeMe();},3000);   uAlBox.onmouseover   = function() { clearTimeout(uAlBox.timeout); }   uAlBox.onmouseout = function() { this.timeout = setTimeout(function(){uAlBox.closeMe();},3000); }   docmpos = mDocumentPosition;   uAlBox.style.top = docmpos.y + 70 + 'px';      uAlBox_close           = document.createElement('div');   uAlBox_close.className = 'closeButton';   uAlBox_close.box       = uAlBox;   uAlBox_close.onclick   = function(){ this.box.closeMe() };         uAlBox_text            = document.createElement('div');   uAlBox_text.innerHTML += '<h2>'+bhead+'</h2>'+bmsg;       uAlBox.appendChild(uAlBox_close);   uAlBox.appendChild(uAlBox_text);        document.body.appendChild(uAlBox);}function userAlertBoxClose(uAlBox){   if(uAlBox){     uAlBox.closeMe();   }}function watchItem(auctionid,ietime){   $.ajax({    type: "POST",    url: "bgrequest.php",    data: "request=u_watchitem&aid="+auctionid+"&t="+ietime,    success: function(msg){      sucmsg = msg.getElementsByTagName('status')[0].firstChild.data;     if(sucmsg > 0){       userAlertBox('Sledování','Položka byla přidána mezi sledované',1);        } else {            errmsg = msg.getElementsByTagName('error')[0].firstChild.data;       if(errmsg < 0) {          //neprihlaseny          userAlertBox('','',99);       } else {          userAlertBox('','',98);       }     }        }  });}function watchUser(userid){   $.ajax({    type: "POST",    url: "bgrequest.php",    data: "request=u_watchuser&fsid="+userid,    success: function(msg){      sucmsg = msg.getElementsByTagName('status')[0].firstChild.data;     if(sucmsg > 0){       userAlertBox('Sledování','Prodejce byl přidán mezi oblíbené',1);      } else {                                      errmsg = msg.getElementsByTagName('error')[0].firstChild.data;       if(errmsg < 0) {          //neprihlaseny          userAlertBox('','',99);       } else {          userAlertBox('','',98);       }     }        }  });}
