function highlight(field) {
	field.focus();
  	field.select();
}

var bookmarkurl="http://www.eliad.org/"
var bookmarktitle="eliad.org העלאת תמונות"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function imageSizeCap(img, maxWidth, maxHeight)
{
	if(document.all) // Too hard for IE to do math on hidden images
	    img.style.display = 'inline';

	if ($('.img_table').width() < 800) {
	    $('.img_table').width(800);
	}
	
	if((img.height > maxHeight || img.width > maxWidth) && (maxWidth>0 && maxHeight>0)) {
	    $('.text_smallnotice').show();
		img.oldHeight = img.height;
		img.oldWidth = img.width;
		ratio=img.width/img.height;
		if ((maxHeight*ratio)>maxWidth)
		{
			img.width = maxWidth;
			img.height=(maxWidth/ratio);
		} else {
			img.width=(maxHeight*ratio);
			img.height=maxHeight;
		}
		img.newHeight = img.height;
		img.newWidth = img.width;
		if(img.parentNode.nodeName != 'A')
		{
			img.title='Click to view full size image';
			img.onclick=Function ("imageSizeSwap(this)");
			img.style.cursor='pointer';
		}
     }
	img.style.display = 'inline';
}

function imageSizeSwap(img)
{
	if(img.oldHeight && img.oldWidth && img.newHeight && img.newWidth)
	{
		if((img.oldHeight==img.height) && (img.oldWidth==img.width))
		{
		    $('.side_ads').show();
		    $('.text_smallnotice').show();
			img.height = img.newHeight;
			img.width = img.newWidth;
			img.title = 'Click to view full size image';       } else {
            $('.side_ads').hide();
            $('.text_smallnotice').hide();
			img.height = img.oldHeight;
			img.width = img.oldWidth;
			img.title = 'Click to reduce image size';
		}
	}
}