
function inputCheck(smartInputId){if($(''+smartInputId)){var initialValue=$(''+smartInputId).readAttribute('initialvalue');var actualValue=$(''+smartInputId).getValue();return(initialValue!=actualValue);}
return true;}
function setSmartButtons(){$$(".smartButton").each(function(elmt){handleSmartButton(elmt,'smartButton');});$$(".smartSubmit").each(function(elmt){handleSmartButton(elmt,'smartSubmit');});}
function handleSmartButton(smartButton,type){var classToRemove=type;var classToAdd='Z'+type;if(smartButton.hasClassName('img')){setSmartIMGButton(smartButton);}else{var smartButtonValue=Form.Element.getValue(smartButton);if(smartButtonValue!="ok"){wrapSmartButton(smartButton,classToAdd);}else{setSmartOKButton(smartButton);}}
smartButton.removeClassName(classToRemove);smartButton.addClassName(classToAdd);}
function wrapSmartButton(smartButton,classToAdd){var nodTd1=new Element('td',{'class':'Zleft'}).update('&nbsp;');var nodTd2=Element.wrap(smartButton,'td',{'class':'Zmiddle'});var nodTd3=new Element('td',{'class':'Zright'}).update('&nbsp;');var nodTr=Element.wrap(nodTd2,'tr');Element.insert(nodTr,{top:nodTd1});Element.insert(nodTr,{bottom:nodTd3});var nodTbody=Element.wrap(nodTr,'tbody');var nodTable=Element.wrap(nodTbody,'table');var nodSpan=Element.wrap(nodTable,'span',{'class':classToAdd});}
function setSmartOKButton(smartButton){smartButton.removeClassName('ok');smartButton.addClassName('Zok');}
function setSmartIMGButton(smartButton){smartButton.removeClassName('img');smartButton.addClassName('Zimg');}
