
function esky_cities_remove(){
    $('#esky_cities').empty().remove();
    $(document).blur();
}

function esky_cities(mc){
    mc.each(function(){
    $this = mc;
    var c1 = $this.prev().offset();
    //var url = 'qsf_2.0/listaMiast/list1.php?Continent=EU&Country=PL';   
    var title = $this.attr('title');
    var rel_city = $this.attr('rel');
    var scrolling = ($.browser.msie) ? 'yes' : 'auto';
    var scrolling = 'no';
    var txt_close = 'Zamknij';
    
    //$this.click(function(){
      esky_cities_remove();
      var c2 = $this.prev().offset();
      if (c2 == null) {
        c2=c1;
      }
     if (rel_city=='fromcity'){ 
      //alert(c2.top);
      //return false;
      
      $('body')
      .append(
        $('<div></div>')
          .attr('id','esky_cities')
          .css({
            'position':'absolute',
            'width':'170px',
            'background-color':'#F8F8F8',
            'top':(c1.top>0)?c1.top:c2.top,
            'left':(c1.left>0)?c1.left-5:c2.left-50
          })//css
          .append(
            $('<h3></h3>')
              .text(title)
              .append($('<a></a>')
                .attr('href','javascript:void(0);')               
                .text(txt_close)
                .click(esky_cities_remove)
              )
          )
          
          .append(
            $('<div></div>')
              .attr('class','cityList')
              .attr('id','cityList')
              .css({
              'font':'normal 11px Arial,sans-serif'
              })//css
              .append(
              $('<div></div>')
                .css({
                'margin-bottom':'3px',
                'overflow':'hidden',
                'height':'95px',
                'width':'100%',
                'float':'left'
                })//css
                .append(
                $('<table></table>')
                  .attr('cellspacing','0')
                  .attr('cellpadding','0')
                  .css({
                  'color':'#fff',
                  'background':'#0096C8',
                  'text-decoration':'underline',
                  'width':'100%',
                  'height':'100%',
                  'padding-bottom':'2px'
                  })//css
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        .click(cities_aff)
                        .text('Afryka')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//1
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        
                        .click(cities_saf)
                        .text('Ameryka Poludniowa')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//2
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        .click(cities_naf)
                        .text('Ameryka Pólnocna')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//3
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        .click(cities_ocf)
                        .text('Australia i Oceania')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//4
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        .click(cities_asf)
                        .text('Azja')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//5
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        .click(cities_euf)
                        .text('Europa')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//6
                ) 
              )
            )
          .append(
            $('<iframe >')
              .attr('id','esky_cities_frame')
              .attr('src','qsf_2.0/listaMiast/city_fromcity.php?Continent=EU&Country=PL')
              .attr('width',200)
              .attr('height',230)
              .attr('frameborder',0)
              .attr('marginwidth',0)
              .attr('marginheight',0)
              //.attr('allowTransparency','true')
              .css({
                'border':'none',
                'width':'170px',
                //'background':'transparent',
                'background-color':'#F8F8F8',
                'overflow-x':'hidden',
                'overflow-y':'auto',
                'font-weight':'bold'
              })
          )
          .bgIframe()
      );//append
      return false;
      }//fromcity
      
      if (rel_city=='tocity'){       
      $('body')
      .append(
        $('<div></div>')
          .attr('id','esky_cities')
          .css({
            'position':'absolute',
            'width':'170px',
            'background-color':'#F8F8F8',
            'top':(c1.top>0)?c1.top:c2.top,
            'left':(c1.left>0)?c1.left-0:c2.left-50
          })//css
          .append(
            $('<h3></h3>')
              .text(title)
              .append($('<a></a>')
                .attr('href','javascript:void(0);')               
                .text(txt_close)
                .click(esky_cities_remove)
              )
          )
          
          .append(
            $('<div></div>')
              .attr('class','cityList')
              .attr('id','cityList')
              .css({
              'font':'normal 11px Arial,sans-serif'
              })//css
              .append(
              $('<div></div>')
                .css({
                'margin-bottom':'3px',
                'overflow':'hidden',
                'height':'95px',
                'width':'100%',
                'float':'left'
                })//css
                .append(
                $('<table></table>')
                  .attr('cellspacing','0')
                  .attr('cellpadding','0')
                  .css({
                  'color':'#fff',
                  'background':'#0096C8',
                  'text-decoration':'underline',
                  'width':'100%',
                  'height':'100%',
                  'padding-bottom':'2px'
                  })//css
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        .click(cities_aft)
                        .text('Afryka')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//1
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        
                        .click(cities_sat)
                        .text('Ameryka Poludniowa')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//2
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        .click(cities_nat)
                        .text('Ameryka Pólnocna')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//3
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        .click(cities_oct)
                        .text('Australia i Oceania')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//4
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        .click(cities_ast)
                        .text('Azja')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//5
                  .append(
                    $('<tr></tr>')
                      .append(
                      $('<td></td>')
                      .css({
                      'padding':'0 5px 0 5px',
                      })//css
                      .append(
                        $('<a></a>')
                        .attr('class','und')
                        .attr('href','javascript:void(0);')
                        .click(cities_eut)
                        .text('Europa')
                        .css({
                        'text-decoration':'underline',
                        'color':'#fff',
                        'padding':'4px 0px 0px 0px;'
                        })//css
                      )
                    )
                  )//6
                ) 
              )
            )
          .append(
            $('<iframe >')
              .attr('id','esky_cities_frame')
              .attr('src','qsf_2.0/listaMiast/city_tocity.php?Continent=EU&Country=PL')
              .attr('width',200)
              .attr('height',230)
              .attr('frameborder',0)
              .attr('marginwidth',0)
              .attr('marginheight',0)
              //.attr('allowTransparency','true')
              .css({
                'border':'none',
                'width':'170px',
                //'background':'transparent',
                'background-color':'#F8F8F8',
                'overflow-x':'hidden',
                'overflow-y':'auto',
                'font-weight':'bold'
              })
          )
          .bgIframe()
      );//append
      return false;
      }//tocity     
    //}); //onclick
    });
}

function esky_cities_remove() {
  $('#esky_cities').empty().remove();
  $(document).blur();
}
function cities_aff(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_fromcity.php?Continent=AF');
}
function cities_saf(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_fromcity.php?Continent=SA');
}
function cities_naf(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_fromcity.php?Continent=NA');
}
function cities_ocf(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_fromcity.php?Continent=OC');
}
function cities_asf(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_fromcity.php?Continent=AS');
}
function cities_euf(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_fromcity.php?Continent=EU');
}
///////  
function cities_aft(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_tocity.php?Continent=AF');
}
function cities_sat(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_tocity.php?Continent=SA');
}
function cities_nat(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_tocity.php?Continent=NA');
}
function cities_oct(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_tocity.php?Continent=OC');
}
function cities_ast(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_tocity.php?Continent=AS');
}
function cities_eut(){
  document.getElementById('esky_cities_frame').setAttribute('src','qsf_2.0/listaMiast/city_tocity.php?Continent=EU');
}



        
