function img_blank (link, title, x, y)
{
        width0=700;
        height0=460;

        str='width='+width0+', height='+height0+', left='+x+', top='+y+',dependent=1,resizable=0,menubar=0,toolbar=0,location=0,scrollbars=0,status=0';
        win = window.open('','', str);
        f=win.document;
        //f.open();
        f.write("<html><head><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>");
        f.write("<title>"+title+"</title></head>");
        f.write("<body marginwidth='0' marginheight='0' topmargin='0' bottommargin='0' leftmargin='0' rightmargin='0'>");
        f.write("<img id='image' name='image' src='"+link+"' onLoad='self.resizeTo(document.image.width,document.image.height);'></body></html>");
}

function img_blank_v (link, title, x, y)
{
        width0=460;
        height0=700;

        str='width='+width0+', height='+height0+', left='+x+', top='+y+',dependent=1,resizable=0,menubar=0,toolbar=0,location=0,scrollbars=0,status=0';
        win = window.open('','', str);
        f=win.document;
        f.open();
        f.write("<html><head><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>");
        f.write("<title>"+title+"</title></head>");
        f.write("<body marginwidth='0' marginheight='0' topmargin='0' bottommargin='0' leftmargin='0' rightmargin='0'>");
        f.write("<img id='image' name='image' src='"+link+"' onLoad='self.resizeTo(document.image.width,document.image.height);'></body></html>");
}

var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus)
{
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
win.focus();}

function newImage(arg) {
        if (document.images) {
                rslt = new Image();
                rslt.src = arg;
                return rslt;
        }
}

function changeImages() {
        if (document.images && (preloadFlag == true)) {
                for (var i=0; i<changeImages.arguments.length; i+=2) {
                        document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
                }
        }
}

var preloadFlag = false;
function preloadImages() {
        if (document.images) {
                roll_01_over = newImage("images/roll_01-over.gif");
                roll_02_over = newImage("images/roll_02-over.gif");
                roll_03_over = newImage("images/roll_03-over.gif");
                roll_04_over = newImage("images/roll_04-over.gif");
                roll_05_over = newImage("images/roll_05-over.gif");
                roll_06_over = newImage("images/roll_06-over.gif");
                roll_07_over = newImage("images/roll_07-over.gif");
                roll_08_over = newImage("images/roll_08-over.gif");
                preloadFlag = true;
        }
}

// открытие окна для отображени фотографии
function viewWind(theURL,winName,features) {
        var ScreenWidth=window.screen.width;
        var ScreenHeight=window.screen.height;
        placementx=(ScreenWidth/2)-((600)/2);
        placementy=(ScreenHeight/2)-((600)/2);
        window.open(theURL,winName,features+",left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy);
        return false;
}
