function changePicture (mainHref, desc, mainWidth, mainHeight) {
    
    var img = '<img src="'+mainHref+'" alt="'+desc.replace(/\"/g, '&quot;')+'" title="'+desc.replace(/\"/g, '&quot;')+'" width="'+mainWidth+'" height="'+mainHeight+'" />';
    document.getElementById ('bighref').innerHTML = img;
    document.getElementById ('imgDescr').innerHTML = desc;
    return false;
}

function change_Picture (link, mainHref, desc, mainWidth, mainHeight, originalWidth, originalHeight) {
    if (link != 'false') {
        document.getElementById ('bighref').onclick = function () {
        	showOriginalPicture( originalWidth, originalHeight, link, desc );
			return false;
        }
    } else {
        document.getElementById ('bighref').onclick = function () {
    		return false;
    	}
    }
    var img = '<img src="'+mainHref+'" alt="'+desc.replace(/\"/g, '&quot;')+'" title="'+desc.replace(/\"/g, '&quot;')+'" width="'+mainWidth+'" height="'+mainHeight+'" />';
    document.getElementById ('bighref').innerHTML = img;
    document.getElementById ('imgDescr').innerHTML = desc;
    return false;
}

function showOriginalPicture( width, height, link, title, alt ) {
	if( width<=0 || height<=0 ) return false;

	var winWidth, winHeight;

	if( Math.ceil(width)>Math.ceil(screen.width*0.8) ) { winWidth = Math.ceil(screen.width*0.8); }
	else { winWidth = Math.ceil(width); }
	if( Math.ceil(height)>Math.ceil(screen.height*0.8) ) { winHeight = Math.ceil(screen.height*0.8); }
	else { winHeight = Math.ceil(height); }

	winParam = 'width='+winWidth+',height='+winHeight+',';
	winParam += 'resizable=yes,';
	if( winWidth<width || winHeight<height ) winParam += 'scrollbars=yes,';
	else winParam += 'scrollbars=no,';
	winParam += 'left='+(screen.width*0.2)+',top='+(screen.height*0.2)+',screenX='+(screen.width*0.2)+',screenY='+(screen.height*0.2)+'';
    myWin = window.open('about:blank', '_blank', winParam);

    myWin.document.open();
    myWin.document.clear();
    try {
    	myWin.document.title = title;
    } catch(e) {/*ie does not support document.title*/}
	myWin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
	myWin.document.write('<html xmlns="http://www.w3.org/1999/xhtml" lang="ru" xml:lang="ru"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />');
    myWin.document.write('<title>'+title+'</title>');
    myWin.document.write('</head><body style="margin:0px;background-color:#ebebeb;text-align:center;">');
    myWin.document.write('<img src="'+link+'" alt="'+alt+'" title="'+alt+'" onclick="window.close()" style="cursor: pointer; cursor: hand;" />');
    myWin.document.write('</body></html>');
    myWin.document.close();
    return false;
}

function initiateReportAbuse () {
	var reportAbuse = document.getElementById( 'reportAbuse' );
	if( typeof reportAbuse!='undefined' && reportAbuse!=null ) {
				if( reportAbuse.style.display!='block' ) {
					reportAbuse.style.display = 'block';
				} else {
					reportAbuse.style.display = 'none';
				}
				return false;
	}
}
