function UpdateCampaignInstantStats(Seconds)
	{
	var PassParameter = '';
	
	if (InstantCampaignStatsIDs.length > 0)
		{
		makeRequest('./campaign_instantstats.php', 'Action=GetXML&CampaignIDs=' + InstantCampaignStatsIDs.join(','), 'SuccessCampaignInstantStats');
		}

	setTimeout("UpdateCampaignInstantStats(" + Seconds + ")", Seconds * 1000);
	}

function SuccessCampaignInstantStats(ResultContent)
	{
	var XMLDoc = ResultContent.documentElement;
	var xRows = XMLDoc.getElementsByTagName('Entry');

	var TotalCampaigns = xRows.length;

	for (TMPCounter = 0; TMPCounter < xRows.length; TMPCounter++)
		{
		if (xRows[TMPCounter] != null)
			{
			var CampaignID				= xRows[TMPCounter].childNodes[0].firstChild.nodeValue;	
			var TotalRecipients			= xRows[TMPCounter].childNodes[1].firstChild.nodeValue;	
			var Unsubscriptions			= xRows[TMPCounter].childNodes[2].firstChild.nodeValue;	
			var UnsubscriptionsPercent	= xRows[TMPCounter].childNodes[3].firstChild.nodeValue;	
			var Sent					= xRows[TMPCounter].childNodes[4].firstChild.nodeValue;	
			var Failed					= xRows[TMPCounter].childNodes[5].firstChild.nodeValue;	
			var Bounce					= xRows[TMPCounter].childNodes[6].firstChild.nodeValue;	
			var BouncePercent			= xRows[TMPCounter].childNodes[7].firstChild.nodeValue;	
			var Open					= xRows[TMPCounter].childNodes[8].firstChild.nodeValue;	
			var OpenPercent				= xRows[TMPCounter].childNodes[9].firstChild.nodeValue;	
			var Hard					= xRows[TMPCounter].childNodes[10].firstChild.nodeValue;	
			var Soft					= xRows[TMPCounter].childNodes[11].firstChild.nodeValue;	
			var UnsubscriptionsImage	= xRows[TMPCounter].childNodes[12].firstChild.nodeValue;	
			var SentImage				= xRows[TMPCounter].childNodes[13].firstChild.nodeValue;	
			var FailedImage				= xRows[TMPCounter].childNodes[14].firstChild.nodeValue;	
			var BounceImage				= xRows[TMPCounter].childNodes[15].firstChild.nodeValue;	
			var OpenImage				= xRows[TMPCounter].childNodes[16].firstChild.nodeValue;	
			var HardImage				= xRows[TMPCounter].childNodes[17].firstChild.nodeValue;	
			var SoftImage				= xRows[TMPCounter].childNodes[18].firstChild.nodeValue;	

			if (document.getElementById(CampaignID + '_Recipients') != null)
				{
				document.getElementById(CampaignID + '_Recipients').firstChild.nodeValue = TotalRecipients;
				document.getElementById(CampaignID + '_Unsubscriptions').firstChild.nodeValue = Unsubscriptions;
				document.getElementById(CampaignID + '_UnsubscriptionsPercent').firstChild.nodeValue = UnsubscriptionsPercent;
				document.getElementById(CampaignID + '_Sent').firstChild.nodeValue = Sent;
				document.getElementById(CampaignID + '_Failed').firstChild.nodeValue = Failed;
				document.getElementById(CampaignID + '_Bounce').firstChild.nodeValue = Bounce;
				document.getElementById(CampaignID + '_BouncePercent').firstChild.nodeValue = BouncePercent;
				document.getElementById(CampaignID + '_Open').firstChild.nodeValue = Open;
				document.getElementById(CampaignID + '_OpenPercent').firstChild.nodeValue = OpenPercent;
				document.getElementById(CampaignID + '_Hard').firstChild.nodeValue = Hard;
				document.getElementById(CampaignID + '_Soft').firstChild.nodeValue = Soft;
				document.getElementById(CampaignID + '_UnsubscriptionsImage').width = UnsubscriptionsImage;
				document.getElementById(CampaignID + '_SentImage').width = SentImage;
				document.getElementById(CampaignID + '_FailedImage').width = FailedImage;
				document.getElementById(CampaignID + '_BounceImage').width = BounceImage;
				document.getElementById(CampaignID + '_OpenImage').width = OpenImage;
				document.getElementById(CampaignID + '_HardImage').width = HardImage;
				document.getElementById(CampaignID + '_SoftImage').width = SoftImage;
				}
			}
		}
		
	return;	
	}

function DisplayCampaignInstantStats(CampaignID, DefaultText)
	{
	var ElementID	= "InstantStats" + CampaignID;
	var Element		= document.getElementById(ElementID);
	
	if (Element.style.display == 'none')
		{
		Element.style.display	= '';
		makeRequestInsertResult('./campaign_instantstats.php', 'Action=RetrieveInstantStats&CampaignID=' + CampaignID, Element);
		
		InstantCampaignStatsIDs[InstantCampaignStatsIDs.length] = CampaignID;
		}
	else
		{
		Element.style.display	= 'none';
		Element.innerHTML		= DefaultText;
		
		var NewArray = Array();
		
		TMPCounter2 = 0;
		for (TMPCounter = 0; TMPCounter<InstantCampaignStatsIDs.length; TMPCounter++)
			{
			if (InstantCampaignStatsIDs[TMPCounter] != CampaignID)
				{
				NewArray[TMPCounter2] = InstantCampaignStatsIDs[TMPCounter];
				
				TMPCounter2++;
				}
			}
		
		InstantCampaignStatsIDs = NewArray;
		NewArray = '';
		}
	
	return;
	}

function DeleteConfirmDirect(ButtonID, ButtonValue, FormID, Message)
	{
	var Result = confirm(Message);
			
	if (Result == true)
		{

		document.getElementById(ButtonID).value = ButtonValue;
		document.getElementById(FormID).submit();
		}

	return;
	}
	
function DeleteConfirm(ArrayOptions, OptionListID, ButtonID, ButtonValue, FormID, Message)
	{
	var IsOptionCorrect = false;
	
	for (TMPCounter = 0; TMPCounter < ArrayOptions.length; TMPCounter++)
		{
		if (document.getElementById(OptionListID).value == ArrayOptions[TMPCounter])
			{
			IsOptionCorrect = true;
			
			var Result = confirm(Message);
			
			if (Result == true)
				{
				document.getElementById(ButtonID).value = ButtonValue;
				document.getElementById(FormID).submit();
				}
			}
		}

	if ((IsOptionCorrect == false) && (Result == null))
		{
		document.getElementById(ButtonID).value = ButtonValue;
		document.getElementById(FormID).submit();
		}
		
	return;
	}

function CompareCharacterSets(PageCharacterSet, SelectedCharacterSet, ErrorMessage)
	{
	var OriginalSelectedCharacterSet = SelectedCharacterSet.value;
		SelectedCharacterSet = OriginalSelectedCharacterSet.substring(0, OriginalSelectedCharacterSet.length - 5);

	if (PageCharacterSet != SelectedCharacterSet)
		{
		var Result = confirm(ErrorMessage);

		if (Result == true)
			{
			window.location = window.location.href + '?&' + 'ChangeCharSetTo=' + OriginalSelectedCharacterSet;
			}
		}
	}
function SystemEmailLinkClickedMembers(AutoResponderID, EmailID, Link, LinkName)
	{
	var Width			= 450;
	var Height			= 450;
	var theURL			= './stat_clickedmemberhistory.php?AutoResponderID=' + AutoResponderID + '&EmailID=' + EmailID + '&Link=' + Link + '&LinkName=' + LinkName;
	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 SystemEmailClickMemberClicks(AutoResponderID, EmailID, MemberID, EmailAddress)
	{
	var Width			= 450;
	var Height			= 450;
	var theURL			= './stat_linkhistory.php?AutoResponderID=' + AutoResponderID + '&EmailID=' + EmailID + '&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);
	}

function SystemEmailMemberOpenHistory(AutoResponderID, EmailID, MemberID, EmailAddress)
	{
	var Width			= 450;
	var Height			= 450;
	var theURL			= './stat_openhistory.php?AutoResponderID=' + AutoResponderID + '&EmailID=' + EmailID + '&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);
	}

function SetTimerForSendLimitTracker(Seconds)
	{
	makeRequest('./connector.php', 'FormValue_Action=RetrieveSendLimitStats', 'SuccessSendLimitTracker');			
	
	setTimeout("SetTimerForSendLimitTracker(" + Seconds + ")", Seconds * 1000);
	}

function SuccessSendLimitTracker(ResultContent)
	{
	var XMLDoc = ResultContent.documentElement;
	var xRows = XMLDoc.getElementsByTagName('Entry');

	var TotalQuota				= xRows[0].childNodes[0].firstChild.nodeValue;	
	var TotalQuotaInterval		= xRows[0].childNodes[1].firstChild.nodeValue;	
	var TotalUsedQuota			= xRows[0].childNodes[2].firstChild.nodeValue;	
	var TotalUsedPercentQuota	= xRows[0].childNodes[3].firstChild.nodeValue;	
	var AllowedDays				= xRows[0].childNodes[4].firstChild.nodeValue;	
	var AllowedStartHour		= xRows[0].childNodes[5].firstChild.nodeValue;	
	var AllowedFinishHour		= xRows[0].childNodes[6].firstChild.nodeValue;	

	if (document.getElementById('TotalQuotaAmount') != null)
		{
		document.getElementById('TotalQuota').firstChild.nodeValue = TotalQuota;
		document.getElementById('TotalQuotaInterval').firstChild.nodeValue = TotalQuotaInterval;
		document.getElementById('TotalUsedQuota').firstChild.nodeValue = TotalUsedQuota;
		document.getElementById('TotalUsedPercentQuota').firstChild.nodeValue = TotalUsedPercentQuota;
		}

	if (document.getElementById('TotalQuotaTime') != null)
		{
		document.getElementById('AllowedDays').firstChild.nodeValue = AllowedDays;
		document.getElementById('AllowedStartHour').firstChild.nodeValue = AllowedStartHour;
		document.getElementById('AllowedFinishHour').firstChild.nodeValue = AllowedFinishHour;
		}

	return;
	}

function CampaignBandwidth(CampaignID)
	{
	var Width			= 450;
	var Height			= 450;
	var theURL			= './campaign_bandwidth.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 CampaignSpamRating(CampaignID)
	{
	var Width			= 450;
	var Height			= 450;
	var theURL			= './campaign_spamrating.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 MemberOpenHistory(CampaignID, CampaignStatisticsID, MemberID, EmailAddress)
	{
	var Width			= 450;
	var Height			= 450;
	var theURL			= './campaign_tracker_openhistory.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);
	}

function ManageAutoResponderAttachments(AutoResponderID)
	{
	var Width			= 450;
	var Height			= 450;
	var theURL			= './autoresponder_popup_attachments.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 LinkClickedMembers(CampaignID, CampaignStatisticsID, Link, LinkName)
	{
	var Width			= 450;
	var Height			= 450;
	var theURL			= './campaign_tracker_clickedmemberhistory.php?CampaignID=' + CampaignID + '&CampaignStatisticsID=' + CampaignStatisticsID + '&Link=' + Link + '&LinkName=' + LinkName;
	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 NewsReader(NewsID)
	{
	var Width			= 550;
	var Height			= 350;
	var theURL			= './news_reader.php?NewsID=' + NewsID;
	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 CreateLabel(FormID, Message1)
	{
	var NewLabelName = prompt(Message1, '');

	if ((NewLabelName != null) && (NewLabelName != ''))
		{
		document.getElementById('FormValue_AddNewLabel').value = NewLabelName;
		document.getElementById(FormID).submit();
//		window.location.href = './campaign_browse.php?NewLabelName=' + NewLabelName + '&SelectedCampaigns=' + SelectedCampaigns;
		}
	
	return;
	}
	
function RemoveLabel()
	{
	}
	
function FollowUpIntervalCalculator()
	{
	var Width			= 550;
	var Height			= 350;
	var theURL			= './help_followupinterval.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 ForceReturnPathPopUp()
	{
	var Width			= 550;
	var Height			= 350;
	var theURL			= './help_forcereturnpath.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 EstimatedRecipients(CampaignID)
	{
	var Width			= 400;
	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 = '';
			}
		else if (Item.style.display == '')
			{
			Item.style.display = 'none';
			}
		else
			{
			Item.style.display = 'none';
			}
		}
	}

function ShowHideItemBasedOnClick(WhichID, Display)
	{
	Item = document.getElementById(WhichID);

	if (Display == true)
		{
		Item.style.display = '';
		}
	else if (Display == false)
		{
		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			= 400;
	var Height			= 350;
	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);
	}
	
function PreviewCampaign(CampaignID, 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			= './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			= 400;
	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			= 350;
	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)
	{
	if (What != null)
		{
		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;
	}

// This method is using for custom field mapping in member_export_vcard.php file - STARTED
function markAsReleatedField(_target , _fill)
	{
		document.getElementById(_target).value=_fill;
		document.getElementById(_target).checked=true;
	}
// This method is using for custom field mapping in member_export_vcard.php file - FINISHED

// Ajax Engine - START
function makeRequest(url, params, onLoadFunction) {

        var http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = function() { alertContents(http_request, onLoadFunction); };
        http_request.open('POST', url, true);
		http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http_request.send(params);

    }

function makeRequestInsertResult(url, params, element) {

        var http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }

		var ReturnText = "";
        http_request.onreadystatechange = function() { alertContentsInnerHTML(http_request, element); };
        http_request.open('POST', url, true);
		http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http_request.send(params);
    }

    function alertContents(http_request, onLoadFunction) {
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
                eval(onLoadFunction+'(http_request.responseXML)');
            } else {
//                alert('An error occured while trying to connect to your server. Click OK to continue.');
            }
        }


    }

    function alertContentsInnerHTML(http_request, element) {
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
				element.innerHTML = http_request.responseText;
            } else {
//                alert('An error occured while trying to connect to your server. Click OK to continue.');
            }
        }
    }

// Ajax Engine - FINISH