var NS = (document.layers) ? 1 : 0;
var IE = (document.all) ? 1: 0;

function setimglayer ( id, onoff, prefix, extension )
{	if ( typeof extension == "undefined" )
	{	extension = 'gif';
	}
	if ( IE )
	{	document.images[id].src = 'images/'+prefix+'_'+id+'_'+onoff+'.'+extension;
	} else
	{	document.images[id].src = 'images/'+prefix+'_'+id+'_'+onoff+'.'+extension;
	}
}

function sethdrimg ( id, onoff, prefix, extension )
{	if ( typeof extension == "undefined" )
	{	extension = 'gif';
	}
	document.images[id].src = 'images/'+prefix+'_'+id+'_'+onoff+'.'+extension;
}

function setimg ( id, onoff, prefix, extension )
{	if ( typeof extension == "undefined" )
	{	extension = 'gif';
	}
	parent.footer.document.images[id].src = 'images/'+prefix+'_'+id+'_'+onoff+'.'+extension;
}

function openwin (url,width,height)
{ var w = width + 22;
  var h = height + 45;
  if ( IE ) { h = h + 10; }
  zoomwin=open("","zi","width="+w+",height="+h+",status=0,menubar=0,resizable");
  zoomwin.document.write('<html><head><title>Carmin Karasic - Electronic Portfolio</title>');
  zoomwin.document.write('</head>');
  zoomwin.document.write('<body bgcolor=white text=white background="images/greytop.gif">');
  zoomwin.document.write('<table border="0" cellpadding="2" cellspacing="0" width="100%">');
  zoomwin.document.write('<tr><td width="100%" align="center"><table border="1" cellpadding="0" cellspacing="0"><tr><td><img src="'+url+'" BORDER="0" WIDTH="'+width+'" HEIGHT="'+height+'"></td></tr></table></td>');
  zoomwin.document.write('</tr><tr><td width="100%" align="center"><form><div align="center"><center><p><a href="#" onclick="self.close()"><img src="IMAGES/close_button.gif" border="0"></a></p>');
  zoomwin.document.write('</center></div></form></td></tr></table></body></html>');
  zoomwin.focus();
}

function openpage(url,width,height,options)
{	var w = width + 15;
	var h = height + 15;
	var day = new Date();
	var id  = day.getTime();
	if ( IE ) { h = h + 5; }
	eval("page" + id + " = window.open(url,'"+id+"','scrollbars=1,statusbar=0,resizable,width="+w+",height="+h+options+"');");
}

function openaboutpage(url,width,height,options)
{	var w = width + 15;
	var h = height + 15;
	var day = new Date();
	var id  = day.getTime();
	if ( IE ) { h = h + 5; }
	eval("page" + id + " = window.open(url,'"+id+"','menubar=1,scrollbars=1,statusbar=0,resizable,width="+w+",height="+h+options+"');");
}

