/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_ov'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_ov'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

//------------------------

function viewTop(){
    var flashvars = null;
	var params = null;
	var attributes = null;
	swfobject.embedSWF("/preloader.swf", "swfarea", "100%", "324", "9","expressInstall.swf", flashvars, params, attributes);
}

function fozInit(){
	
	initRollovers();
	
	jQuery(".sscrl a").click(function(){
		jQuery("html, body").animate({
			scrollTop:jQuery(jQuery(this).attr("href")).offset().top
		}, 'slow', 'swing');
		return false;
	});
	
	jQuery("ul.entry-list > li").click(function(){
        window.location=jQuery(this).find("a").attr("href");
        return false;
    });
    jQuery("ul.entry-list > li").mouseover(function(){
        jQuery(this).css("background-color", "#ebf1d1");
        jQuery(this).css("cursor", "hand");
        jQuery(this).css("cursor", "pointer");
        return false;
    });
    jQuery("ul.entry-list > li").mouseout(function(){
        jQuery(this).css("background-color", "");
        return false;
    });
    jQuery("ul.related_post > li").click(function(){
        window.location=jQuery(this).find("a").attr("href");
        return false;
    });
    jQuery("ul.related_post > li").mouseover(function(){
        jQuery(this).css("background-color", "#f5f5f5");
        jQuery(this).css("cursor", "hand");
        jQuery(this).css("cursor", "pointer");
        return false;
    });
    jQuery("ul.related_post > li").mouseout(function(){
        jQuery(this).css("background-color", "");
        return false;
    });
    if(jQuery("#tagcloud").length){
		//jquery版背景など微妙
		/*jQuery("#tagcloud").corner({
			tl: { radius: 20 },
			tr: { radius: 20 },
			bl: { radius: 20 },
			br: { radius: 20 },
			antiAlias: true,
			autoPad: true,
			validTags: ["div", "li"]
		});*/
		//↓追加
		//var curvyCornersNoAutoScan = true;
		//↓要素ない場合エラーでるので
		//curvyCorners.init();
		var settings = {
		tl: { radius: 6 },
		tr: { radius: 6 },
		bl: { radius: 6 },
		br: { radius: 6 },
		antiAlias: true
		}
		curvyCorners(settings, "#tagcloud");
	}
	var settings6 = {
		tl: { radius: 6 },
		tr: { radius: 6 },
		bl: { radius: 6 },
		br: { radius: 6 },
		antiAlias: true
		}
	if(jQuery(".subcat").length){
		curvyCorners(settings6, ".subcat");
	}
	if(jQuery(".entry .prm").length){
		curvyCorners(settings6, ".prm");
	}
}
