Пасибо за старания проблема решена:
document.write('<div class="corbleft2"><div class="corbright2"><div class="corbcen2"></div></div></div></div><hr />');
document.write('<div id="columnright">');
document.write('<div class="cortleft2"><div class="cortright2"><div class="cortcen2"></div></div></div>');
document.write('<div class="blkwhite1"><h2>Рiзне</h2><center>');
document.write('<a href=img/1_for_');
document.write(location.href.replace(/.*\//, '').charAt(0));
document.write('.png id="thumb1" class="highslide" onclick="return hs.expand(this)"><img src=img/1_for_');
document.write(location.href.replace(/.*\//, '').charAt(0));
document.write('.png></a><br><br>');
document.write('<a href=img/2_for_');
document.write(location.href.replace(/.*\//, '').charAt(0));
document.write('.png id="thumb1" class="highslide" onclick="return hs.expand(this)"><img src=img/2_for_');
document.write(location.href.replace(/.*\//, '').charAt(0));
document.write('.png></a><br><br>');
document.write('<a href=img/3_for_');
document.write(location.href.replace(/.*\//, '').charAt(0));
document.write('.png id="thumb1" class="highslide" onclick="return hs.expand(this)"><img src=img/3_for_');
document.write(location.href.replace(/.*\//, '').charAt(0));
document.write('.png></a><br><br>');
document.write('</center><div class="padt10"></div></div>');