function confirmSubmit(iMessage){
	var message = new Array();
		message[0]="You are about to take this link off of this page.  Are you sure you want to continue?";
		message[1]="You are about to delete this page.  Are you sure you want to continue?";		
		message[2]="You are about to delete this user. Do you wish to continue?";
		message[3]="This change will update this link on every page it is used. Are you sure you want to continue?";
		message[4]="If you delete this link it will also delete the link off of every page it is on. Are you sure you want to continue?";
		message[5]="You are about to delete this request. Do you wish to continue?";
		message[6]="You are about to delete this file. Do you wish to continue?";
		message[7]="You are about to delete this legislator.  Do you wish to continue?";
		message[8]="You are about to delete this chapter. Do you wish to continue?";
		message[9]="You are about to delete this form letter. Do you wish to continue?";
	var agree=confirm(message[iMessage]);
	if (agree)
		return true ;
	else
		return false ;
}

function toggleBox(szDivID, iState){ // 1 visible, 0 hidden
   	if(document.layers){ //NN4+
      		document.layers[szDivID].visibility = iState ? "show" : "hide";
   	}else if(document.getElementById){ //gecko(NN6) + IE 5+
   		var obj = document.getElementById(szDivID);
       	obj.style.visibility = iState ? "visible" : "hidden";
  	 	}else if(document.all){	//IE 4
   		document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
   	}
}
function changeHelp(iHelp) {
   	var help = new Array();
	help[0]='Page Type +++ Determines the display layout of the page.';
	help[1]='Parent Page +++ The content of the site is structured according to Parent-Children relationships. You must choose a Parent page for this page (unless this is a Master page). This page then becomes a Child of the its Parent page, and a link will automatically be added to the Parent page to this page.\\rFor example, if this is a Product Detail page, it should be assigned a Product List page as a Parent. Then this product will automatically appear in its Parent\'s product list.';
   	help[2]='Cutline +++ The cutline will appear below the picture in the Enlarged Picture Pop-up Box, which appears when a user places their cursor over the picture.';
   	help[3]='URL +++ To make a picture link to another web page, enter the URL of that page here.';
   	var parts = new Array();
	parts = help[iHelp].split(' +++ ');
   	helpTitle = parts[0];
   	helpBody = parts[1];
   	var content = '<h1>Help </h1><h2>' + helpTitle + ':</h2><p>' + helpBody + '</p>';
    document.getElementById("help").innerHTML = content;
}

function disableLinks(){
	var x=document.getElementById("type");

	if (x.selectedIndex == 1){
		document.getElementById("url").disabled=true;
		document.getElementById("file").disabled=false;
	}else{
		document.getElementById("url").disabled=false;
		document.getElementById("file").disabled=true;
	}
}

function disable(selectId, textId){
	var x=document.getElementById(selectId);
	var fields = new Array();
	fields = textId.split(', ');
	if (x.selectedIndex == 1){
		for (x in fields){
			y = document.getElementById(x).disabled=false;
		}
	}else{
		for (x in fields){
			y = document.getElementById(x).disabled=true;
		}
	}
}
function checkall(fields){
	var ids = new Array();
	ids = fields.split(',');
	l = ids.length;
	for(var i=0; i<l; i++){
		var ele = 'a_'+ids[i];
		document.getElementById(ele).checked = true;
	}
}