function resizeMe()
{
	window.resizeTo(480, document.images("imgPhoto").height + 420);
}
				
function popTellEP(eventId, photoId)
{
	var url = "../pops/tell_a_friend.aspx?eventId=" + eventId + "&photoId=" + photoId;
	
	var friend_window = window.open(url, "friend_window", "width=480,height=665,left=50,top=20,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
	if (friend_window != null) { friend_window.focus(); }
}

function popTellE(eventId)
{
	var url = "../pops/tell_a_friend.aspx?eventId=" + eventId;
	
	var friend_window = window.open(url, "friend_window", "width=480,height=665,left=50,top=20,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
	if (friend_window != null) { friend_window.focus(); }
}

function popTell()
{
	var url = "../pops/tell_a_friend.aspx";
	
	var friend_window = window.open(url, "friend_window", "width=480,height=665,left=50,top=20,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
	if (friend_window != null) { friend_window.focus(); }
}

function popTellEFromRoot(eventId)
{
    var args = popTellEFromRoot.arguments;
    var urlPrefix = (args.length > 1 ? args[1] : '');
	var url = urlPrefix + "pops/tell_a_friend.aspx?eventId=" + eventId;
	
	var friend_window = window.open(url, "friend_window", "width=480,height=755,left=50,top=20,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
	if (friend_window != null) { friend_window.focus(); }
}

function popTellFromRoot()
{
    var args = popTellFromRoot.arguments;
    var urlPrefix = (args.length > 0 ? args[0] : '');
	var url = urlPrefix + "pops/tell_a_friend.aspx";

	var friend_window = window.open(url, "friend_window", "width=480,height=665,left=50,top=20,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
	if (friend_window != null) { friend_window.focus(); }
}

function popInfo(infoId)
{
	var url = "../pops/info.aspx?infoId=" + infoId;
	
	var info_window = window.open(url, "info_window", "width=480,height=675,left=150,top=20,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
	if (info_window != null) { info_window.focus(); }
}

function popInfoFromRoot(infoId)
{
	var url = "pops/info.aspx?infoId=" + infoId;
	
	var info_window = window.open(url, "info_window", "width=480,height=675,left=150,top=20,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
	if (info_window != null) { info_window.focus(); }
}

function popPhoto(eventId, photoId)
{
    var args = popPhoto.arguments;
    var urlPrefix = (args.length > 2 ? args[2] : '');
	var url = urlPrefix + "pops/photo_detail.aspx?eventId=" + eventId + "&photoId=" + photoId;

	var photo_window = window.open(url, "photo_window", "width=480,height=665,left=50,top=20,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
	if (photo_window != null) { photo_window.focus(); }
}

function valEmail(sender, args)
{
	if (args.Value != "") // required field validator must take care of blank field
	{
		var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
		var regex = new RegExp(emailReg);
	
		args.IsValid = regex.test(args.Value);
		return;	
	}
	
	args.IsValid = true;
	return;
}

function valOptIn(sender, args)
{
	if (args.Value == false) // required field validator must take care of blank field
	{
		args.IsValid = false;
		return;		
	}
	
	args.IsValid = true;
	return;
}


