try{document.execCommand('BackgroundImageCache', false, true);}catch(e){}
function shht(id){el1 = document.getElementById(id);el2 = document.getElementById(id+'_hidden');if(el1.style.display==''){el1.style.display='none';el2.style.display='';}else{el1.style.display='';el2.style.display='none';}return false;}
function redirect(url){window.location=url;}
function newwindow(selection,w,h){l=(screen.availWidth-w)/2;t=(screen.availHeight-h)/2;window.open(selection,'_blank','height='+h+',width='+w+',scrollbars=yes,left='+l+',top='+t+',resizable=yes');return false;}
function newwindow2(selection,w,h){l=(screen.availWidth-w)/2;t=(screen.availHeight-h)/2;window.open(selection,'_blank','height='+h+',width='+w+',scrollbars=no,left='+l+',top='+t+',resizable=yes');return false;}
function replyTo(id)
{	if(id==0)
	{		document.getElementById('addComment').appendChild(document.getElementById('commentForm'));
		document.getElementById('commentFormTitle').innerHTML=langAddComment;
	}
	else
	{		document.getElementById('replyTo'+id).appendChild(document.getElementById('commentForm'));
		document.getElementById('commentFormTitle').innerHTML=langReplyFor;
	}	document.getElementById('replyTo').value=id;
}

function rand(min, max)
{
	if( max ) {
		return Math.floor(Math.random() * (max - min + 1)) + min;
	} else {
		return Math.floor(Math.random() * (min + 1));
	}
}
function topWorksReload(last)
{
	for(i=1;i<=4;i++)
	{
		if (works[i])
		{
			if (last) {
				id = 0;
			} else {
				id = rand(0, works[i].length-1);
			}
			document.getElementById('shot'+i).innerHTML = '<a href="'+sitePath+'portfolio/work/'+works[i][id]+'"><img src="'+sitePath+'images/portfolio/top/'+works[i][id]+'.jpg" width="195" height="190" border="0" alt="" /></a>';
		}
	}
}

