function setSelectedChecks() { 	
	for(var i = 0, max = doSelectIds.length; i < max; ++i) {
		if(document.getElementById(doSelectIds[i]) ) {
			try {
			document.getElementById(doSelectIds[i]).checked = true;
			} catch(err) {}
		}
	}	
	return;
}


function popupWin (name, url, title, width, height, closemsg) {
	var popupwin = dhtmlwindow.open(name, "iframe", url, title, "width="+width+"px,height="+height+"px,resize=1,scrolling=1,center=1", "recal");
	
	try {
	var winname = eval('window.'+name);
	} catch(err) {}

	winname = popupwin;
	
	popupwin.onclose=function(){return window;}
}


function popupSuccess() {
	window.opener.location.href = window.opener.location.href;
	window.close();
}


function setParentFormActionName(name) {
	if(parent.document.getElementById('frmaction') != null) {
		parent.document.getElementById('frmaction').name = name;
	}
}



function useWeddingDetails () {
	// Used on Registration, Stage 2 : Copies all the INPUT fields over to reception fields
	
	var frmWedding = document.getElementById("event_wedding").getElementsByTagName("input");
	var frmReception = document.getElementById("event_reception").getElementsByTagName("input");
	
	for (var i=0; i < frmWedding.length; i++) {
	 	if (document.getElementById("useDetails").checked) {
			frmReception[i+1].value = frmWedding[i].value;
		} else {
			frmReception[i+1].value = "";
	 	}
	}	
	// Clear CONTINUE button
	document.getElementById("continue").value = "";
	
}// end function


function showAll(checkboxArea, showAllMarker) {
	// Used on Website Designs and Stage 4
	var frmDesigns = document.getElementById(checkboxArea).getElementsByTagName("input");
	

	for (var i=0; i < frmDesigns.length; i++) {
		if (document.getElementById(showAllMarker).checked) {
			frmDesigns[i].checked = true;				
		} else {
			frmDesigns[i].checked = false;
			frmDesigns[i].className = "";
	 	}
	}	
	
	if (document.getElementById(showAllMarker).checked) {
		//alert ("checked all");
		document.forms[0].submit();
	}
}// end function


function editComment(id) {
	if ($('#comment'+id+' #editFlag').attr('value') == 0) {		
		$('#comment'+id+' #editFlag').attr('value', 1);	
		
		
		$('#comment'+id+' .edit').addClass('hide');			
		$('#comment'+id+' .save').removeClass('hide');
		
		$('#comment'+id+' .commenttext').css('display','none');			
		var commentText = $('#comment'+id+' .commenttext').html();				

		$('#comment'+id+' #editArea').append('<textarea class="edittext active" cols="60" rows="3" name="media_comment.message'+id+'">' + commentText + '</textarea>');
	
	}	
}// end function


function inviteReveal (value) {
/*	
	switch (value) {
		case "invites.invite_status" :
			$('#textSearch').addClass('hide'); 
			$('#inviteResponse').removeClass('hide'); 
			
			break;
		default:
			$('#inviteResponse').addClass('hide'); 
			$('#textSearch').removeClass('hide'); 
			$('#textSearch').attr('value', '');
			break;
	}	
*/
	
}// end function



