var agent = navigator.userAgent;
var isIE = /*@cc_on!@*/0;
var version = 0;
if (isIE) {
	version = parseFloat(agent.match(/MSIE\s(\d+\.\d+)/)[1]);
}



jQuery(function(jQuery){

	if (isIE && version < 9) {
	} else {
		jQuery('head').append('<link rel="stylesheet" href="http://www.john-studio.com/common/johnst/style/modern.css" />');
	}
	if (isIE && version < 8) {
		jQuery('hr.hln').replaceWith('<div class="hln"></div>');
	}
	if (isIE && version < 7) {
		//jQuery('head').append('<script type="text/javascript" src="http://www.john-studio.com/common/johnst/js/DD_belatedPNG.js"></script>');
		DD_belatedPNG.fix('#header .contents, h1 img, h2, #toorderform #tof');
	}

	jQuery('.rel').click( function() {
		var href = jQuery(this).attr('href');
		window.open(href);
		return false;
	});

	jQuery('.entry .rightbox img, .entry .leftbox img').imgcaps({
		layer: 'outer',
		position: 'bottom'
	});

	jQuery("#header #nav ul").lavaLamp({
		fx: "easeOutBack",
		speed: 450,
		click: function(event, menuItem) {
			//return false;
		}
	});

	jQuery("#slides img").imgcaps();
	jQuery("#slides").before('<div id="snav"></div>').cycle({ 
		//fx: 'scrollLeft',
		fx: 'fade',
		speed:  800,
		timeout: 7000, 
		//easing:  'easeOutBack', 
		pager:  '#snav'
	});
	jQuery("#tojohnst").cycle({ 
		fx: 'fade',
		speed:  400,
		timeout: 3000
	});

	jQuery("dl.dglist:even").css({ 
		'backgroundColor': '#f6f6f8'
	});

	jQuery("#slides img").imgcaps();

	jQuery('<button id="tof"></button>').prependTo('#toorderform');
	jQuery('#tof').text('オーダーフォームへ進む').click(function() {
		var href = 'http://www.john-studio.com/orderform';
		window.location.replace(href);
	});

	jQuery('<a href="mailto:john@onkyostuff.com">Mail</a>').prependTo('#m')

});

