// MOVED ALL TO GLOBAL.js 


function photoZoneWindow() {
	var photoZone = window.open("/common/community/photozone/photozone_manage_albums.cfm", "photoZone", "height=700,width=800,resizable=yes,scrollbars=yes,status=yes");
	if (photoZone.focus) {
		photoZone.focus();
	}
}

function photoZoneDetailWindow(groupId, photoId, from) {
	var url = "/common/community/photozone/photozone_view_photos_frameset.cfm?groupId=" + groupId + "&photoId=" + photoId;
	
	if (from && from != "")
	{
		url = url + "&from=" + from;
	}
	
	var photoZone = window.open(url, "photoZone", "height=700,width=800,resizable=yes,scrollbars=yes,status=yes");
	if (photoZone.focus) {
		photoZone.focus();
	}
}

function calendarWindow(url) {
	var calendar = window.open(url, "calendarWindow", "height=700,width=800,resizable=yes,scrollbars=yes,status=yes");
	if (calendar.focus) {
		calendar.focus();
	}
}







function personalizeWindow(url) {
	var personalize = window.open(url, "personalize", "height=600,width=500,resizable=yes,scrollbars=yes,status=yes");
	if (personalize.focus) {
		personalize.focus();
	}
}

function bulletinWindow(url) {
	var bulletin = window.open(url, "bulletinWindow", "height=700,width=700,resizable=yes,scrollbars=yes,status=yes");
	if (bulletin.focus) {
		bulletin.focus();
	}
}

function openChildWindowFull(url) {
	var childFull = window.open(url, "childFullWindow", "height=700,width=800,resizable=yes,scrollbars=yes,status=yes");
	if (childFull.focus) {
		childFull.focus();
	}
}

function openChildWindowHalf(url) {
	var childFull = window.open(url, "childFullWindow", "height=500,width=440,resizable=yes,scrollbars=yes,status=yes");
	if (childFull.focus) {
		childFull.focus();
	}
}


function openChildWindowTool(url) {
	var childTool = window.open(url, "childToolWindow", "height=500,width=600,resizable=yes,scrollbars=yes,status=yes");
	if (childTool.focus) {
		childTool.focus();
	}
}


function openConfirmationLetter(id)
{
	var frag1 = "confirmation_letter.cfm?id=";
	var frag2 = "/common/formzone/get_";
	openStandardWindow(frag2 + frag1 + id);
}




function openStandardWindow(url)
{
	var standardWindow = window.open(url,"standardWindow","location=yes,status=yes,toolbar=yes,menubar=yes,width=800,height=500,resizable=yes,scrollbars=yes");

	if (standardWindow && standardWindow.focus)
		{
		standardWindow.focus();
		}
}


function popWindow(url)
	{
	var specialWindow = window.open(url,"specialWindow","location=yes,status=yes,toolbar=no,menubar=yes,width=660,height=500,resizable=yes,scrollbars=yes");

	if (specialWindow && specialWindow.focus)
		{
		specialWindow.focus();
		}
	}





function loadPageInMainWindow(pageId)
{

	var pageUrl = "/goto/?pageId=" + pageId;

	if (top.opener)
	{
		top.opener.location.href = pageUrl;
		top.opener.focus();
	}
	else
	{
		window.open(pageUrl);
	}

}


function addOnloadEvent(fn)
{

	if(typeof window.addEventListener != 'undefined')
	{
		//.. gecko, safari, konqueror and standard
		window.addEventListener('load', fn, false);
	}
	else if(typeof document.addEventListener != 'undefined')
	{
		//.. opera 7
		document.addEventListener('load', fn, false);
	}
	else if(typeof window.attachEvent != 'undefined')
	{
		//.. win/ie
		window.attachEvent('onload', fn);
	}

}



