
/*jQueryスワップ*/

function initRollOverImages() {
  var image_cache = new Object();
  $("img.swap").each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_on = this.src.substr(0, dot) + '_over' + this.src.substr(dot, 4);
    image_cache[this.src] = new Image();
    image_cache[this.src].src = imgsrc_on;
    $(this).hover(
      function() { this.src = imgsrc_on; },
      function() { this.src = imgsrc; });
  });
}

$(document).ready(initRollOverImages);

/*jQueryロールオーバー*/

$(document).ready(function(){  
$("img.hover").fadeTo(0,1.0);  
$("img.hover").hover(function(){  
        $(this).fadeTo(400,0.85);  
    },  
    function(){  
        $(this).fadeTo(300,1.0);  
    });  
});  

/*jQueryロールオーバー2*/

$(document).ready(function(){  
$("img.hover2").fadeTo(0,1.0);  
$("img.hover2").hover(function(){  
        $(this).fadeTo(300,0.70);  
    },  
    function(){  
        $(this).fadeTo(300,1.0);  
    });  
});  
 
 /*for エラー: jQuery.dequeue is not a function*/
 
 ( function( $ ) { 
        $.dequeue = function( a , b ){ 
                return $(a).dequeue(b); 
        }; 
 })( jQuery ); 
 
 /*画像＆テキストランダム取得*/

i=Math.floor(Math.random()*2); /*0～1までのランダム変数取得*/

function sethead()
{
    if(i==0)document.write('<a href="http://www.san-ai.ed.jp/" target="_blank"><img src="img/ad_01.jpg" alt="学校法人 酪農学園 とわの森三愛高等学校" title="学校法人 酪農学園 とわの森三愛高等学校" class="swap" /></a>');
    else if(i==1)document.write('<a href="http://www.san-ai.ed.jp/" target="_blank"><img src="img/ad_01.jpg" alt="学校法人 酪農学園 とわの森三愛高等学校" title="学校法人 酪農学園 とわの森三愛高等学校" class="swap" /></a>');
}

/*タブ*/

$(function() {
   $('#rotate > ul').tabs({ fx: { opacity: 'toggle' } })
});

/*チェックボックス*/

$(document).ready(function(){
    $('input[type=checkbox],input[type=radio]').prettyCheckboxes();
});
