<!-- //Stealth on
<!-- //Stealth on
var whitespace 		= " \t\n\r";

function isEmpty(s)
{
   return ((s == null) || (s.length == 0))
}
function isWhitespace (s)
{  
	var i;
	// Is s empty?
	if (isEmpty(s)) return true;

	 // Search through string's characters one by one
	 // until we find a non-whitespace character.
	 // When we do, return false; if we don't, return true.
	 for (i = 0; i < s.length; i++)
	 {   
		 // Check that current character isn't whitespace.
		 var c = s.charAt(i);
 
		 if (whitespace.indexOf(c) == -1) return false;
	 }
 
	 // All characters are whitespace.
	 return true;
}
function display(id,dis){
        document.getElementById(id).style.display = dis;
}

function display_style(id,dis){
        document.getElementById(id).style.display = dis;
}

function display_styles(ids,style) {
	var ids_array = ids.split(",");
	for (var i = 0;i<ids_array.length;i++) {
		display(ids_array[i],style);
	}
}

function display_class(id,classname) {
	document.getElementById(id).className = classname;
}

function display_classes(ids,classname) {
	var ids_array = ids.split(",");
	for (var i = 0;i<ids_array.length;i++) {
		display_class(ids_array[i],classname);
	}
}

function toggleCheckBoxById(name,id) {
        var checkboxGroup = document.getElementsByName(name);
        for (var c = 0; c < checkboxGroup.length; c++) {
                if (checkboxGroup[c].id == id) {
                        checkboxGroup[c].checked = false;
                        checkboxGroup[c].disabled = checkboxGroup[c].disabled == false ? true : false;
                }
        }
}

function toggleCheckBoxByName(name, disable) {
        var checkboxGroup = document.getElementsByName(name);
        for (var c = 0; c < checkboxGroup.length; c++) {
                checkboxGroup[c].checked = false;
                checkboxGroup[c].disabled = disable ? true : false;
        }
}

function updateInnerHTML(value,target) {
	var newtext = value.replace(/\n/g,"<br>");
	document.getElementById(target).innerHTML = newtext;
/*
	var cell = document.all ? document.all[target] // IE4+
		: document.getElementById ? document.getElementById(target) // NN6
		: null; // no DOM access for other browsers

	cell.innerHTML = newtext;
*/
}

function toggleClass(control_id,id,classname) {
	var on = document.getElementById(control_id).checked;
	if (on) {
		display_class(id,classname);
	} else {
		display_class(id,'');
	}
}

function toggleHTML(control_id,target,html1,html2) {
	var on = document.getElementById(control_id).checked;
	if (on) {
		 updateInnerHTML(html1,target);
	} else {
		 updateInnerHTML(html2,target);
	}
}

function loadForm() {
		updateInnerHTML(document.theForm.contact.value,'contact_list');
		updateInnerHTML(document.theForm.company.value,'company_list');
		updateInnerHTML(document.theForm.dphone.value,'dphone_list');
		updateInnerHTML(document.theForm.address.value,'address_list');
		updateInnerHTML(document.theForm.description.value,'description_list');
		updateInnerHTML(document.theForm.offer.value,'offer_list');
		updateInnerHTML(document.theForm.offer_title.value,'offer_title_list');
		updateInnerHTML(document.theForm.email.value,'email_list');
		updateInnerHTML(document.theForm.website.value,'website_list');
		toggleClass('toggle_bold','company_list','bold');
		toggleClass('toggle_bold','contact_list','bold');
		toggleClass('toggle_bold','dphone_list','bold');
		toggleClass('website_link','website_list','underline');
		toggleClass('email_link','email_list','underline');
		toggleHTML('top_placement', 'top_placement_toggle', 'This listing will be rotated in top placement.','');


}

// -->

