// adds iPhone css for iPhones or Android Phones and BlackBerrys if( (navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('Android') != -1) || ( navigator.userAgent.indexOf('BlackBerry') != -1 ) ) { // iPhone layout var cssNode = document.createElement('link'); cssNode.setAttribute('rel', 'stylesheet'); cssNode.setAttribute('type', 'text/css'); cssNode.setAttribute('href', 'http://cadistrict38.org/wp/wp-content/themes/seams3/iPhone1.css'); cssNode.setAttribute('media', 'all'); document.getElementsByTagName('head')[0].appendChild(cssNode); // iPhone fonts var cssNode = document.createElement('link'); cssNode.setAttribute('rel', 'stylesheet'); cssNode.setAttribute('type', 'text/css'); cssNode.setAttribute('href', 'http://cadistrict38.org/wp/wp-content/themes/seams3/fonts_iphone.css'); cssNode.setAttribute('media', 'all'); document.getElementsByTagName('head')[0].appendChild(cssNode); } // end if jQuery().ready(function($){ // if blackberry hide switcher if( navigator.userAgent.indexOf('BlackBerry') != -1 ) { $('#switcher').hide(); } // end if // put all links in headerbar to target=_blank unless specified $('#headerbar a').each( function(i) { if($(this).html() != 'Site Admin' && $(this).html() != 'Log out' && $(this).html() != 'Log in') { $(this).attr('target', '_blank'); } } // end function ); // end each // animates links in pages menu $('.pages a').hover( function() { // $(this).animate({marginLeft: '-25px'}, 750); }, // end function function() { // $(this).animate({marginLeft: '0px'}, 750); } // end function ); // end hover // removes background and padding from img links in posts // css adds background and padding to some via attribute selectors $('.post p a img').parent().css({'background-image' : 'none', 'padding-right' : '0px'}); // adds microformat classes to each league in sidebar_b $('.leagues a').addClass('fn org url'); $('#email_subscribe').focus( function(){ if( $(this).val() == 'enter your e-mail address' ) $(this).val(''); } // end function ); // end focus $('#email_subscribe').blur( function(){ if( $(this).val() == '' || $(this).val() == null) $(this).val('enter your e-mail address'); } // end function ); // end blur /* feedburner's inline javascript repurposed for jQuery -------------------------------------------------------------------------------- */ $('#subscribe_form').attr('target', 'popupwindow'); $('#subscribe_form').submit( function() { window.open('http://feedburner.google.com/fb/a/mailverify?uri=CaliforniaDistrict38', 'popupwindow', 'scrollbars=yes,width=550,height=520'); return true; } // end function ); // end submit /* end feedburner's inline javascript repurposed for jQuery -------------------------------------------------------------------------------- */ // adds iPhone css switcher for iPhones and Android if( (navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('Android') != -1) ) { // iPhone css switcher $('#switcher').click( function() { // styles switcher link for mobile and classic look of site $('#switcher').css({'display' : 'block', 'font-size' : '34pt', 'line-height' : '115%', 'text-align' : 'center', 'display' : 'block', 'background-color' : '#dddddd'}); // grabs all of the link tags linkTags = $('link'); // cycles through all of the link tags for(i=0; i