<!--
function confirmCustom(msg,url)
{
	approve = confirm(msg);

	if (approve)
	{
		window.location = url;
	}
}

function checkEmpty(entered, alertbox)
{
	with (entered)
	{
		if (value==null || value=="")
			{
			if (alertbox!="") 
				{
					alert(alertbox);
				} 
			return false;
			}
		else
			{
				return true;
			}
	}
} 

function bigImage(imageURL)
	{
	var win= null;
	var winl = (screen.width-500)/2;
	var wint = (screen.height-500)/2;

	PositionX = winl;
	PositionY = wint;

	defaultWidth  = 500;
	defaultHeight = 500;

	if (parseInt(navigator.appVersion.charAt(0))>=4)
		{
			var isNN=(navigator.appName=="Netscape")?1:0;
			var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
		}

	var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
	var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

	if (isNN)
		{
			imgWin=window.open('about:blank','',optNN);
		}
	if (isIE)
		{
			imgWin=window.open('about:blank','',optIE);
		}

	with (imgWin.document)
		{
			writeln('<html><head><title>Project Image</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
			writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
			writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
			writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
			writeln('width=100-(document.body.clientWidth-document.images[0].width);');
			writeln('height=100-(document.body.clientHeight-document.images[0].height);');
			writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
			writeln('window.innerWidth=document.images["thisImg"].width;');writeln('window.innerHeight=document.images["thisImg"].height;}}');
			writeln('</sc'+'ript>');
			writeln('<meta http-equiv="imagetoolbar" content="false" />');
			writeln('</head><body bgcolor=426194 scroll="no" onload="reSizeToImage(); self.focus()">');
			writeln('<a href="javascript:window.close()"><img name="thisImg" src="http://halcoportfolio.com/project_images/'+imageURL+'" style="display:block; border: 0;"></a></body></html>');
			close();
		}
	}

function swapImage(p_id,img_id,default_switch)
{
	document.getElementById('defaultImage').src = "../project_images/" + p_id + "_" + img_id + "_176.jpg";
	document.getElementById('defaultLink').href = "javascript:bigImage('" + p_id + "_" + img_id + "_full.jpg')";
	document.getElementById('deleteLink').href = "javascript:confirmCustom(\'Are you sure you want to delete this image?\',\'gallery.php?action=delete&p_id=" + p_id + "&img_id=" + img_id + "\')";
	document.getElementById('changeDefault').img_id.value = img_id;
	
	if (default_switch == 1)
	{
		document.getElementById('changeDefault').defaultSwitcher.disabled = true;
		document.getElementById('changeDefault').defaultSwitcher.checked = true;
	}
	else
	{
		document.getElementById('changeDefault').defaultSwitcher.disabled = false;
		document.getElementById('changeDefault').defaultSwitcher.checked = false;
	}
}

function swapImg(p_id,img_id)
{
	document.getElementById('defaultImage').src = "../project_images/" + p_id + "_" + img_id + "_176.jpg";
	document.getElementById('defaultLink').href = "javascript:bigImage('" + p_id + "_" + img_id + "_full.jpg')";
}

//-->