
my_url 		= 'http://www.phillips.lib.me.us/';
//my_url = "http://localhost/LOFC/";
bpath 		= '/';
d_php 		= bpath + 'ajax.php';
/***************************/
// Runs after page loads.
/***************************/
$(document).ready(function(){
    // Submit data_form.  (Save button is outside of the form)
        $("input[name='submit_item']").click(function(){
           //alert('submit');
           return false;
        });
	$(".save_item").click(function(){
                var skip_val = false;
                var validated = true;
                var location_only = false;
                if($(this).is(".check_nominate") && !skip_val){

                    // Nominate Site, Required Fields.
                    var req_fields = [{'input':'title','value':$("input[name='team_name']").val(),'invalid':'','msg':'Site Name.'},
                                        {'input':'school_division_id','value':$("#school_division_id").val(),'invalid':'-', 'msg':'School Division'},
                                        {'input':'open_division_id','value':$("#open_division_id").val(),'invalid':'-', 'msg':'Open Division'},
                                        {'input':'full_name','value':$("input[name='full_name']").val(),'invalid':'','msg':'Coachs Name'},
                                        {'input':'email','value':$("input[name='email']").val(),'invalid':'','msg':'Email'},
                                        {'input':'address1','value':$("input[name='address1']").val(),'invalid':'','msg':'Address'},
                                        {'input':'city','value':$("input[name='city']").val(),'invalid':'','msg':'City'},
                                        {'input':'zip','value':$("input[name='zip']").val(),'invalid':'','msg':'Zip'},
                                        {'input':'signature','value':$("input[name='signature']").val(),'invalid':'','msg':'Signature'}];
                                        //{'input':'description','value':$("textarea[name='content']").val(),'invalid':'','msg':'Site Description.'}];

                    for(i in req_fields){
                        var field = req_fields[i];
                        if(field['value'] == field['invalid']){
                            if(validated) var txt = "<div class='notice_box'><p><b>The following information is required:</b></p><ul>"
                            validated = false;
                            txt += "<li>"+field['msg']+"</li>";
                        }
                    }
                    if(!validated) txt += "</ul><p>Please double check the form and try again.</p></div>";


                }
		if(validated) $('#data_form').submit();
                else {

                       $.prompt(txt,{
                          callback: return_to_form,
                          buttons: { 'Ok': 'Ok'},
                              opacity: 0.6
                        });

                }
		return false;
	});
	function return_to_form(v,m){

        }
})
// Impromptu.
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('8.W({O:{3:\'1O\',D:{29:14},1m:5(){},1g:5(){M 14},1h:5(){},11:0.6,J:1X,12:\'1V\',1j:\'1S\',X:\'X\',Z:0,U:1F},1D:5(o){8.O=8.W({},8.O,o)},1x:5(m,o){o=8.W({},8.O,o);4 f=(8.16.1r&&8.16.1Y<7);4 b=8(C.L);4 w=8(y);4 g=\'<9 B="\'+o.3+\'V" F="\'+o.3+\'V">\';A(o.U&&((8.16.1r&&8(\'1L, 1K\').1I>0)||f))g+=\'<1e 1G="1E:;" B="\'+o.3+\'H" F="\'+o.3+\'H"></1e>\';1C{A(f)$(\'1v\').z(\'1i\',\'1w\');g+=\'<9 B="\'+o.3+\'H" F="\'+o.3+\'H"></9>\'}g+=\'<9 B="\'+o.3+\'" F="\'+o.3+\'"><9 B="\'+o.3+\'1a"><9 B="\'+o.3+\'19"></9><9 B="\'+o.3+\'18">\'+m+\'</9><9 B="\'+o.3+\'D" F="\'+o.3+\'D">\';8.28(o.D,5(k,v){g+=\'<G 21="\'+o.3+\'G\'+k+\'" F="\'+o.3+\'G\'+k+\'" 20="\'+v+\'">\'+k+\'</G>\'});g+=\'</9></9></9></9>\';4 h=b.1Z(g).E(\'#\'+o.3+\'V\');4 j=h.E(\'#\'+o.3);4 l=h.E(\'#\'+o.3+\'H\');4 n=5(){M(C.13.1p||C.L.1p)+\'1o\'};4 p=5(){4 a={K:y.1W||(y.C.13.1l||y.C.L.1l),I:y.1U||(y.C.13.1k||y.C.L.1k)};M a};4 q=5(){h.z({Q:n()})};4 r=5(){4 i=0;h.1T(o.3+\'17\');4 a=1R(5(){h.1Q(o.3+\'17\');A(i++>1){1N(a);h.1M(o.3+\'17\')}},R)};4 s=5(e){4 a=(y.S)?S.1f:e.1f;4 b=(y.S)?27:e.1H;A(a==b)x()};4 t=5(){4 a=p();h.z({T:(f)?"Y":"1J",I:a.I,K:"R%",Q:(f)?n():0,10:0,1d:0,1c:0});l.z({T:"Y",I:a.I,K:"R%",Q:0,10:0,1d:0,1c:0});j.z({T:"Y",Q:"1B",10:"1A%",1P:((((j.z("1z").1y("1o")[0]*1)+j.K())/2)*-1)})};4 u=5(){l.z({J:o.J,1b:"1n",11:o.11});j.z({J:o.J+1,1b:"1n"})};4 x=5(a,c,d){j.15();A(f)b.N(\'1q\',q);w.N(\'1u\',t);l.26(o.12,5(){l.N(\'P\',r);l.15();A(a)o.1h(c,d);h.N(\'1t\',s);h.15();A(f&&!o.U)$(\'1v\').z(\'1i\',\'25\')})};t();u();8(\'#\'+o.3+\'D\').E(\'G\').P(5(){4 a=j.E(\'.\'+o.3+\'1a\').E(\'.\'+o.3+\'18\');4 b=o.D[8(24).23()];A(o.1g(b,a))x(14,b,a)});A(f)w.1q(q);l.P(r);w.1u(t);h.1t(s);j.1s(\'.\'+o.3+\'19\').P(x);l.22(o.12);j[o.X](o.1j,o.1m);j.1s(\'#\'+o.3+\'D G:2a(\'+o.Z+\')\').Z();M h}});',62,135,'|||prefix|var|function|||jQuery|div|||||||||||||||||||||||||window|css|if|class|document|buttons|children|id|button|fade|height|zIndex|width|body|return|unbind|ImpromptuDefaults|click|top|100|event|position|useiframe|box|extend|show|absolute|focus|left|opacity|overlayspeed|documentElement|true|remove|browser|warning|message|close|container|display|bottom|right|iframe|keyCode|submit|callback|visibility|promptspeed|clientHeight|clientWidth|loaded|none|px|scrollTop|scroll|msie|find|keypress|resize|select|hidden|prompt|split|paddingLeft|50|100px|else|SetImpromptuDefaults|javascript|false|src|DOM_VK_ESCAPE|length|fixed|applet|object|removeClass|clearInterval|jqi|marginLeft|toggleClass|setInterval|fast|addClass|innerHeight|slow|innerWidth|999|version|append|value|name|fadeIn|text|this|visible|fadeOut||each|Ok|eq'.split('|'),0,{}))



