var SepWin;

function OpenSepWin(url, width, height, alt) {

   if (SepWin) SepWin.close();

   if (alt) 

      WinHeight = height+20;

   else{

      alt='';

      WinHeight = height;

   }

      

   SepWin=window.open (url, 'SepWin', 'width='+width+',height='+WinHeight+',resizable=0');

   SepWin.document.open();

   SepWin.document.writeln("<HTML><BODY leftmargin=0 topmargin=0><img src="+url+" width="+width+" height="+height+" border=0><br><center>"+alt+"</center></BODY></HTML>");

   SepWin.document.title = alt;

   SepWin.document.close();

   SepWin.focus();

}



var TTWin;

function OpenTTWin(url, width, height) {

        if (TTWin) TTWin.close();

        TTWin=window.open (url, "TTWin", "width="+width+",height="+height+",resizable=1,scrollbars=1");

        TTWin.focus();

}



var MapWin;

function OpenMap(url, width, height, scroll) {

     if (!scroll) scroll = 0;

     if (MapWin) {MapWin.close();}

     MapWin=window.open (url, "MapWin", "width="+width+",height="+height+",resizable=1, scrollbars="+scroll);

     MapWin.focus();

}





//------- SHORT AJAX LIB -------------

function createRequestObject() {

    var ro;

    var browser = navigator.appName;

    if(browser == 'Microsoft Internet Explorer'){

        ro = new ActiveXObject('Microsoft.XMLHTTP');

    }else{

        ro = new XMLHttpRequest();

    }

    return ro;

}

        

var request = createRequestObject();

var vId;



// nsPrgsBar.enable({deltaTime:50, imgSrc:'/i/loading.gif'});



function Load(id, action) {

    vId = id;

    request.open('get', action, true);

    request.onreadystatechange = handleResponse;

    request.send(null);

}



function handleResponse() {

    if(request.readyState == 4){

      if (request.status == 200){

         var response = request.responseText;

         document.getElementById(vId).innerHTML = response;

//         alert('obj:' + $('vId'))

      }

      else if (request.status == 404)

         alert("Request URL does not exist");

      else

         alert("Error: status code is " + request.status);

    }

}



function click(){
//        window.frames["add_pos"].location.href="top_banner.php";
}


