<!--

// ***************** Begin Lingual Variables ****************************************

	var strMandatory = "-- Mandatory Field --";
	var strValidate1 = "    -- Your comment contain ";
	var strValidate2 = " characters. Only ";
	var strValidate3 = " allowed. Please revise!    ";
	var strValidate4 = "    -- Your comment possibly contains a harmful code. Please revise!    ";
	var strValidate5 = "    -- Name must be specified!    ";
	var strValidate6 = "    -- Email format is invalid!    ";
	var strValidate7 = "    -- Please state your comment!    ";
	var strValidate9 = "    -- Please specify capture code!  ";
	var strValidate8 = "Please fix the following errors and resubmit:";
	
	var strStyle1 = "select text, click ";
	var strStyle2 = " Click without selection to start range. Click again to end range.";


// ****************** End Lingual Variables ******************************************


function init() {

document.postnew.fName.value = strMandatory;
document.postnew.fComment.value = strMandatory;

}


function GetLost(oform){
	if (oform.value == strMandatory){
		oform.value = "";
	}

}

function submitform(oform)
{

	if (oform.fName.value == strMandatory){
		oform.fName.value = "";
	}
	
	if (oform.fComment.value == strMandatory){
		oform.fComment.value = "";
	}


var errorm = "";
var uname = (oform.fName.value);
var uname = uname.replace(/\s/g, "");
var email = (oform.fEmail.value);
var ePat = (/(\w+)@(\w+)\.(\w+)/);
var matchEmail=email.match(ePat);
var comment = (oform.fComment.value);
var icomment = comment.replace(/\s/g, "");
var ASPCodePat = /<%(.|\n)*%>|<script(.|\n)*script>|<style(.|\n)*style>|<meta[\s]/gi;
var testForASP = comment.match(ASPCodePat);
var cLenght = comment.length;
var maxChr = (oform.maxPost.value);

	if (cLenght > maxChr){

		var errorm = (strValidate1 + cLenght + strValidate2 + maxChr + strValidate3 + "\n");
		var trap = ("error");
		
	}

	if (testForASP !== null){
		var errorm = errorm + (strValidate4 + "\n");
		var trap = ("error");
	}


	if (uname == "") {
		var errorm = errorm + (strValidate5 + "\n");
		var trap = ("error");
	}
	if (email !== "") {
		if (matchEmail == null){
			var errorm = errorm + (strValidate6 + "\n");
			var trap = ("error");
		}	
	}
	var captcha = (oform.strCAPTCHA.value);
	if (captcha == "") {
		var errorm = errorm + (strValidate9 + "\n");
		var trap = ("error");
	}
	if (icomment == "") {
		var errorm = errorm + (strValidate7 + "\n");
		var trap = ("error");
	}

		

	if (trap == "error") {
		alert (strValidate8 + "\n" + "\n" + errorm);
	}
	else {
		 var longPat = /((\S){60})/g;
		 var testComment = (comment);
		 oform.fComment.value = testComment.replace(longPat, "$1" + "\n");
		 oform.submitFlag.value = "post";
		 oform.submit();
	     }
}

function popup(url,wname,params)
{
PopWin = window.open(url,wname,params);
PopWin.focus();
}

function Save_Message(action)
{

	if (action == "save"){
		var conf = window.confirm("Are you sure you want to save changes?");
		if (!conf){
		return
		}
		else
			document.postnew.action.value = "save"
			document.postnew.submit();
	}

	if (action == "clear"){
		var conf = window.confirm("This action will clear the comment in the database! Continue?");
		if (!conf){
		return
		}
		else
		document.postnew.action.value = "clear"
    		document.postnew.submit();
	}
	
}

function sm(val,isnn) {

	if (isnn == 1){
		GetLost(window.opener.document.postnew.fComment);
		var selFrom = window.opener.document.postnew.fComment;
	}else{
		var myParent = window.parent.dialogArguments["DIALOGOPENER"];
		GetLost(myParent.document.postnew.fComment);
		var selFrom = myParent.document.postnew.fComment;
	}

	if (selFrom.storedRange) {
		 selFrom.storedRange.text = val;

	}else{
    		 selFrom.value += val;
  	}
}

function checkAll(oChkBox)
{
var bStatus = oChkBox.checked;
var docFrm = document.forms["admin"];
    for (i=0; i < docFrm.elements.length; i++) {
    	if (docFrm.elements[i].type == "checkbox") {
			docFrm.elements[i].checked = bStatus;
       }
    }
}

function popup(url,wname,params)
{
PopWin = window.open(url,wname,params);
PopWin.focus();
}

function sting(cform)
{
var n = (cform.T1.value);
var p = (cform.T2.value);
var c = (cform.T3.value);
if (p !== c) {
	alert("Password does not match.");
	cform.T2.value = ("");
	cform.T3.value = ("");
	return
}
if (n == "" | p == "") {
	var conf = window.confirm("Name or Password is blank. Do you want to continue?");
	if (!conf) {
	return
	}
}
cform.submit();
}


function feedback(reportform)
{


	if (typeof(document.forms[reportform].report) == "object"){
			alert(document.forms[reportform].report.value);
		
	}

	if (typeof(document.forms[reportform].refreshBook) == "object"){
		window.location=window.location
		window.opener.location=window.opener.location
	}
}

function archive()
{

var arch = document.frmarchive.D1.options[document.frmarchive.D1.selectedIndex].value;

		if (arch == "2"){
			if (window.confirm("You are about to Archive All messages from Guest Book.")){
				frmarchive.submit();
			}
			else
				return
		}
		else
			if (window.confirm("You are about to archive messages older than " + arch + " days from Guest Book.")){
				frmarchive.submit();
			}
}

function showArchive(oform)
{

	if (oform.options.length == 0){
		alert("Archive List is Empty!");
		return
	}

var selArch = oform.options[oform.selectedIndex].value;
popup("archive.asp?arch=" + selArch + "&Page=1","archive","toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=1000,height=700");

}

function delarchive()
{

	if (document.frmarchdel.D2.options.length == 0){
		alert("Archive List is Empty!");
		return
	}
	if (window.confirm("You are about to delete selected Archive.")){
		frmarchdel.submit();
	}
}


function searchGuestBook(){
	var sTarget = document.search.D1.options[document.search.D1.selectedIndex].value;
	var sType = document.search.D2.options[document.search.D2.selectedIndex].value;
	var sDate = document.search.D3.options[document.search.D3.selectedIndex].value;
	var searchStr = document.search.T1.value;
	var matchCase = document.search.C1.checked;
	var checkStr = searchStr.replace(/\s/g, "");
	if (checkStr == "")
		return alert("Please specify a String to search.");
	if (sType !== "3"){
		var searchStr = searchStr.replace(/[^A-Za-z0-9\s_]/g, "");
		var tempSplit = searchStr.split(" ");
		var searchStr = "";
		for (var i=0; i < tempSplit.length; i++){
			if (tempSplit[i] !== ""){
				var searchStr = searchStr + "+" + tempSplit[i];
			}
		}
		searchStr = searchStr.replace(/\+/, "");
	}
	document.search.action = "search.asp?Target=" +  escape(sTarget) + "&string=" + escape(searchStr) + "&type=" + sType + "&Displ=1&Date=" + sDate + "&case=" + matchCase;
	document.search.submit();

}


function saveTheme(){

var tname = (frmColor.fTname.value);
var tname = tname.replace(/\s/g, "");
var tPatt = /[^\w-]/g;
var checkName=tname.match(tPatt);

	if (tname == "") {
		alert("    -- Please Specify a name of the Theme!");
		return;
	}

	if (checkName !== null){
		alert("    -- Only Alphanumeric values,  ‘-‘ and ‘_’ allowed as a Theme Name!");
		return;
	}

	document.frmColor.sTheme.value = "save"
	document.frmColor.submit();
}

function delTheme()
{

	if (document.frmColor.tList.options.length == 0){
		alert("Themes List is Empty");
		return
	}
	if (window.confirm("You are about to delete selected Theme.")){

		document.frmColor.ThemeConfig.value = "delete"
		document.frmColor.submit();
	}
}

function loadTheme()
{

	if (document.frmColor.tList.options.length == 0){
		alert("Themes List is Empty");
		return
	}
	if (window.confirm("You are about to load selected Theme. If you have not saved current configuration it will be overridden!")){

		document.frmColor.ThemeConfig.value = "load"
		document.frmColor.submit();
	}
}


function selectPages(perPage, pageNumber, pageName)
{

	document.cookie = "Page="+pageNumber+";path=/";
	document.cookie = "PerPage="+perPage+";path=/";
	window.location = pageName;
}

function ShowColor(colorValue)
{
	Color.style.backgroundColor = colorValue;
	var stripValue = colorValue.replace("#", "");
	frmColor.frmhex.value=stripValue;
}

function buffer(oForm) {
  	var iRange = document.selection.createRange();
  	oForm.storedRange = iRange.duplicate();
}


function postStyle(image,iLocation,iStyle) {

	GetLost(document.postnew.fComment);
	var oForm = document.postnew.fComment;

	switch(iStyle){
		case "bold":
			var sTag = "[b]";
			var eTag = "[/b]";
			var sImage = "b.jpg";
			var eImage = "b1.jpg";
			var sID = "sbold";
			var eID = "ebold";
			if (image.id=="sbold") {var iStart = true;}
			break;
		case "it":
			var sTag = "[i]";
			var eTag = "[/i]";
			var sImage = "i.jpg";
			var eImage = "i1.jpg";
			var sID = "sit";
			var eID = "eit";
			if (image.id=="sit") {var iStart = true;}
			break;
		case "us":
			var sTag = "[u]";
			var eTag = "[/u]";
			var sImage = "u.jpg";
			var eImage = "u1.jpg";
			var sID = "sus";
			var eID = "eus";
			if (image.id=="sus") {var iStart = true;}
			break;

	}

	if (iStart) {
		if (oForm.storedRange) {
			if (oForm.storedRange.text.length > 0) {
    				oForm.storedRange.text = sTag+oForm.storedRange.text+eTag;
			}else{
				oForm.storedRange.text = sTag;
				var iSwitch = true;
			}
		}else{
    			oForm.value += sTag;
			var iSwitch = true;
  		}				
		if (iSwitch) {
			image.src = iLocation+eImage;
			image.id = eID;
		}
				
	}else{
		if (oForm.storedRange) {
			if (oForm.storedRange.text.length > 0) {
    				oForm.storedRange.text += eTag;
			}else{
				oForm.storedRange.text = eTag;
			}
		}else{
    			oForm.value += eTag;
  		}				
		image.src = iLocation+sImage;
		image.id = sID;
	}

}

function cStyle(iStyle) {

	switch (iStyle) {
	
	case "bold" : document.all.help.innerHTML="<font size=1><b>Bold</b> - " + strStyle1 + "|<b>B</b>|." + strStyle2 + "</font>"; break;
	case "itl" : document.all.help.innerHTML="<font size=1><i>Italic</i> - " + strStyle1 + "|<i>I</i>|." + strStyle2 + "</font>"; break;
	case "usr" : document.all.help.innerHTML="<font size=1><u>Underscore</u> - " + strStyle1 + "|<u>U</u>|." + strStyle2 + "</font>";
	
	}
}


// ################################## Virtual Designer ##########################################################################################

function backColor(iColor) {

	var rObj = document.frames.design.document.body;
	rObj.style.backgroundColor = iColor;
}

function setTitle(iBorder, iColor, iAction) {

	x = iBorder;
	y = iColor;
	z = iAction;


	if (x == "title"){
		rObj = document.frames.design.document.all.item("title");
		if (z)	{
			rObj.style.border="3 solid"; rObj.style.borderColor=y;
		}else{
		rObj.style.border=0;
		}
	}
	if (x == "title_cell"){
		rObj = document.frames.design.document.all.item("title_cell");
		if (z)	{
			rObj.style.border="1 solid"; rObj.style.borderColor=y; rObj.style.color=y;
		}else{
		rObj.style.border=0;
		rObj.style.color=document.all.htextcolor.style.backgroundColor;
		}
	}
globalFilterSet()

}

function setFontSize(iSize, iType) {

	var rObj = document.frames.design.document.all;
	switch (iType) {
	   case "sfont":

      		for (i = 0; i < rObj.length; i++){
			if (rObj(i).id == "view_output_cells"|rObj(i).id == "small_font"|
					rObj(i).id == "href"|rObj(i).className == "select_forms") {rObj(i).style.fontSize = iSize;}	
      		}
		break;
	   case "btns":
      		for (i = 0; i < rObj.length; i++){
			if (rObj(i).id == "buttons") {rObj(i).style.fontSize = iSize;}	
      		}
		break;

	   case "lfont":
      		for (i = 0; i < rObj.length; i++){
			if (rObj(i).id == "input_forms"|rObj(i).id == "large_font"|
				rObj(i).id == "static_cells"|rObj(i).className == "comment_input_form") {rObj(i).style.fontSize = iSize;}	
      		}
		break;
	}

}

function setFont(iFont) {

var rObj = document.frames.design.document.all;


      	for (i = 0; i < rObj.length; i++){
		if (rObj(i).className == "static_cells"|rObj(i).className == "view_output_cells"|
			rObj(i).className == "input_forms"|rObj(i).className == "buttons"|
			rObj(i).id == "htext"|rObj(i).className == "select_forms") {
					
			rObj(i).style.fontFamily=iFont;			
		}

      	}
}


function removeBorder(iName) {

	switch (iName) {

		case "itbcolor": rObj = document.frames.design.document.all.item("input_table"); break;
		case "ctbcolor": rObj = document.frames.design.document.all.item("comment_table"); break;
		case "fbrcolor": rObj = document.frames.design.document.all.item("input_forms"); break;
		case "scbcolor": rObj = document.frames.design.document.all.item("static_cells"); break;
		case "icbcolor": rObj = document.frames.design.document.all.item("sign_input_cells"); break;
		case "vcbcolor": rObj = document.frames.design.document.all.item("view_output_cells"); break;
	}

	if (rObj != null){
   		if (rObj.length != null){
      			for (i = 0; i < rObj.length; i++){

				rObj(i).style.border=0;

      			}
   		}else{
				rObj.style.border=0;
   		}

	}

}

function colorVD(iName, iColor, iCount, blink, iReset, iType){

switch (iName) {

	case "maincolor": x = "static_cells"; break;
	case "inputcolor": x = "sign_input_cells"; break;
	case "areacolor": x = "view_output_cells"; break;
	case "inputbcolor": x = "input_forms"; break;
	case "bbcolor": x = "buttons"; break;
	case "htextcolor": x = "htext"; break;
	case "btextcolor": x = "tbuttons"; break;
	case "hlinkcolor": x = "href"; break;
	case "hrcolor": x = "hr"; break;
	case "itbcolor": x = "input_table"; break;
	case "ctbcolor": x = "comment_table"; break;
	case "tablescolor":
		document.frames.design.document.all.input_table(0).style.backgroundColor=iColor;
		document.frames.design.document.all.comment_table(0).style.backgroundColor=iColor;
		document.frames.design.document.all.input_table(1).style.backgroundColor=iColor;
		document.frames.design.document.all.comment_table(1).style.backgroundColor=iColor;
		globalFilterSet();
		return;
}


y = iColor;
z = iCount;
r = iReset;
t = iType;

if (z>5) {
	clearTimeout(iTimer);
	globalFilterSet();
	return;
}

if (blink == "invert()") { 
	b = "";
}else{
	b = "invert()";
}	
	
rObj = document.frames.design.document.all.item(x);

	if (rObj != null){
   		   z +=1;
   		if (rObj.length != null){
      			for (i = 0; i < rObj.length; i++){
				switch (t) {
					case "iCell":
						if (r!=="") {
							rObj(i).style.backgroundColor=r;break;
						}else{
							rObj(i).style.backgroundColor=y;break;
						}
					case "iText":
						if (r=="btn") {
							rObj(i).style.color=y;
							document.frames.design.document.all.buttons(i).style.border="1 solid";
							document.frames.design.document.all.buttons(i).style.borderColor=rObj(i).style.color;
							if (y=="") {
							document.frames.design.document.all.buttons(i).style.border=0
							}
							break;
						}else{
							rObj(i).style.color=y;break;
						}
					case "iBorder": rObj(i).style.border="1 solid"; rObj(i).style.borderColor=y; break;
				}
         			rObj(i).style.filter=b;
      			}
   		}else{
			switch (t) {
				case "iCell": 
					if (r!="") {
						rObj.style.backgroundColor=r;break;
					}else{
						rObj.style.backgroundColor=y;break;
					}
				case "iText": rObj.style.color=y; break;
				case "iBorder": rObj.style.border="1 solid"; rObj(i).style.borderColor=y; break;
			}
         		rObj.style.filter=b;
   		}


  iTimer = window.setTimeout('colorVD('+'x'+','+'y'+','+'z'+','+'b'+','+'r'+','+'t'+')', 100);
	}

}



function globalFilterSet() {

var oForm = document.frmColor;

var sOpacity = oForm.sOpacity.options[oForm.sOpacity.selectedIndex].value;

var gradBType = Math.abs(oForm.bgrad[1].checked);
var gradTType = Math.abs(oForm.ptgrad[1].checked);
var gradHType = Math.abs(oForm.tgrad[1].checked);
var gradIType = Math.abs(oForm.igrad[1].checked);
var gradMType = Math.abs(oForm.mgrad[1].checked);
var gradFType = Math.abs(oForm.fgrad[1].checked);
var gradTLType = Math.abs(oForm.tblgrad[1].checked);

var gradBSColor = document.all.bbcolor.style.backgroundColor.replace("#", "#ff");
var gradBEColor = document.all.gbbcolor.style.backgroundColor.replace("#", "#ff");

var gradTSColor = document.all.titlecolor.style.backgroundColor.replace("#", "#ff");
var gradTEColor = document.all.gtitlecolor.style.backgroundColor.replace("#", "#ff");

var gradHSColor = document.all.maincolor.style.backgroundColor.replace("#", "#ff");
var gradHEColor = document.all.gmaincolor.style.backgroundColor.replace("#", "#ff");

var gradISColor = document.all.inputcolor.style.backgroundColor.replace("#", "#ff");
var gradIEColor = document.all.ginputcolor.style.backgroundColor.replace("#", "#ff");

var gradMSColor = document.all.areacolor.style.backgroundColor.replace("#", "#ff");
var gradMEColor = document.all.gareacolor.style.backgroundColor.replace("#", "#ff");

var gradFSColor = document.all.inputbcolor.style.backgroundColor.replace("#", "#ff");
var gradFEColor = document.all.ginputbcolor.style.backgroundColor.replace("#", "#ff");

var gradTLSColor = document.all.tablescolor.style.backgroundColor.replace("#", "#ff");
var gradTLEColor = document.all.gtablescolor.style.backgroundColor.replace("#", "#ff");

rObj = document.frames.design.document.all
	for (i = 0; i < rObj.length; i++){
		if (rObj(i).id=="ibuttons"){
			if (oForm.sdwButtons.checked) {

      				rObj(i).style.filter = "progid:DXImageTransform.Microsoft.Shadow(Color=" + document.all.decorcolor.style.backgroundColor + 
							", Direction=135, Strength=" + oForm.sDecor.options[oForm.sDecor.selectedIndex].value +")";
			}else{
         			rObj(i).style.filter="";
			}
		}

		if (rObj(i).id=="buttons"){
			if (oForm.gradButtons.checked) {

				rObj(i).style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=" + gradBType + ", StartColorStr='" + 
							gradBSColor + "', EndColorStr='" + gradBEColor + "') progid:DXImageTransform.Microsoft.Alpha(Opacity="+sOpacity+", Style=0)";
			}else{
         			rObj(i).style.filter="";
				rObj(i).style.backgroundColor = document.all.bbcolor.style.backgroundColor;
			}
		}


		if (rObj(i).id=="title"){
			if (oForm.sdwPageTitle.checked) {
      				rObj(i).style.filter = "progid:DXImageTransform.Microsoft.Shadow(Color=" + document.all.decorcolor.style.backgroundColor + ", Direction=135, Strength=" + 
							oForm.sDecor.options[oForm.sDecor.selectedIndex].value +")";
			}else{
         			rObj(i).style.filter="";
			}
		}

		if (rObj(i).id=="title_cell"){
			if (oForm.gradPageTitle.checked) {
      				rObj(i).style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=" + gradTType + ", StartColorStr='" + 
							gradTSColor + "', EndColorStr='" + gradTEColor + "') progid:DXImageTransform.Microsoft.Alpha(Opacity="+sOpacity+", Style=0)";
			}else{
         			rObj(i).style.filter="";
				rObj(i).style.color = document.all.htextcolor.style.backgroundColor;
				rObj(i).style.backgroundColor = "";
				
			}


		}

		if (rObj(i).id=="static_cells"){
			if (oForm.gradTitle.checked) {
      				rObj(i).style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=" + gradHType + ", StartColorStr='" + 
							gradHSColor + "', EndColorStr='" + gradHEColor + "') progid:DXImageTransform.Microsoft.Alpha(Opacity="+sOpacity+", Style=0)";
			}else{
         			rObj(i).style.filter="";
				rObj(i).style.backgroundColor = document.all.maincolor.style.backgroundColor;
			}


		}

		if (rObj(i).id=="sign_input_cells"){
			if (oForm.gradInput.checked) {
      				rObj(i).style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=" + gradIType + ", StartColorStr='" + 
							gradISColor + "', EndColorStr='" + gradIEColor + "') progid:DXImageTransform.Microsoft.Alpha(Opacity="+sOpacity+", Style=0)";
			}else{
         			rObj(i).style.filter="";
				rObj(i).style.backgroundColor = document.all.inputcolor.style.backgroundColor;
			}


		}

		if (rObj(i).id=="view_output_cells"){
			if (oForm.gradMessage.checked) {
      				rObj(i).style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=" + gradMType + ", StartColorStr='" + 
							gradMSColor + "', EndColorStr='" + gradMEColor + "') progid:DXImageTransform.Microsoft.Alpha(Opacity="+sOpacity+", Style=0)";
			}else{
         			rObj(i).style.filter="";
				rObj(i).style.backgroundColor = document.all.areacolor.style.backgroundColor;
			}


		}

		if (rObj(i).id=="input_forms"){
			if (oForm.gradForms.checked) {
      				rObj(i).style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=" + gradFType + ", StartColorStr='" + 
							gradFSColor + "', EndColorStr='" + gradFEColor + "') progid:DXImageTransform.Microsoft.Alpha(Opacity="+sOpacity+", Style=0)";
			}else{
         			rObj(i).style.filter="";
				rObj(i).style.backgroundColor = document.all.inputbcolor.style.backgroundColor;
			}


		}

		if (rObj(i).id=="input_table"|rObj(i).id=="comment_table"){
			
			if (oForm.gradTables.checked) {
      				rObj(i).style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=" + gradTLType + ", StartColorStr='" + 
							gradTLSColor + "', EndColorStr='" + gradTLEColor + "') progid:DXImageTransform.Microsoft.Alpha(Opacity="+sOpacity+", Style=0)";							

			}else{
				if (oForm.decor[1].checked) {
      					rObj(i).style.filter = "progid:DXImageTransform.Microsoft.Shadow(Color=" + document.all.decorcolor.style.backgroundColor + ", Direction=135, Strength=" + 
							oForm.sDecor.options[oForm.sDecor.selectedIndex].value +")";
				}
				if (oForm.decor[2].checked) {
      					rObj(i).style.filter = "progid:DXImageTransform.Microsoft.Glow(Color=" + document.all.decorcolor.style.backgroundColor + ", Strength=" + 
							oForm.sDecor.options[oForm.sDecor.selectedIndex].value +")";
				}
				if (oForm.decor[0].checked) {
      					rObj(i).style.filter = "";
					rObj(i).style.backgroundColor = document.all.tablescolor.style.backgroundColor;
				}
			}
		}


	}

}

function setImage(iType,iLocation,iParent,iAction) {
	var masked = false
	var iImage = iLocation + fImage.value;
	for (r = 0; r < iRepeat.length; r++){
		if (iRepeat(r).checked) {var repeat=iRepeat(r).value; break;}
	}

	for (r = 0; r < vertPos.length; r++){
		if (vertPos(r).checked) {var vert=vertPos(r).value; break;}
	}	

	for (r = 0; r < horPos.length; r++){
		if (horPos(r).checked) {var hor=horPos(r).value; break;}
	}

	if (fImage.value=="") {
		iImage = ""
		document.all.iImage.src=iLocation + "bg/none.gif";
		iParent.document.all[iType+"_ind"].style.backgroundColor="red";
	}else{ 
		document.all.iImage.src = iLocation + fImage.value;
		iParent.document.all[iType+"_ind"].style.backgroundColor="green";
	}
	
	if (iAction) {
		iParent.document.frmColor.elements[iType].value = fImage.value+":"+repeat+":"+vert+":"+hor;
	}else{
		iParent.document.frmColor.elements[iType].value = "";
	}
	
	switch (iType) {	

	case "fImageTitle":
		rObj = iParent.document.frames.design.document.all.item("static_cells");
		if (iParent.document.frmColor.gradTitle.checked) {var masked=true;} break;
	case "fImageInput":
		rObj = iParent.document.frames.design.document.all.item("sign_input_cells");
		if (iParent.document.frmColor.gradInput.checked) {var masked=true;} break;
	case "fImagePost":
		rObj = iParent.document.frames.design.document.all.item("view_output_cells");
		if (iParent.document.frmColor.gradMessage.checked) {var masked=true;} break;
	case "fImageForms":
		rObj = iParent.document.frames.design.document.all.item("input_forms");
		if (iParent.document.frmColor.gradForms.checked) {var masked=true;} break;
	case "fImageTables":
		rObj = iParent.document.frames.design.document.all;
		rObj.input_table(0).style.backgroundImage='url('+iImage+')';
		rObj.input_table(0).style.backgroundRepeat=repeat;
		rObj.input_table(0).style.backgroundPosition=vert+' '+hor;
		rObj.input_table(1).style.backgroundImage='url('+iImage+')';
		rObj.input_table(1).style.backgroundRepeat=repeat;
		rObj.input_table(1).style.backgroundPosition=vert+' '+hor;
		rObj.comment_table(0).style.backgroundImage='url('+iImage+')';
		rObj.comment_table(0).style.backgroundRepeat=repeat;
		rObj.comment_table(0).style.backgroundPosition=vert+' '+hor;
		rObj.comment_table(1).style.backgroundImage='url('+iImage+')';
		rObj.comment_table(1).style.backgroundRepeat=repeat;
		rObj.comment_table(1).style.backgroundPosition=vert+' '+hor;
		if (iParent.document.frmColor.gradTables.checked) {alert("NOTE: Background Image is masked since Gradient filter is enabled for this element.");} 
		return;
	case "fImageForms2":
		rObj = iParent.document.frames.design.document.all.item("fComment");
		rObj.style.backgroundImage='url('+iImage+')';
		rObj.style.backgroundRepeat=repeat;
		rObj.style.backgroundPosition=vert+" "+hor;
		if (iParent.document.frmColor.gradForms.checked) {var masked=true;} break;
	case "fImageButtons":
		rObj = iParent.document.frames.design.document.all.item("buttons");
		if (iParent.document.frmColor.gradButtons.checked) {var masked=true;} break;

	}

      		for (i = 0; i < rObj.length; i++){
			if (rObj(i).className != "comment_input_form") {
	   	    		rObj(i).style.backgroundImage='url('+iImage+')';
				rObj(i).style.backgroundRepeat=repeat;
				rObj(i).style.backgroundPosition=vert+' '+hor;
			}
      		}


	if (masked) {alert("NOTE: Background Image is masked since Gradient filter is enabled for this element.");}

}

function setbg(bg,iLocation){

	var oForm = document.bgrd;
	var designStyle = window.opener.document.frames.design.document.body.style;

	document.all[oForm.currentImage.value].style.border = "4px solid #9FAB9E";
	document.all[bg].style.border = "4px solid #FF0000";
	document.bgrd.currentImage.value = bg;

	if (bg=="none") {
		window.opener.document.frmColor.bgrd.value="none";
		designStyle.backgroundImage = "url()";
		return;
	}
	
	var newImage = iLocation+"bg/"+bg;
	for (i = 0; i < oForm.bgstyle.length; i++){
		if (oForm.bgstyle(i).checked) {var repeat=oForm.bgstyle(i).value;break;}
	}

	for (i = 0; i < oForm.bgvpos.length; i++){
		if (oForm.bgvpos(i).checked) {var vPos=oForm.bgvpos(i).value;break;}
	}

	for (i = 0; i < oForm.bghpos.length; i++){
		if (oForm.bghpos(i).checked) {var hPos=oForm.bghpos(i).value;break;}
	}
	
	if (oForm.bgfixed.checked) {
		var iAttach = "fixed";
	}else{
		var iAttach = "scroll";
	}
		

	window.opener.frmColor.bgrd.value = bg+":"+repeat+":"+iAttach+":"+vPos+":"+hPos;
	designStyle.backgroundImage = "url("+newImage+")";
	designStyle.backgroundRepeat = repeat;
	designStyle.backgroundPosition = vPos+" "+hPos;
	designStyle.backgroundAttachment = iAttach;
}

function resolve(oForm) {

	if (oForm.checked & document.frmColor.decor[1].checked|document.frmColor.decor[2].checked) {
			alert("Note: Enabling Gradient filter for Tables will override and disable Global Decor settings!");
			return true;
	}
}

function resolve1(oForm) {

	if (oForm.checked & document.frmColor.gradTables.checked) {
			alert("Note: Global Decor filter cannot be set. Gradient filter for Tables overrides this setting!");
			return true;
	}
}
//-->



