
	function getProperties(propertyType) {
	
		if(propertyType == 'fullURL') {
			return 'http://217.77.6.104/';
		}

	}

	function setPageCreateSuccessURL(url) {
		document.form1.createSuccessUrl.value = url;
	}
	
	function setPageUpdateSuccessURL(url) {
		document.form1.updateSuccessUrl.value = url;
	}
	
	function setCreateSuccessURL(success_url, theID)
	{
		document.form1.createSuccessUrl.value = success_url + "?id=" + theID;	
	}
	
	function setUpdateSuccessURL(success_url, theID) {	
		document.form1.updateSuccessUrl.value = success_url + "?id=" + theID;
	}
	
	function setUpdateURL(url) {
	
		
		document.form1.updateSuccessUrl.value = url;
		
	}
	
	function setCreateURL(url, name, today, message) {

		document.form1.comments.value = "<tr><td class=general><b>USER: </b>" + name + "<br><b>DATE:</b> " + today + " <br>" + message + "</td></tr><tr><td><img src=\"../images/grey.gif\" width=100% height=1 alt=\"\" border=\"0\"></td></tr>";
		
		document.form1.createSuccessUrl.value = url;
	}
	
	function setAllFarming() {
		if(document.form1.checkbox[0].checked) {
			document.form1.checkbox[1].checked = 'true';
			document.form1.checkbox[2].checked = 'true';
			document.form1.checkbox[3].checked = 'true';
			document.form1.checkbox[4].checked = 'true';
		}
	}
	
	function setAllRegions() {
		if(document.form1.checkboxRegions[0].checked) {
			document.form1.checkboxRegions[1].checked = 'true';
			document.form1.checkboxRegions[2].checked = 'true';
			document.form1.checkboxRegions[3].checked = 'true';
			document.form1.checkboxRegions[4].checked = 'true';
			document.form1.checkboxRegions[5].checked = 'true';
			document.form1.checkboxRegions[6].checked = 'true';
			document.form1.checkboxRegions[7].checked = 'true';
			document.form1.checkboxRegions[8].checked = 'true';
			document.form1.checkboxRegions[9].checked = 'true';
			document.form1.checkboxRegions[10].checked = 'true';
			document.form1.checkboxRegions[11].checked = 'true';	
			document.form1.checkboxRegions[12].checked = 'true';
		}	
	
	}
	
	function setAllCheckBoxes(name,test, from, to) {
		if(name[test].checked) {
			for(var i=from;i<=to;i++) {
			
				name[i].checked = 'true';
			}
		
		}
		
		
	
	}
	
	function testFnc() {
		alert('test fnc running');
	}
	
	function setSendToEditorSuccessURL(success_url, theValue) {	
		document.form1.updateSuccessUrl.value = success_url;
		document.form1.status.value = theValue;
	}


	function setEditLinkValues(setModeAs, id) {
		
		document.form1.mode.value = setModeAs; 
		document.form1.repID.value = id;
	}
	
	function handleReviewError() {
	
		window.open("pageunloaderror.jhtml", "" , "toolbar=no,location=no,directories=no,width=550,heigth=400");
	
	}
	
	function setPreferences(Update) {
		
		if(Update != 'yes') 
		{
			var theCategory = "";
			var tOB = document.form1.typeofbusiness.value;
			
			var news_preferences = new Array(1);
			news_preferences[0] = tOB;
			document.form1.news_preferences.value = news_preferences;
			document.form1.events_preferences.value = news_preferences;
			document.form1.pr_preferences.value = news_preferences;
		}	
		return;
	
	}
	
	function openWindow(theWidth, theHeight, theURL) {
		winSettings ='toolbar=no,location=no,directories=no,width='+theWidth+',height='+theHeight+',left=50,top=50';
		var floater = window.open(theURL,"",winSettings);						  
	}
	

	
	function getChecked() {
	
		var checkedIDs = document.form1.items_checked[0].value;
		var numBoxes = document.form1.items_checked.length;
		var final_string = ""
		for(var i=0;i<numBoxes;i++) {
			
				if(document.form1.items_checked[i].checked) {
					if(i > 0)
					{
						final_string = document.form1.items_checked[i].value + "," + final_string;
					} else {
						final_string += document.form1.items_checked[i].value;
					}
					
				}

		}
		
		document.form1.checkedItems.value = final_string;

	}
	
	function setHandlerMode(theMode) {
		getChecked();
		document.form1.mode.value = theMode; 
	}
	
	
	
	function updateComments(userName, theDate) {							
			document.form1.comments.value = document.form1.comments.value + "<tr><td class=general><b>USER: </b>" + userName + "<br><b>DATE:</b> " + theDate + " <br>" + document.form1.current_comment.value  + "</td></tr><tr><td><img src=\"../images/grey.gif\" width=100% height=1 alt=\"\" border=\"0\"></td></tr>";
		
	}

	function logCommentEvent(userName, theDate, comment) {
		document.form1.comments.value = document.form1.comments.value + "<tr><td class=general><b>USER: </b>" + userName + "<br><b>DATE:</b> " + theDate + " <br>" + comment  + "</td></tr><tr><td><img src=\"../images/grey.gif\" width=100% height=1 alt=\"\" border=\"0\"></td></tr>";

	}



	function transferSelected(select1, select2){
		var selectedIndex = select1.selectedIndex;
		if(selectedIndex != -1){
			var options = select1.options;
		
			for(var i=0; i<options.length; i++){
				var current = options[i];
				if(current.selected){
					options.remove(i);
					select2.options.add(current);
					
					i--;
				}
			}
		}
	}
	
	function addACG(){
		transferSelected(document.form1.available_groups, document.form1.access_control_groups);
	}
	
	function removeACG(){
		transferSelected(document.form1.access_control_groups, document.form1.available_groups);
	}
	
	function transferPartnerSelected(select1, select2){
		var selectedIndex = select1.selectedIndex;
		if(selectedIndex != -1){
			var options = select1.options;
		
			for(var i=0; i<options.length; i++){
				var current = options[i];
				if(current.selected){
					options.remove(i);
					select2.options.add(current);
					i--;
				}
			}
		}
	}

	//Step through a select field and clear all options
	function clearOptions(fieldName) {
	
		var options = fieldName.options;
		for(var i=0;i<options.length;i++) {
			var current = options[i];
			options.remove(i);
			i--;
			
		}
		
	}

	
	//Transfer selected items from 1 select box to another, but don't remove the old ones and don't allow duplicates
	function transferSelectedNoRemove(select1, select2) {

		var selectedIndex = select1.selectedIndex;
				
		if(selectedIndex != -1){
			//The available options
			var options = select1.options;
		
			//Step through each available option
			for(var i=0; i<options.length; i++){
				var current = options[i];
				if(current.selected){
						//check against current entries
						var currentOptions = select2.options;
						var alreadyExists = false;
						for(var j=0; j<currentOptions.length; j++){
							
							if(currentOptions[j].innerHTML == current.innerHTML) {
								alreadyExists = true;
							}
						
						}
						
						if(!alreadyExists) {
							//var option = new Option(current.innerHTML,current.innerHTML);
      						//select2.options.add(option);
							
							var oOption = document.createElement("OPTION");
							select2.options.add(oOption);
							oOption.innerText = current.innerHTML;
							oOption.Value = current.innerHTML;
							oOption.selected=true;
							
							
						}	
				}
			}
		}


	}


	function swapTeaserLayers(imgSrc, theAltText) {

	
		yesimage.style.visibility = 'visible';
		noimage.style.visibility = 'hidden';
		document.form1.theimage.src = imgSrc;
		document.form1.theimage.alt = theAltText;		

	}
	
	function deleteTeaserImage() {

		document.form1.uploaded_image_name.value = "";
		document.form1.uploaded_image_alt_text.value = "";
		yesimage.style.visibility = 'hidden';
		noimage.style.visibility = 'visible';
		

	}
	

	// Removes the selcted values
	function removeSelected(select1){
		var selectedIndex = select1.selectedIndex;
		if(selectedIndex != -1){
			var options = select1.options;
		
			for(var i=0; i<options.length; i++){
				var current = options[i];
				if(current.selected){
					options.remove(i);
					i--;
				}
			}
		}
	}
	
	function selectAll(selectName) {
		var options = selectName.options;
		for(var i=0; i<options.length; i++){
			options[i].selected=true;
		}
	}	
	
		
	
	
	function addPartner(){
		//transferPartnerSelected(document.form1.availPartners, document.form1.companyNames);
		var selectedIndex = document.form1.availPartners.selectedIndex;
				
		if(selectedIndex != -1){
			//The available options
			var options = document.form1.availPartners.options;
		
			//Step through each available option
			for(var i=0; i<options.length; i++){
				var current = options[i];
				if(current.selected){
						//check against current entries
						//var currentOptions = document.form1.companyNames.options;
						var currentOptions = document.form1.companyNames.options;
						var alreadyExists = false;
						for(var j=0; j<currentOptions.length; j++){
							
							if(currentOptions[j].innerHTML == current.innerHTML) {
								alreadyExists = true;
							}
						
						}
						
						if(!alreadyExists) {
							//var option = new Option(current.innerHTML,current.innerHTML);
							
							var oOption = document.createElement("OPTION");
							document.form1.companyNames.options.add(oOption);
							oOption.innerText = current.innerHTML;
							oOption.Value = current.innerHTML;
							oOption.selected=true;
							
							
						}	
				}
			}
		}
	}
	
	function removePartner(){
		var selectedIndex = document.form1.companyNames.selectedIndex;
		if(selectedIndex != -1){
			var options = document.form1.companyNames.options;
		
			for(var i=0; i<options.length; i++){
				var current = options[i];
				if(current.selected){
					options.remove(i);
					i--;
				}
			}
		}
	}
	
	function setEmail() {
	
		document.form1.email.value = document.form1.login.value;
	
	}
	
	function NewWindow(mypage, myname, w, h, scroll) {
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
		win = window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}
	
