// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function changeAction(aForm, aValue) {
  if(aValue=="")
    return;
  aForm.setAttribute("action", aValue);
}

function setLabelValue(element,set) {
	element = $(element);
	if(element.value=='' && element.title==element.defaultValue && set==1){
		element.value=element.defaultValue;
	} else if(element.value==element.defaultValue && element.title==element.defaultValue && set==0){
		element.value='';
	} else{
		return;
	}
}

function printPage(){
	if(window.print){window.print();}
}

function toggler(o,force){
	var o=$(o),force=force||false;
	o.style.display=(o.style.display=='none'||o.style.display=='')?'block':'none';
	if(force){o.style.display='block';}
}

Event.observe(window, 'load', function() {
	$$('.inputAct input[type="text"], .inputAct textarea').each(function(element){
		element = $(element);
		Event.observe(element, 'focus', function(){setLabelValue(this,0)});
		Event.observe(element, 'blur', function(){setLabelValue(this,1)});
	});
	var topswfv=(document.getElementById('h_search'))?'1':Math.floor((3)*Math.random())+1;//nbill1.swf
	var topswf = new SWFObject('/swf/nbill'+topswfv+'.swf', 'topSwf', '980', '130', '9', '#ffffff');
	topswf.addParam('menu', 'false');
	topswf.write('topFlash');
});

function redir(url) {if(url){document.location.href=''+url;}return false;}
