function EstimatedRecipients(CampaignID)
	{
	var Width			= 430;
	var Height			= 400;
	var ReSizeable		= 0;
	var ScrollBars		= 'yes';
	var theURL			= './campaign_popup_estimate.php?CampaignID=' + CampaignID;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=' + ScrollBars + ',menubar=no,resizable=' + ReSizeable + ',location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}
	
function ShowHideItem(WhichID, Ignore)
	{
	if (Ignore == false)
		{
		Item = document.getElementById(WhichID);
	
		if (Item.style.display == 'none')
			{
			Item.style.display = 'block';
			}
		else if (Item.style.display == 'block')
			{
			Item.style.display = 'none';
			}
		else
			{
			Item.style.display = 'none';
			}
		}
	}
	
function SkinPreview()
	{
	var Width			= 650;
	var Height			= 400;
	var theURL			= './help_skinpreview.php';
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=1,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}

function QuickHelpPopUp(WhichModule)
	{
	var Width			= 500;
	var Height			= 400;
	var theURL			= './help_quick.php?Module=' + WhichModule;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=1,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}
	
function HelpPopUpIntegration()
	{
	var Width			= 400;
	var Height			= 350;
	var theURL			= './help_integration.php';
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=0,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}

function PreviewURL(URL)
	{
	var Width			= 600;
	var Height			= 400;
	var theURL			= URL;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=1,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}
	
function EmbedObjectPopUp()
	{
	var Width			= 430;
	var Height			= 450;
	var theURL			= './help_embedobject.php';
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=0,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}

function ShowProcessMessage(LogID)
	{
	var Width			= 350;
	var Height			= 300;
	var theURL			= './stat_process_log_popup.php?LogID=' + LogID;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=0,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}
	
function ClickMemberClicks(CampaignID, CampaignStatisticsID, MemberID, EmailAddress)
	{
	var Width			= 450;
	var Height			= 450;
	var theURL			= './campaign_tracker_linkhistory.php?CampaignID=' + CampaignID + '&CampaignStatisticsID=' + CampaignStatisticsID + '&MemberID=' + MemberID + '&EmailAddress=' + EmailAddress;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=1,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}
	
// START BY NSH
function PreviewNewsletter(NewsletterTemplateID, Method)
	{
	if (Method == 'Email')
		{
		var Width			= 400;
		var Height			= 400;
		var ReSizeable		= 0;
		var ScrollBars		= 'yes';
		}
	else if (Method == 'Browser')
		{
		var Width			= 700;
		var Height			= 450;
		var ReSizeable		= 1;
		var ScrollBars		= 'yes';
		}
	var theURL			= './newsletter_popup_preview.php?Method=' + Method + '&NewsletterTemplateID=' + NewsletterTemplateID;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=' + ScrollBars + ',menubar=no,resizable=' + ReSizeable + ',location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}
// FINISH BY NSH	
function PreviewCampaign(CampaignID, Method)
	{
	if (Method == 'Email')
		{
		var Width			= 430;
		var Height			= 400;
		var ReSizeable		= 0;
		var ScrollBars		= 'yes';
		}
	else if (Method == 'Browser')
		{
		var Width			= 700;
		var Height			= 450;
		var ReSizeable		= 1;
		var ScrollBars		= 'yes';
		}
	var theURL			= './campaign_popup_preview.php?Method=' + Method + '&CampaignID=' + CampaignID;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=' + ScrollBars + ',menubar=no,resizable=' + ReSizeable + ',location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}
	
function DisplayPureTemplate(TemplateID, CampaignID)
	{
	var Width			= 700;
	var Height			= 450;
	var theURL			= './campaign_popup_template.php?CampaignID=' + CampaignID + '&TemplateID=' + TemplateID;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=1,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}
	
function ManageCampaignAttachments(CampaignID)
	{
	var Width			= 450;
	var Height			= 450;
	var theURL			= './campaign_popup_attachments.php?CampaignID=' + CampaignID;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=0,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}

function CalculateEstimatedRecipients(CampaignID)
	{
	var Width			= 400;
	var Height			= 400;
	var theURL			= './help_sendrules_recipients.php?CampaignID=' + CampaignID;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=0,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}

function ReadSendRulesInFactSheetStyle(CampaignID)
	{
	var Width			= 400;
	var Height			= 500;
	var theURL			= './help_sendrules_factsheet.php?CampaignID=' + CampaignID;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=0,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}
	
function CMSPopUp()
	{
	var Width			= 550;
	var Height			= 350;
	var theURL			= './help_cmstemplate.php';
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=0,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}
	
function AutoResponderPopUp(AutoResponderID)
	{
	var Width			= 450;
	var Height			= 450;
	var theURL			= './autoresponder_preview.php?AutoResponderID=' + AutoResponderID;
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=0,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}

function PersonalizationPopUp()
	{
	var Width			= 550;
	var Height			= 450;
	var theURL			= './help_personalize.php';
	var CurrentDate 	= new Date();
		CurrentDate 	= CurrentDate.getTime();
	var winName 		= CurrentDate;
	var features 		= 'scrollbars=yes,menubar=no,resizable=0,location=no,width=' + Width + ',height=' + Height + '';
	OpenPopUp(theURL, winName, features);
	}

function ChangeColor(What, BackColor)
	{
	What.style.backgroundColor = BackColor;
	}

function DisplayActionMessage(PageActionMessage)
	{
	if (PageActionMessage != '')
		{
		alert(PageActionMessage);
		}
	}
	
function OpenPopUp(theURL,winName,features)
	{
	// Ex: features = 'scrollbars=yes,menubar=no,resizable=0,location=no,width=400,height=400';
	window.open(theURL,winName,features);
	}

function GenerateUniqueNumber()
	{
	date = new Date() ;
	return date.getTime() ;
	}

function CheckAllCheckboxes(ownercheckbox,targetcheckbox,formname)
	{	
	var formname  = eval('document.' + formname);
    var elts      = formname.elements[targetcheckbox];

	if (elts != null)
		{
		var elts_cnt  = elts.length;
		var do_check  = true;
		owner_checkbox = formname.elements[ownercheckbox];
	
		if (owner_checkbox.checked == true)
			{
			do_check = true;
			}
		else
			{
			do_check = false;
			}
	
		if (elts_cnt != null)
			{
			for (var i = 0; i < elts_cnt; i++)
				{
				elts[i].checked = do_check;
				} // end for
			}
		else
			{
			elts.checked = do_check;
			}
		}
    return true;
	}

