var gDataChg=0;
var gSelectedColor;
var gSelectedImage;
var gSelectedImageAlign;
var gImageXtras=0;
var gPopupTaskText;
var gTargetField;
var gColorField;
var gImageField;
var gTextAreaField;
var gTextAreaContents;
var gSiteType;
var ginclude="";
// setup task/help text arrays
var popupcolortext = new Array (
	"Please select a background color from the colors shown below by clicking on the desired color.",
	"Please select a text color from the colors shown below by clicking on the desired color.",
	"Please select a shadow color from the colors shown below by clicking on the desired color.",
	"Please select a border color from the colors shown below by clicking on the desired color.",
	"Please select a link normal color from the colors shown below by clicking on the desired color.",
	"Please select a link hover over color from the colors shown below by clicking on the desired color.",
	"Please select a link visited color from the colors shown below by clicking on the desired color."
);
var popupimagetext = new Array (
	"Please select the background image from the files shown below by clicking on an image link. You may also upload your own image. Only .JPG or .GIF files will be accepted. Note that there is a storage limitation " + gmaxuserimagesize + "K for the total of uploaded image storage. Please do not upload files larger than 60K as they will take a lot of time.",
	"Please select the graphic image from the files shown below by clicking on an image link. You may also upload your own image. Only .JPG or .GIF files will be accepted. Note that there is a storage limitation " + gmaxuserimagesize + "K for the total of uploaded image storage. Please do not upload files larger than 60K as they will take a lot of time.",
	"Please select the photo image from the files shown below by clicking on an image link. You may also upload your own image. Only .JPG photos will be accepted. Note that there is a storage limitation " + gmaxuserphotosize + "K for the total of uploaded photo storage. Please do not upload files larger than 60K as they will take a lot of time."
);
// setup task/help text arrays
var taskdefault="Select and area to modify from the dropdown list above. Modify the the area's settings on the left. Save your modifications by clicking the Save button above. If there are multiple items to select in an area, you may select them using a dropdown to the left. You may also delete selected area items by clicking the Delete button above. Finally, you may preview the changes to your site by clicking the Preview button above or reset your site to the default font, color & text settings by clicking the Defaults button above."
var tasktext1 = new Array (
	"Enter a User ID. This ID should be lower case, and contain only numbers and letters with NO spaces. This ID will be used to identify your account and in the address for your site on the web. This field is required.",
	"Enter your Email address. The Email address is how we will contact you about your account. This field is required.",
	"Enter your account password. The password should be lower case, and contain only numbers and letters with NO spaces. Use at least six characters. This field is required.",
	"Enter your account First Name. This field is required.",
	"Enter your account Last Name. This field is required.",
	"Enter your account residence address line #1. This field is required.",
	"Enter your account residence address line #2. This field is optional.",
	"Enter your account residence city. This field is required.",
	"Enter your account residence state or provence. This field is required.",
	"Enter your account residence zip code. This field is required.",
	"Enter your account residence phone number. This field is optional.",
	"Enter your account site type. Managed Hosting provides for complete site management for content, colors, and framew0rk. User Uploaded provides for user uploading and management of the site and disables all hosted management functions.",
	"Enter your account account type. This is the site's billing cycle.",
	"Enter the account expiration date (mm/dd/yyyy). This field is required.",
	"Enter the any account comments. This field is optional.",
	"Check to enable the account. This field is optional."
);
var tasktext11 = new Array (
	"Select a User Defined Page to modify or select 'Add New Item' to create a new item. You may also click the 'Delete' button to remove and existing selected item. Items entered here will only show in preview mode.",
	"Enter the User Defined Page button text for your site. This field is optional. You will only see this button in preview mode.",
	"Enter the User Defined Page heading text for your site. This text is shown in the heading of the Announcements page (see Heading in the content area at the right). This field is optional. You will only see this text in preview mode while viewing the Announcements page.",
	"Select the User Defined Page password enable status for your site. This will enable or disable the User Page password. This field is optional.",
	"Enter the User Defined Page password your site. This password will be used to enable viewing of the User Page and is case sensitive. This field is optional.",
	"Enter a posted date for this page. The posted date must be a valid date formatted as: 'MM/DD/YYYY' and will be used to sort the pages and buttons when displayed on the site. This text will only show in preview mode. This field is required.",
	"Enter the content heading text for this item. The content heading text will be displayed above the content when displayed on the site. This text will only show in preview mode. This field is required.",
	"Enter the content text for this item. The content text will be the main descriptive text for this item when displayed on the site. Note that simple HTML tags like anchors, fonts, etc. are supported. You may click the 'Open Editor' button to preview, create, and modify custom HTML content. This text will only show in preview mode. This field is required.",
	"Enter a web site or email url link. This text must be formatted as 'http://www.yoursite.com', 'mailto:yourmail@yourdomain.com', or 'yourfile.pdf' in order to work. This text is a link and will not display on the site if text is entered in the field below. This field is optional.",
	"Enter the text to be displayed for the link defined in the field above. This text will be displayed for the link and can be the same as the actual link text. This text will only show in preview mode. This field is optional.",
	"Select a content image. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode while viewing the site page.",
	"Select the image alignment. This field is optional. You will only see the image in preview mode while viewing the site page."
);
var tasktext12 = new Array (
	"You may manage the files for your site. If you are uploading your site, you must have a main page named 'index.htm' or 'default.htm' which is the start page for your site. To access your uploaded images within your pages, use a relative path of 'images\\imagename.jpg'. To access your uploaded photos within your pages, use a relative path of 'photos\\photoname.jpg'. To access uploaded files, use a relative path of 'yourfile.pdf'. These relative paths are examples. Note that there is a client storage limitation of " + gmaxusersitesize + "K for uploaded files, " + gmaxuserimagesize + "K for uploaded images, and " + gmaxuserphotosize + "K for uploaded photos."
);
var tasktext13 = new Array (
	"Enter the client's User ID. This ID should be lower case, and contain only numbers and letters with NO spaces. This ID will be used to identify and access the account. This field is required.",
	"Enter the client's Email address. This field is required.",
	"Enter the client's password. The password should be lower case, and contain only numbers and letters with NO spaces. Use at least six characters. This field is required.",
	"Enter the client's First Name. This field is required.",
	"Enter the client's Last Name. This field is required.",
	"Enter the client's residence address line #1. This field is required.",
	"Enter the client's residence address line #2. This field is optional.",
	"Enter the client's residence city. This field is required.",
	"Enter the client's residence state or provence. This field is required.",
	"Enter the client's residence zip code. This field is required.",
	"Enter the client's residence phone number. This field is optional.",
	"Enter the client's site type. Managed Hosting provides for complete site management for content, colors, and framework. User Uploaded provides for user uploading and management of the site and disables all hosted management functions.",
	"Enter the client's account type. This is the site's billing cycle.",
	"Enter the client's expiration date (mm/dd/yyyy). This field is required.",
	"Enter the client's account comments. This field is optional.",
	"Check to enable the account. This field is optional."
);
var tasktext14 = new Array (
	"Select an image to view from the files shown below by clicking on an image link. You may also upload images. Note that there is a client storage limitation for the total of uploaded image storage."
);
var tasktext2 = new Array (
	"Enter the web site title for your site. This will be displayed in the browser title bar when viewing the site. This field is required.",
	"Enter the navigation layout style for your site. The lower right style window will reflect your selection. This field is optional.",
	"Select the page background color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Select the page background image for your site. You may select an image or upload an image by clicking the Select button. This field is optional.",
	"Enter the page footer link text size for your site. Size is measured in 'Points'. This field is required.",
	"Select the page footer link normal color for your site. This color is the normal text color for the link. You may select a color by clicking the Select button. This field is optional.",
	"Select the page footer link hover color for your site. This text color is used when you hover over the link with the mouse pointer. You may select a color by clicking the Select button. This field is optional.",
	"Select the page footer link visited color for your site. This text color is used when you have visited the link. You may select a color by clicking the Select button. This field is optional.",
	"Select the page footer link bold attribute for your site. This field is optional.",
	"Select the page footer link italic attribute for your site. This field is optional.",
	"Select the page footer link underline attribute for your site. This field is optional."
);
var tasktext3 = new Array (
	"Select the heading background color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Select the heading text color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Enter the heading text for your site. You may leave this blank if you intend to use a heading graphic only. This field is optional. You will only see this text in preview mode.",
	"Enter the heading text size for your site. Size is measured in 'Points'. This field is required.",
	"Select the heading text bold attribute for your site. This field is optional.",
	"Select the heading text italic attribute for your site. This field is optional.",
	"Select the heading text shadow attribute for your site. This field is optional.",
	"Select the heading text shadow color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Select the heading sub-text color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Enter the heading sub-text for your site. This field is optional. You will only see this text in preview mode.",
	"Enter the heading sub-text size for your site. Size is measured in 'Points'. This field is required.",
	"Select the heading sub-text bold attribute for your site. This field is optional.",
	"Select the heading sub-text italic attribute for your site. This field is optional.",
	"Select the heading sub-text shadow attribute for your site. This field is optional.",
	"Select the heading sub-text shadow color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Select the heading page alignment for your site. This field is optional.",
	"Select the heading border style for your site. Note that not all browsers display this setting exactly the same. This field is optional.",
	"Select the heading border color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Enter the heading border width for your site. Size is measured in 'Pixels'. This field is optional.",
	"Select the left side header image for your site. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode.",
	"Select the right side header image for your site. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode."
);
var tasktext4 = new Array (
	"Enter the Announcements button text for your site. This text is shown in the first navigation button (see NAV1 at the right). This field is optional. You will only see this text in preview mode.",
	"Enter the Announcements heading text for your site. This text is shown in the heading of the Announcements page (see Heading in the content area at the right). This field is optional. You will only see this text in preview mode while viewing the Announcements page.",
	"Select the Announcements button enable status for your site. This will enable or disable the Announcements page and button. This field is optional.",
	"Select the Announcements image for your site. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode while viewing the Announcements page.",
	"Select the Announcements password enable status for your site. This will enable or disable the Announcements page password. This field is optional.",
	"Enter the Announcements password your site. This password will be used to enable viewing of the Announcements page and is case sensitive. This field is optional.",
	"Enter the Events button text for your site. This text is shown in the second navigation button (see NAV2 at the right). This field is optional. You will only see this text in preview mode.",
	"Enter the Events heading text for your site. This text is shown in the heading of the Events page (see Heading in the content area at the right). This field is optional. You will only see this text in preview mode while viewing the Events page.",
	"Select the Events button enable status for your site. This will enable or disable the Events page and button. This field is optional.",
	"Select the Events image for your site. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode while viewing the Events page.",
	"Select the Events password enable status for your site. This will enable or disable the Events page password. This field is optional.",
	"Enter the Events password your site. This password will be used to enable viewing of the Events page and is case sensitive. This field is optional.",
	"Enter the Photos button text for your site. This text is shown in the third navigation button (see NAV3 at the right). This field is optional. You will only see this text in preview mode.",
	"Enter the Photos heading text for your site. This text is shown in the heading of the Photos page (see Heading in the content area at the right). This field is optional. You will only see this text in preview mode while viewing the Photos page.",
	"Select the Photos button enable status for your site. This will enable or disable the Photos page and button. This field is optional.",
	"Select the Photos image for your site. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode while viewing the Photos page.",
	"Select the Photos password enable status for your site. This will enable or disable the Photos page password. This field is optional.",
	"Enter the Photos password your site. This password will be used to enable viewing of the Photos page and is case sensitive. This field is optional.",
	"Enter the Links button text for your site. This text is shown in the forth navigation button (see NAV4 at the right). This field is optional. You will only see this text in preview mode.",
	"Enter the Links heading text for your site. This text is shown in the heading of the Links page (see Heading in the content area at the right). This field is optional. You will only see this text in preview mode while viewing the Links page.",
	"Select the Links button enable status for your site. This will enable or disable the Links page and button. This field is optional.",
	"Select the Links image for your site. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode while viewing the Links page.",
	"Select the Links password enable status for your site. This will enable or disable the Links page password. This field is optional.",
	"Enter the Links password your site. This password will be used to enable viewing of the Links page and is case sensitive. This field is optional.",
	"Enter the Information button text for your site. This text is shown in the fifth navigation button (see NAV5 at the right). This field is optional. You will only see this text in preview mode.",
	"Enter the Information heading text for your site. This text is shown in the heading of the Information page (see Heading in the content area at the right). This field is optional. You will only see this text in preview mode while viewing the Information page.",
	"Select the Information button enable status for your site. This will enable or disable the Information page and button. This field is optional.",
	"Select the Information image for your site. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode while viewing the Information page.",
	"Select the Information password enable status for your site. This will enable or disable the Information page password. This field is optional.",
	"Enter the Information password your site. This password will be used to enable viewing of the Information page and is case sensitive. This field is optional.",
	"Select the navigation background color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Select the navigation background border style for your site. Note that not all browsers display this setting exactly the same. This field is optional.",
	"Select the navigation background border color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Enter the navigation background border width for your site. Size is measured in 'Pixels'. This field is optional.",
	"Enter the navigation button text size for your site. Size is measured in 'Points'. This field is required.",
	"Select the navigation button text bold attribute for your site. This field is optional.",
	"Select the navigation button text italic attribute for your site. This field is optional.",
	"Select the navigation button normal background color for your site. This color is the normal background color for the button. You may select a color by clicking the Select button. This field is optional.",
	"Select the navigation button normal text color for your site. This color is the normal text color for the button. You may select a color by clicking the Select button. This field is optional.",
	"Select the navigation button normal border style for your site. This border style is the normal border style for the button. Note that not all browsers display this setting exactly the same. This field is optional.",
	"Select the navigation button normal border color for your site. This border color is the normal border color for the button. You may select a color by clicking the Select button. This field is optional.",
	"Enter the navigation button normal border width for your site. This border size is the normal border size for the button. Size is measured in 'Pixels'. This field is optional.",
	"Select the navigation button hover background color for your site. This background color is used when you hover over the button with the mouse pointer. You may select a color by clicking the Select button. This field is optional.",
	"Select the navigation button hover text color for your site. This text color is used when you hover over the button with the mouse pointer. You may select a color by clicking the Select button. This field is optional.",
	"Select the navigation button hover border style for your site. This border style is used when you hover over the button with the mouse pointer. Note that not all browsers display this setting exactly the same. This field is optional.",
	"Select the navigation button hover border color for your site. This border color is used when you hover over the button with the mouse pointer. You may select a color by clicking the Select button. This field is optional.",
	"Enter the navigation button hover border width for your site. This border size is used when you hover over the button with the mouse pointer. Size is measured in 'Pixels'. This field is optional.",
	"Select the navigation button click background color for your site. This background color is used when you click the button with the mouse pointer. You may select a color by clicking the Select button. This field is optional.",
	"Select the navigation button click text color for your site. This text color is used when you click the button with the mouse pointer. You may select a color by clicking the Select button. This field is optional.",
	"Select the navigation button click border style for your site. This border style is used when you click the button with the mouse pointer. Note that not all browsers display this setting exactly the same. This field is optional.",
	"Select the navigation button click border color for your site. This border color is used when you click the button with the mouse pointer. You may select a color by clicking the Select button. This field is optional.",
	"Enter the navigation button click border width for your site. This border size is used when you click the button with the mouse pointer. Size is measured in 'Pixels'. This field is optional."
);
var tasktext5 = new Array (
	"Select the content background image for your site. You may select an image or upload an image by clicking the Select button. This field is optional.",
	"Select the content background color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Select the content border style for your site. Note that not all browsers display this setting exactly the same. This field is optional.",
	"Select the content border color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Enter the content border width for your site. Size is measured in 'Pixels'. This field is optional.",
	"Select the content heading text color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Enter the content heading text size for your site. Size is measured in 'Points'. This field is required.",
	"Select the content heading text bold attribute for your site. This field is optional.",
	"Select the content heading text italic attribute for your site. This field is optional.",
	"Select the content heading text shadow attribute for your site. This field is optional.",
	"Select the content heading text shadow color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Select the content title text color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Enter the content title text size for your site. Size is measured in 'Points'. This field is required.",
	"Select the content title text bold attribute for your site. This field is optional.",
	"Select the content title text italic attribute for your site. This field is optional.",
	"Select the content text color for your site. You may select a color by clicking the Select button. This field is optional.",
	"Enter the content text size for your site. Size is measured in 'Points'. This field is required.",
	"Select the content text bold attribute for your site. This field is optional.",
	"Select the content text italic attribute for your site. This field is optional.",
	"Enter the content link text size for your site. Size is measured in 'Points'. This field is required.",
	"Select the content link normal color for your site. This color is the normal text color for the link. You may select a color by clicking the Select button. This field is optional.",
	"Select the content link hover color for your site. This text color is used when you hover over the link with the mouse pointer. You may select a color by clicking the Select button. This field is optional.",
	"Select the content link visited color for your site. This text color is used when you have visited the link. You may select a color by clicking the Select button. This field is optional.",
	"Select the content link bold attribute for your site. This field is optional.",
	"Select the content link italic attribute for your site. This field is optional.",
	"Select the content link underline attribute for your site. This field is optional.",
	"Select the number of content columns for your site. This sets the number of content columns to display and will only show in preview mode. This field is optional."
);
var tasktext6 = new Array (
	"Select a " + styles.navtext1 + " item to modify or select 'Add New Item' to create a new item. You may also click the 'Delete' button to remove and existing selected item. Items entered here will only show in preview mode.",
	"Enter a posted date for this item. The posted date must be a valid date formatted as: 'MM/DD/YYYY' and will be used to sort the items when displayed on the site. This text will only show in preview mode. This field is required.",
	"Enter the heading text for this item. The heading text will be displayed above the content when displayed on the site. This text will only show in preview mode. This field is required.",
	"Enter the content text for this item. The content text will be the main descriptive text for this item when displayed on the site. Note that simple HTML tags like anchors, fonts, etc. are supported. You may click the 'Open Editor' button to preview, create, and modify custom HTML content. This text will only show in preview mode. This field is required.",
	"Enter a web site or email url link. This text must be formatted as 'http://www.yoursite.com', 'mailto:yourmail@yourdomain.com', or 'yourfile.pdf' in order to work. This text is a link and will not display on the site if text is entered in the field below. This field is optional.",
	"Enter the text to be displayed for the link defined in the field above. This text will be displayed for the link and can be the same as the actual link text. This text will only show in preview mode. This field is optional.",
	"Select an " + styles.navtext1 + " image. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode while viewing the site page.",
	"Select the image alignment. This field is optional. You will only see the image in preview mode while viewing the site page."
);
var tasktext7 = new Array (
	"Select a " + styles.navtext2 + " item to modify or select 'Add New Item' to create a new item. You may also click the 'Delete' button to remove and existing selected item. Items entered here will only show in preview mode.",
	"Enter a event date for this item. The event date must be a valid date formatted as: 'MM/DD/YYYY'. This text will only show in preview mode. This field is required.",
	"Enter the heading text for this item. The heading text will be displayed above the content when displayed on the site. This text will only show in preview mode. This field is required.",
	"Enter the content text for this item. The content text will be the main descriptive text for this item when displayed on the site. Note that simple HTML tags like anchors, fonts, etc. are supported. You may click the 'Open Editor' button to preview, create, and modify custom HTML content. This text will only show in preview mode. This field is required.",
	"Enter a web site or email url link. This text must be formatted as 'http://www.yoursite.com', 'mailto:yourmail@yourdomain.com', or 'yourfile.pdf' in order to work. This text is a link and will not display on the site if text is entered in the field below. This field is optional.",
	"Enter the text to be displayed for the link defined in the field above. This text will be displayed for the link and can be the same as the actual link text. This text will only show in preview mode. This field is optional.",
	"Select an " + styles.navtext2 + " image. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode while viewing the site page.",
	"Select the image alignment. This field is optional. You will only see the image in preview mode while viewing the site page."
);
var tasktext8 = new Array (
	"Select a " + styles.navtext3 + " item to modify or select 'Add New Item' to create a new item. You may also click the 'Delete' button to remove and existing selected item. Items entered here will only show in preview mode.",
	"Enter a posted date for this item. The posted date must be a valid date formatted as: 'MM/DD/YYYY' and will be used to sort the items when displayed on the site. This text will only show in preview mode. This field is required.",
	"Enter the heading text for this item. The heading text will be displayed above the content when displayed on the site. This text will only show in preview mode. This field is required.",
	"Select the photo image for your site. You may select an image or upload an image by clicking the Select button. This image will only show in preview mode. This field is required.",
	"Enter the content text for this item. The content text will be the main descriptive text for this item when displayed on the site. Note that simple HTML tags like anchors, fonts, etc. are supported. You may click the 'Open Editor' button to preview, create, and modify custom HTML content. This text will only show in preview mode. This field is optional."
);
var tasktext9 = new Array (
	"Select a " + styles.navtext4 + " item to modify or select 'Add New Item' to create a new item. You may also click the 'Delete' button to remove and existing selected item. Items entered here will only show in preview mode.",
	"Enter a posted date for this item. The posted date must be a valid date formatted as: 'MM/DD/YYYY' and will be used to sort the items when displayed on the site. This text will only show in preview mode. This field is required.",
	"Enter the heading text for this item. The heading text will be displayed above the content when displayed on the site. This text will only show in preview mode. This field is required.",
	"Enter the content text for this item. The content text will be the main descriptive text for this item when displayed on the site. Note that simple HTML tags like anchors, fonts, etc. are supported. You may click the 'Open Editor' button to preview, create, and modify custom HTML content. This text will only show in preview mode. This field is optional.",
	"Enter a web site or email url link. This text must be formatted as 'http://www.yoursite.com', 'mailto:yourmail@yourdomain.com', or 'yourfile.pdf' in order to work. This text is a link and will not display on the site if text is entered in the field below. This field is required.",
	"Enter the text to be displayed for the link defined in the field above. This text will be displayed for the link and can be the same as the actual link text. This text will only show in preview mode. This field is optional.",
	"Select an " + styles.navtext4 + " image. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode while viewing the site page.",
	"Select the image alignment. This field is optional. You will only see the image in preview mode while viewing the site page."
);
var tasktext10 = new Array (
	"Select a " + styles.navtext5 + " item to modify or select 'Add New Item' to create a new item. You may also click the 'Delete' button to remove and existing selected item. Items entered here will only show in preview mode.",
	"Enter a posted date for this item. The posted date must be a valid date formatted as: 'MM/DD/YYYY' and will be used to sort the items when displayed on the site. This text will only show in preview mode. This field is required.",
	"Enter the heading text for this item. The heading text will be displayed above the content when displayed on the site. This text will only show in preview mode. This field is required.",
	"Enter the content text for this item. The content text will be the main descriptive text for this item when displayed on the site. Note that simple HTML tags like anchors, fonts, etc. are supported. You may click the 'Open Editor' button to preview, create, and modify custom HTML content. This text will only show in preview mode. This field is required.",
	"Enter a web site or email url link. This text must be formatted as 'http://www.yoursite.com', 'mailto:yourmail@yourdomain.com', or 'yourfile.pdf' in order to work. This text is a link and will not display on the site if text is entered in the field below. This field is optional.",
	"Enter the text to be displayed for the link defined in the field above. This text will be displayed for the link and can be the same as the actual link text. This text will only show in preview mode. This field is optional.",
	"Select an " + styles.navtext5 + " image. You may select an image or upload an image by clicking the Select button. This field is optional. You will only see this image in preview mode while viewing the site page.",
	"Select the image alignment. This field is optional. You will only see the image in preview mode while viewing the site page."
);

function page_load() {
	// load content template
	var contentiframe=document.getElementById("contentiframe");
	var sampleiframe=document.getElementById("sampleiframe");
	var frameiframe=document.getElementById("frameiframe");
	if(contentiframe != null) {
		// account for history reloaded page
		var vinclude=document.design.include.value;
		if(vinclude != "0") {
			if(vinclude == "1")
				gttemplate="daccount.cfm";
			else if(vinclude == "2")
				gttemplate="dlayout.cfm";
			else if(vinclude == "3")
				gttemplate="dheading.cfm";
			else if(vinclude == "4")
				gttemplate="dnavigation.cfm";
			else if(vinclude == "5")
				gttemplate="dcontent.cfm";
			else if(vinclude == "6")
				gttemplate="dannouncements.cfm";
			else if(vinclude == "7")
				gttemplate="devents.cfm";
			else if(vinclude == "8")
				gttemplate="dphotos.cfm";
			else if(vinclude == "9")
				gttemplate="dlinks.cfm";
			else if(vinclude == "10")
				gttemplate="dinformation.cfm";
			else if(vinclude == "11")
				gttemplate="duserpages.cfm";
			else if(vinclude == "12")
				gttemplate="sitefilemanager.cfm";
			else if(vinclude == "13")
				gttemplate="daccount.cfm?newuser=true";
			else if(vinclude == "14")
				gttemplate="filemanager.cfm";
		}
		contentiframe.src=gttemplate;
	}
	if(frameiframe != null)
		frameiframe.src=gftemplate;
	if(sampleiframe != null)
		sampleiframe.src=gstemplate;
	// resize framework
	setTimeout("reposition_elements()", 500);
}
// syncframes selection of source to content from browser history
function syncframes(pinclude) {
	for(var i=0; i<document.design.elist.length;i++) {
		if(document.design.elist.options[i]==pinclude) {
			document.design.elist.selectedIndex=i.toString();
			break;
		}
	}
}
// reposition page elements
function reposition_elements() {
	// get client sizes
	var pHeight;
	if(window.innerHeight != null)
		pHeight=window.innerHeight;
	else
		pHeight=window.document.body.offsetHeight;
	if(pHeight < 400)
		pHeight=400;
	// resize content element
	var cHeight=0;
	var vHeight=document.getElementById("headercontainer");
	if(vHeight != null)
		cHeight+=vHeight.offsetHeight;
	vHeight=document.getElementById("footercontainer");
	if(vHeight != null)
		cHeight+=vHeight.offsetHeight;
	var contentiframe=document.getElementById("contentiframe");
	if(contentiframe != null)
		contentiframe.height=pHeight-cHeight-gHeightPad;
	var sampleiframe=document.getElementById("sampleiframe");
	var frameiframe=document.getElementById("frameiframe");
	if(frameiframe != null && sampleiframe != null)
		frameiframe.height=contentiframe.height-sampleiframe.height-19;
}
function logout() {
	window.location.replace("designer.cfm?logout=true");
}
function clear_selected() {
	if(document.selection != null)
		document.selection.empty();	
	else {
		var selobj=window.getSelection();
		if(selobj != null) {
			var oneRange;
			for(var i=0; i < selobj.rangeCount; i++) {
				oneRange=selobj.getRangeAt(i);
				selobj.removeRange(oneRange);
			}
		}
	}
}
function refresh_page() {
	if(gDataChg > 0 && confirm('Save Changes?')) {
		ginclude=document.design.elist.value;
		process_save();
	}
	else if(ginclude != "") {
		document.design.include.value=ginclude;
		ginclude="";
		document.design.submit();
	}
	else { 
		ginclude="";
		document.design.include.value=document.design.elist.value;
		document.design.submit();
	}
}
function refresh_childpage(purl) {
	if(gDataChg > 0 && confirm('Save Changes?')) {
		process_save();
	}
	else { 
		var contentiframe=document.getElementById("contentiframe");
		if(contentiframe != null) {
			if(contentiframe.contentDocument != null) {
				contentiframe.contentDocument.admin.action=purl;
				contentiframe.contentDocument.admin.submit();
			}
			else if(contentiframe.contentWindow != null) {
				contentiframe.contentWindow.document.admin.action=purl;
				contentiframe.contentWindow.document.admin.submit();
			}
		}
	}
}
function adjust_buttons(rcnt) {
	var include=document.design.include.value;
	var buttonid;
	if(include == 0) {
		buttonid=document.getElementById("savebutton");
		buttonid.style.display="none";
		buttonid=document.getElementById("deletebuttonpadd");
		buttonid.style.display="none";
		buttonid=document.getElementById("deletebutton");
		buttonid.style.display="none";
		buttonid=document.getElementById("previewbutton");
		if(gwln == true)
			buttonid.style.display="none";
		else
			buttonid.style.display="block";
		buttonid=document.getElementById("defaultsbuttonpadd");
		buttonid.style.display="none";
		buttonid=document.getElementById("defaultsbutton");
		buttonid.style.display="none";
	}
	else if(include < 6) {
		buttonid=document.getElementById("savebutton");
		buttonid.style.display="block";
		buttonid=document.getElementById("deletebuttonpadd");
		if(include == 1 && document.getElementById("ulist") != null)
			buttonid.style.display="block";
		else
			buttonid.style.display="none";
		buttonid=document.getElementById("deletebutton");
		if(include == 1 && document.getElementById("ulist") != null)
			buttonid.style.display="block";
		else
			buttonid.style.display="none";
		buttonid=document.getElementById("previewbutton");
		buttonid.style.display="block";
		buttonid=document.getElementById("defaultsbuttonpadd");
		buttonid.style.display="block";
		buttonid=document.getElementById("defaultsbutton");
		buttonid.style.display="block";
	}
	else {
		if(include != 12 && include != 14) {
			buttonid=document.getElementById("savebutton");
			buttonid.style.display="block";
		}
		else {
			buttonid=document.getElementById("savebutton");
			buttonid.style.display="none";
		}
		if(rcnt > 0) {
			buttonid=document.getElementById("deletebuttonpadd");
			buttonid.style.display="block";
			buttonid=document.getElementById("deletebutton");
			buttonid.style.display="block";
		}
		else {
			buttonid=document.getElementById("deletebuttonpadd");
			buttonid.style.display="none";
			buttonid=document.getElementById("deletebutton");
			buttonid.style.display="none";
		}
		buttonid=document.getElementById("previewbutton");
		buttonid.style.display="block";
		buttonid=document.getElementById("defaultsbuttonpadd");
		buttonid.style.display="block";
		buttonid=document.getElementById("defaultsbutton");
		buttonid.style.display="block";
	}
	// override for user managed sites
	if(gSiteType > 0) {
		buttonid=document.getElementById("defaultsbuttonpadd");
		buttonid.style.display="none";
		buttonid=document.getElementById("defaultsbutton");
		buttonid.style.display="none";
	}
}
function process_admin(ptype) {
	if(ptype == 0)
		process_defaults();
	else if(ptype == 1)
		process_save();
	else if(ptype == 2)
		process_delete();
	else
		process_preview();
}
function process_defaults() {
	if(confirm('Reset Site to Default Layout,\nColor, & Size Settings?')) {
		gDataChg=0;
		document.design.action="setstyledefault.cfm";
		document.design.submit();
	}
}
function process_save() {
	gDataChg=0;
	var contentiframe=document.getElementById("contentiframe");
	if(contentiframe != null) {
		if(contentiframe.contentDocument != null) {
			if(contentiframe.contentDocument.admin.clickflag.value == 0) {
				contentiframe.contentDocument.admin.clickflag.value=1;
				contentiframe.contentDocument.admin.clickfunc.value="modify";
				contentiframe.contentDocument.admin.submit();
			}
		}
		else if(contentiframe.contentWindow != null) {
			if(contentiframe.contentWindow.document.admin.clickflag.value == 0) {
				contentiframe.contentWindow.document.admin.clickflag.value=1;
				contentiframe.contentWindow.document.admin.clickfunc.value="modify";
				contentiframe.contentWindow.document.admin.submit();
			}
		}
	}
}
function process_delete() {
	gDataChg=0;
	var contentiframe=document.getElementById("contentiframe");
	if(confirm('OK to Delete Record?')) {
		if(contentiframe.contentDocument != null) {
			if(contentiframe.contentDocument.admin.clickflag.value == 0) {
				contentiframe.contentDocument.admin.clickflag.value=1;
				contentiframe.contentDocument.admin.clickfunc.value="delete";
				contentiframe.contentDocument.admin.submit();
			}
		}
		else if(contentiframe.contentWindow != null) {
			if(contentiframe.contentWindow.document.admin.clickflag.value == 0) {
				contentiframe.contentWindow.document.admin.clickflag.value=1;
				contentiframe.contentWindow.document.admin.clickfunc.value="delete";
				contentiframe.contentWindow.document.admin.submit();
			}
		}
	}
}
function process_preview() {
	if(gDataChg > 0 && confirm('Save Changes?')) {
		//var contentiframe=document.getElementById("contentiframe");
		//if(contentiframe.contentDocument != null) {
		//	contentiframe.contentDocument.admin.preview.value="1";
		//}
		//else if(contentiframe.contentWindow != null) {
		//	contentiframe.contentWindow.document.admin.preview.value="1";
		//}
		process_save();
	}
	else { 
		var rto=document.design.include.value;
		window.location.href="../client/" + gUserId + "/index.cfm?rto=" + rto;
	}
}
function setchgflg() {
	gDataChg=1;
}
function changelayout() {
	var contentiframe=document.getElementById("contentiframe");
	if(contentiframe != null) {
		if(contentiframe.contentDocument != null) {
			styles.layout=contentiframe.contentDocument.admin.layout.value;
		}
		else if(contentiframe.contentWindow != null) {
			styles.layout=contentiframe.contentWindow.document.admin.layout.value;
		}
		window.setTimeout("reload_dframe()", 1000);	
	}
}
function changestyle(id) {
	var contentiframe=document.getElementById("contentiframe");
	var frameiframe=document.getElementById("frameiframe");
	var sampleiframe=document.getElementById("sampleiframe");
	var value;
	if(contentiframe != null && frameiframe != null) {
		if(contentiframe.contentDocument != null) {
			value=contentiframe.contentDocument.getElementById(id).value;
		}
		else if(contentiframe.contentWindow != null) {
			value=contentiframe.contentWindow.document.getElementById(id).value;
		}
		styles[id]=value;
		//alert(value);
		frameiframe.src=frameiframe.src;
	}
}
function changestyle_bool(id) {
	var contentiframe=document.getElementById("contentiframe");
	var frameiframe=document.getElementById("frameiframe");
	var sampleiframe=document.getElementById("sampleiframe");
	var value;
	if(contentiframe != null && frameiframe != null) {
		if(contentiframe.contentDocument != null) {
			value=contentiframe.contentDocument.getElementById(id).value;
		}
		else if(contentiframe.contentWindow != null) {
			value=contentiframe.contentWindow.document.getElementById(id).value;
		}
		if(value=="0")
			styles[id]=0;
		else
			styles[id]=1;
		//alert(value);
		frameiframe.src=frameiframe.src;
	}
}
function adjust_task(pnum, fld) {
	// save target field
	if(fld != '')
		gTargetField=fld;
	// set task text
	var include=document.design.include.value;
	var parray=eval("tasktext" + include.toString());
	var sampleiframe=document.getElementById("sampleiframe");
	var ptext=taskdefault;
	if(pnum != -1)
		var ptext=parray[pnum];
	if(sampleiframe != null) {
		try {
			if(sampleiframe.contentDocument != null) {
				sampleiframe.contentDocument.getElementById("tasktext").innerHTML=ptext;
			}
			else if(sampleiframe.contentWindow != null) {
				sampleiframe.contentWindow.document.getElementById("tasktext").innerHTML=ptext;
			}
		}
		catch(e) {}
	}
}
function open_colorselection(pnum, fld) {
	if(fld != '') {
		gColorField=fld;
		var contentiframe=document.getElementById("contentiframe");
		var frameiframe=document.getElementById("frameiframe");
		if(contentiframe != null && frameiframe != null) {
			if(contentiframe.contentDocument != null) {
				gSelectedColor=contentiframe.contentDocument.getElementById(gColorField).value;
			}
			else if(contentiframe.contentWindow != null) {
				gSelectedColor=contentiframe.contentWindow.document.getElementById(gColorField).value;
			}
		}
		//gSelectedColor=styles[gColorField];
	}
	gPopupTaskText=popupcolortext[pnum];
	OpenPopupSize("ColorSelect", "colorselection.cfm", 500, 420)
}
function setSelectedColor(scolor) {
	gSelectedColor=scolor;
	var contentiframe=document.getElementById("contentiframe");
	var vinclude=document.design.include.value;
	if(contentiframe != null) {
		if(contentiframe.contentDocument != null) {
			contentiframe.contentDocument.getElementById(gColorField).value=scolor;
			contentiframe.contentDocument.getElementById(gColorField + "ident").style.backgroundColor=scolor;
		}
		else if(contentiframe.contentWindow != null) {
			contentiframe.contentWindow.document.getElementById(gColorField).value=scolor;
			contentiframe.contentWindow.document.getElementById(gColorField + "ident").style.backgroundColor=scolor;
		}
		setchgflg();
		if(vinclude < 6) {
			styles[gColorField]=gSelectedColor;
			window.setTimeout("reload_dframe()", 1000);	
		}
	}
}
function open_imageselection(pnum, fld) {
	gSelectedImageAlign=null;
	if(fld != '') {
		gImageField=fld;
		var contentiframe=document.getElementById("contentiframe");
		var frameiframe=document.getElementById("frameiframe");
		if(contentiframe != null && frameiframe != null) {
			if(contentiframe.contentDocument != null) {
				gSelectedImage=contentiframe.contentDocument.getElementById(gImageField).value;
			}
			else if(contentiframe.contentWindow != null) {
				gSelectedImage=contentiframe.contentWindow.document.getElementById(gImageField).value;
			}
		}
	}
	gPopupTaskText=popupimagetext[pnum];
	OpenPopupSize("ImageSelect", "imageselection.cfm", 800, 600)
}
function open_backgroundselection(pnum, fld) {
	if(fld != '') {
		gImageField=fld;
		var contentiframe=document.getElementById("contentiframe");
		var frameiframe=document.getElementById("frameiframe");
		if(contentiframe != null && frameiframe != null) {
			if(contentiframe.contentDocument != null) {
				gSelectedImage=contentiframe.contentDocument.getElementById(gImageField).value;
			}
			else if(contentiframe.contentWindow != null) {
				gSelectedImage=contentiframe.contentWindow.document.getElementById(gImageField).value;
			}
		}
	}
	gPopupTaskText=popupimagetext[pnum];
	OpenPopupSize("BackgroundSelect", "backgroundselection.cfm", 800, 600)
}
function open_photoselection(pnum, fld) {
	if(fld != '') {
		gImageField=fld;
		var contentiframe=document.getElementById("contentiframe");
		var frameiframe=document.getElementById("frameiframe");
		if(contentiframe != null && frameiframe != null) {
			if(contentiframe.contentDocument != null) {
				gSelectedImage=contentiframe.contentDocument.getElementById(gImageField).value;
			}
			else if(contentiframe.contentWindow != null) {
				gSelectedImage=contentiframe.contentWindow.document.getElementById(gImageField).value;
			}
		}
	}
	gPopupTaskText=popupimagetext[pnum];
	OpenPopupSize("PhotoSelect", "photoselection.cfm", 800, 600)
}
function setSelectedImage(simage,salign) {
	gSelectedImage=simage;
	gSelectedImageAlign=salign;
	var contentiframe=document.getElementById("contentiframe");
	var vinclude=document.design.include.value;
	if(contentiframe != null) {
		if(contentiframe.contentDocument != null) {
			contentiframe.contentDocument.getElementById(gImageField).value=simage;
		}
		else if(contentiframe.contentWindow != null) {
			contentiframe.contentWindow.document.getElementById(gImageField).value=simage;
		}
		setchgflg();
		if(vinclude < 6) {
			styles[gImageField]=simage;
			window.setTimeout("reload_dframe()", 1000);	
		}
	}
}
function setSelectedPhoto(simage) {
	gSelectedImage=simage;
	var contentiframe=document.getElementById("contentiframe");
	if(contentiframe != null) {
		if(contentiframe.contentDocument != null) {
			contentiframe.contentDocument.getElementById(gImageField).value=simage;
		}
		else if(contentiframe.contentWindow != null) {
			contentiframe.contentWindow.document.getElementById(gImageField).value=simage;
		}
		setchgflg();
	}
}
function openTextEditor(fld) {
	if(fld != '') {
		gTextAreaField=fld;
		var contentiframe=document.getElementById("contentiframe");
		var frameiframe=document.getElementById("frameiframe");
		if(contentiframe != null && frameiframe != null) {
			if(contentiframe.contentDocument != null) {
				gTextAreaContents=contentiframe.contentDocument.getElementById(gTextAreaField).value;
			}
			else if(contentiframe.contentWindow != null) {
				gTextAreaContents=contentiframe.contentWindow.document.getElementById(gTextAreaField).value;
			}
		}
		OpenPopupSize("TextEditor", "texteditor.cfm", 800, 600)
	}
}
function setSelectedText(txt) {
	var textarea_contents;
	if(txt != null)
		textarea_contents=txt;
	else
		textarea_contents="";
	gTextAreaContents=textarea_contents;
	var contentiframe=document.getElementById("contentiframe");
	var vinclude=document.design.include.value;
	if(contentiframe != null) {
		if(contentiframe.contentDocument != null) {
			contentiframe.contentDocument.getElementById(gTextAreaField).value=txt;
		}
		else if(contentiframe.contentWindow != null) {
			contentiframe.contentWindow.document.getElementById(gTextAreaField).value=txt;
		}
		setchgflg();
	}
}
function reload_dframe() {
	var frameiframe=document.getElementById("frameiframe");
	if(frameiframe != null) {
		if(styles.layout==0) 
			frameiframe.src="dframe-leftnav.cfm";
		else
			frameiframe.src="dframe-topnav.cfm";
	}
}
function open_renewal() {
	OpenPopupSize("Renewal", "renewal.cfm", 626, 490)
}
function OpenPopupSize(pTitle, pURL, pWidth, pHeight) {
	var posx = (screen.availWidth-pWidth)/2;
	var posy = (screen.availHeight-pHeight)/2;
	var pStyle = "left=" + posx.toString() + ",top=" + posy.toString() + ",width=" + pWidth.toString() + ",height=" + pHeight.toString() + ",toolbar=0,status=0,resizable=1,Scrollbars=1";
	var sPopupWin = window.open(pURL, pTitle, pStyle);
}
function returnfocus() {
	window.setTimeout("focus()", 50);	
}
