﻿/*
copy and paste the ActionItems object to your page and set the values appropraitly

ActionItems = {
	plan_btn:{click:doSomething },
	more_lnk:{url: "nextpage.php" },
	phone_inpt:{keyup: function(e){doSomething(e.value)} },
	textField:{change: function(e){validateInput(e.value)} },
	links:{sel:'a', click:doSomething, stop:true }
}

*/
var ActionItems=0;function ActivateActions(item){var o=ActionItems[item];var i=o.sel?$(o.sel):$("#"+item);if(o.hov||o.click||o.url)i.css("cursor","pointer");if(o.up)if(o.hov)i.hover(function(){this.style.backgroundPosition=o.hov;},function(){this.style.backgroundPosition=o.up;});else i.mouseout(function(){this.style.backgroundPosition=o.up;});if(o.dwn)i.mousedown(function(){this.style.backgroundPosition=o.dwn});if(o.keyup)i.keyup(function(){o.keyup(this)});if(o.change)i.change(function(){o.change(this);if(o.stop)return false;});if(o.url)i.click(function(){location=o.url;return false;});if(o.click)i.click(function(){o.click(this);if(o.stop)return false;});}$(document).ready(function(){if(ActionItems)for(var item in ActionItems)ActivateActions(item);});function $E(id){if($(id)[0])return $(id)[0];return 0;}function $F(id,val){var e=0;if(id.substr(0,1)=='#')e=$E(id);else e=$("[name='"+id+"']")[0];if(!e)return;var flag=(val&&(val!=true||val!=false));switch(e.type){case 'textarea':case 'submit':case 'reset':case 'file':case 'hidden':case 'password':case 'text':if(val)e.value=val;return e.value;case 'select-multiple':case 'select-one':var index=e.selectedIndex;if(index<0){for(i=0;i<e.length;i++)if(e[i].value==val){e[i].selected=true;return val;}return "";}if(val&&(e[e.selectedIndex].value!=val))for(i=0;i<e.length;i++)if(e[i].value==val){e[i].selected=true;break;}return e[e.selectedIndex].value;case 'radio':if(id.substr(0,1)=='#'){if(flag)e.checked=val;else if(val)e.value=val;return e.checked;}else{var group=$("input[name='"+id+"']");if(val){for(i=0;i<group.length;i++)if(group[i].value==val)group[i].checked=true;}for(i=0;i<group.length;i++)if(group[i].checked)return group[i].value;return;}case 'checkbox':if(flag)e.checked=val;else if(val)e.value=val;return e.checked;}}document.write('<meta http-equiv="imagetoolbar" content="no">');