
    var IE = (navigator.appName=="Microsoft Internet Explorer")?true:false;


/*function scale_image() {
        if(IE) {
            screenHeight = document.body.clientHeight;
            screenWidth = document.body.clientWidth-30;
        } else {
            screenHeight = window.innerHeight;
            screenWidth = window.innerWidth-30;
        }
        picture_width = document.getElementById('pic').offsetWidth;
        picture_height = document.getElementById('pic').offsetHeight;

        width_more = screenWidth/picture_width;
        height_more = screenHeight/picture_height;

        alert(width_more+"-"+height_more);

        if(picture_width > screenWidth) {
        if(width_more > height_more) {
        if(picture_width > screenWidth) {
            document.getElementById('pic').style.width = screenWidth+'px';

//            document.getElementById('pic_div').style.width = screenWidth+'px';
//            document.getElementById('pic_bar').style.width = screenWidth+'px';
//            document.getElementById('last_picture').style.width = (screenWidth/4)+'px';
/*
            imgHeight = document.getElementById('pic').offsetHeight;
            prev_logo_height = document.getElementById('last_picture_span').offsetHeight;
            document.getElementById('last_picture').style.paddingTop = (imgHeight/2)-(prev_logo_height/2);
            document.getElementById('last_picture').style.paddingBottom = (imgHeight/2)-(prev_logo_height/2);
            document.getElementById('last_picture').style.height = prev_logo_height+'px';
        }
    }*/

    function scale_image() {
        diawidth = document.getElementById('pic').width;
        diaheight = document.getElementById('pic').height;

        if(IE) {
            heightscreen = document.body.clientHeight-100;
            widthscreen = document.body.clientWidth-400;
        } else {
            heightscreen = window.innerHeight-100;
            widthscreen = window.innerWidth-400;
        }

        if((widthscreen/diawidth) < (heightscreen/diaheight)) {
            if(widthscreen < diawidth) {
                document.getElementById('pic').width = widthscreen;
            }
        } else {
            if(heightscreen < diaheight) {
                document.getElementById('pic').height = heightscreen - 100;
            }
        }
    }

    function scale_news_div() {
       if(IE) {
          widthscreen_total = document.body.clientWidth;
       } else {
          widthscreen_total = window.innerWidth;
       }
       document.getElementById('left_news_box').style.width = (widthscreen_total-670)/2;
    }

    function addbookmark(picture_id,lang_bookmark_name) {
       bookmark_name = window.prompt(lang_bookmark_name);

       if(bookmark_name != null) {
	  ajax_addbookmark(picture_id,bookmark_name);
       }

    }
