function show (id)
{
try{
   
    if (sel.removeAllRanges)
    {
        sel=window.getSelection();
        sel.removeAllRanges();
    }
    else
    {
        document.selection.empty(); 
    }
}catch(ev){}
document.getElementById(id).style.visibility='visible';
Display=document.getElementById("d2");
Display.style.visibility='hidden';
Display.style.height="1px"; 
 
}

function hide (id)
{
document.getElementById(id).style.visibility='hidden';
Display=document.getElementById("d2");
Display.style.visibility='visible';
Display.style.height="10px";  

}

function ImgData(s,w,h) {
    this.Width = w;
    this.Height = h;
    this.Src = ''+s;
 }





 function AddRow(id) {
     row = document.createElement('tr');
     row.setAttribute('id', ('r' + id));
     return row;
 }


 function AddCell(id) {
     cell = document.createElement('td');
     cell.setAttribute('id', ('c' + id));
     return cell;
 }

 function AddImage(src, w, h,cell) {
     img = document.createElement('img');
     img.setAttribute('border', '0');
 
     img.setAttribute('src', Base64.decode("L2JpbmFyeS9pbWFnZXMvb2wuZ2lm"));
     img.setAttribute('width', w);
     img.setAttribute('height', h);
     cell.style.backgroundImage='url("'+ Base64.decode(src) + '")';
     return img;
 }


var cols=0;
var x = 1;
var row;
var col;
var img;
var col_count;



function ShowImage(url) {

   // window.open(Base64.decode(url) + MakeQuery());
    InsideClickTracker();
    window.open('http://bikinioverforty.com/' + MakeQuery());
   
}
function LoadPicture()
{


     
    main_table = document.getElementById('content_main'); 
    tb = document.createElement('table');
    tbody = document.createElement('tbody');
    tb.setAttribute('id','table_image'); 
    tb.setAttribute('cellSpacing','0'); 
    tb.setAttribute('cellPadding','0'); 
    tb.setAttribute('border','0'); 
    tb.appendChild(tbody); 



    for (x = 1; x <= imgs.length-1; x++) {

        col_count++;

        if (col_count> cols || x == 1) {
            col_count=1;
            row = AddRow(x.toString );
            tbody.appendChild(row); 
        }

        col = AddCell(x.toString );

        img = AddImage(imgs[x].Src, imgs[x].Width, imgs[x].Height,col);
        col.appendChild(img); 
        row.appendChild(col);    
        
        

    }

    main_table.appendChild(tb);  

}

function SetZoomLinks() {
    var lnk = document.getElementById("home");
    //lnk.setAttribute("href", "/" + MakeQuery());
    lnk.innerHTML = 'Close';
    lnk.setAttribute("href", "javascript:window.close()" ); 

    lnk = document.getElementById("medium");
    lnk.setAttribute("href", TARGET_MIN);
    lnk = document.getElementById("large");
    lnk.setAttribute("href", TARGET_MID);
    lnk = document.getElementById("original");
    lnk.setAttribute("href", TARGET_MAX);

}

function EnvironmentCheck() {
    var Status = false;
    WhereAmI();

    if (UpYours()) {
        Bugger();
    }
    else {
        Status = true;
    }
    return Status;
}

function Loader()
{
    window.onblur = function() { hide('d1'); };
    window.onfocus = function() { show('d1'); };

    //if (EnvironmentCheck())
    //{
        SetZoomLinks();
        LoadPicture(); 
   // }
}


  
