//
// jquery.ciset.js for SOPHNET./F.C.RealBristol/uniform experiment
// 2010(c)COLONY+iNTERACTIVE INC
//

// ALL : jquery.browser.js config
$(document).ready(function() {
	var iphonecssset = 
		"<link rel='stylesheet' media='screen and (orientation:landscape)' href='/common/css/contents_ilandscape.css' type='text/css'>"
		+ 
		"<link rel='stylesheet' media='screen and (orientation:portrait)' href='/common/css/contents_iphone_portrait.css' type='text/css'>"
	;
	var ipadcssset = 
		"<meta name='viewport' content='width=device-width,initial-scale=1.0,maximum-scale=1'>"
		+
		"<link rel='stylesheet' media='screen and (max-device-width:1024px) and (orientation:landscape)' href='/common/css/contents_ilandscape.css' type='text/css'>"
		+ 
		"<link rel='stylesheet' media='screen and (max-device-width:1024px) and (orientation:portrait)' href='/common/css/contents_ipad_portrait.css' type='text/css'>"
	;
	if($.os.name == 'iphone') {
		$('head').append(function() {
			return (iphonecssset);
		});
	} else if($.os.name == 'ipod') {
		$('head').append(function() {
			return (iphonecssset);
		});
	} else {
		$('head').append(function() {
			return (ipadcssset);
		});
	}
});



// ABOUT : display language

$(document).ready(function() {
	// click ja button
	$('#lngNav > li.ja > span').click(function() {
		// en hyde
		$('#lngNav > li.ja').hide();
		$('article.en').hide();
		// ja show
		$('#lngNav > li.en').fadeIn(800);
		$('article.ja').fadeIn(800);
//		$('#lngNav > li.ja > span').addClass('jaDefault');
	});
	// click en button
	$('#lngNav > li.en > span').click(function() {
		// en show
		$('#lngNav > li.ja').fadeIn(800);
		$('article.en').fadeIn(800);
		// ja hyde
		$('#lngNav > li.en').hide();
		$('article.ja').hide(); 
	});
});

// LINK : display Atag href node

$(document).ready(function(){
	$('#link #mainContainer a').each(function(){
	// get href node and insert to atag
		var $linkurl = $(this).attr('href');
		$(this).append("<div class=\"url\">" + $linkurl + "</div>");
	// img transpalency setting
		$(this).hover(function(e){
			$(this).find('.img' , this).fadeTo("fast", 0.5);
		},function(e){
			$(this).find('.img' , this).fadeTo("fast", 1);
		});
	});
});


// DOWNLOAD : select code

function TextAreaSelect(){
	document.form1.text1.focus();	//テキストエリアをフォーカスする
	document.form1.text1.select();	//テキストエリアを全選択する
}

