function addFeaturesWindow(pageID, hostID, featureTypeID, placementTypeID, artistID) {

	var today = new Date();

	var chasm = screen.availWidth;
	var mount = screen.availHeight;

	var w = 660;
	var h = 650;
	
	//init
	var directoryPath = "host";
	
	//exceptions
	if (featureTypeID == 1 || featureTypeID == 2)
		directoryPath = "streaming";
	else if (featureTypeID == 10)
		directoryPath = "ecard";
	else
		directoryPath = "target";

	addFeaturesWindowHandle = null;
	addFeaturesWindowHandle = window.open('/cms/features/' + directoryPath + '/default.aspx?FeatureID=0&ArtistID=' + artistID + '&PageID=' + pageID + '&HostID=' + hostID + '&FeatureTypeID=' + featureTypeID + '&PlacementTypeID=' + placementTypeID + '&rnd=' + today.getTime(),'EditFeatures','resizable,width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=yes');
    if (addFeaturesWindowHandle.blur) addFeaturesWindowHandle.focus();
}

function editFeaturesWindow(pageID, hostID, featureID, featureTypeID, placementTypeID) {

	var today = new Date();

	var chasm = screen.availWidth;
	var mount = screen.availHeight;

	var w = 660;
	var h = 650;
	
	//init
	var directoryPath = "host";
	
	//exceptions
	if (featureTypeID == 1 || featureTypeID == 2)
		directoryPath = "streaming";
	else if (featureTypeID == 10)
		directoryPath = "ecard";
	else
		directoryPath = "target";

	editFeaturesWindowHandle = null;
	editFeaturesWindowHandle = window.open('/cms/features/' + directoryPath + '/default.aspx?PageID=' + pageID + '&HostID=' + hostID + '&FeatureID=' + featureID + '&FeatureTypeID=' + featureTypeID + '&PlacementTypeID=' + placementTypeID + '&rnd=' + today.getTime(),'EditFeatures','resizable,width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=yes');
    if (editFeaturesWindowHandle.blur) editFeaturesWindowHandle.focus();
}

function deleteFeaturesWindow(pageID, hostID, featureID, featureTypeID, placementTypeID) {

	var today = new Date();

	var chasm = screen.availWidth;
	var mount = screen.availHeight;

	var w = 500;
	var h = 180;

	editFeaturesWindowHandle = null;
	editFeaturesWindowHandle = window.open('/cms/features/delete.aspx?PageID=' + pageID + '&HostID=' + hostID + '&FeatureID=' + featureID + '&FeatureTypeID=' + featureTypeID + '&PlacementTypeID=' + placementTypeID + '&rnd=' + today.getTime(),'DeleteFeatures','width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=no');
	if (editFeaturesWindowHandle.blur) editFeaturesWindowHandle.focus();
}

function chooseFeatureTypeWindow(pageID, hostID, placementTypeID) {

	var today = new Date();

	var chasm = screen.availWidth;
	var mount = screen.availHeight;

	var w = 350;
	var h = 200;

	editFeaturesWindowHandle = null;
	editFeaturesWindowHandle = window.open('/cms/featureschooser.aspx?PageID=' + pageID + '&HostID=' + hostID + '&PlacementTypeID=' + placementTypeID + '&rnd=' + today.getTime(),'EditFeatures','resizable,width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=no');
	if (editFeaturesWindowHandle.blur) editFeaturesWindowHandle.focus();
}

function chooseFeatureWindow(pageID, hostID, placementTypeID) {

	var today = new Date();

	var chasm = screen.availWidth;
	var mount = screen.availHeight;

	var w = 450;
	var h = 260;

	editFeaturesWindowHandle = null;
	editFeaturesWindowHandle = window.open('/cms/features/chooser.aspx?PageID=' + pageID + '&HostID=' + hostID + '&PlacementTypeID=' + placementTypeID + '&rnd=' + today.getTime(),'EditFeatures','resizable,width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=no');
	if (editFeaturesWindowHandle.blur) editFeaturesWindowHandle.focus();
}

function editFeatureAlertsWindow(hostID, contentTypeID, isPublished) {

	var today = new Date();

	var chasm = screen.availWidth;
	var mount = screen.availHeight;

	var w = 560;
	var h = 300;

	editAlertsWindowHandle = null;
	editAlertsWindowHandle = window.open('/cms/alerts/default.aspx?IsPublished=' + isPublished + '&ContentTypeID=' + contentTypeID + '&hostID=' + hostID + '&rnd=' + today.getTime(),'EditAlerts','width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5) + ',scrollbars=yes');
	if (editAlertsWindowHandle.blur) editAlertsWindowHandle.focus();
}