google.load('feeds', '1');
$(document).ready(function(){
	$("a[rel='colorbox']").colorbox({"maxWidth":"700px","maxHeight":"700px"});
	for(twitcount=0;twitcount<=$("div.tw").size()-1;twitcount++){/****/
		$("div.tw").eq(twitcount).jqtwitter($("div.tw").eq(twitcount).attr("name"),Number($("div.tw").eq(twitcount).attr("title")),$("div.tw").eq(twitcount).attr("id"));
	}
	
	for(rsscount=0;rsscount<=$("div.rss").size()-1;rsscount++){/****/
		var rssurl = $("div.rss").eq(rsscount).attr("name");
		var rssmax = $("div.rss").eq(rsscount).attr("title");
		var feed = new google.feeds.Feed(rssurl);
		feed.setNumEntries(Number(rssmax));
		feed.load(function(result) {
			// エントリーをitemsとする
			//alert("in");
			var items = result.feed.entries;
			
			// エントリーがない場合は，ありません表示
			if( items.length<1 ) {
			//alert("1つのページに設置できるRSSは1つまでです");
				$("div.rss").eq(rsscount-1).append('記事がありません。');
				return false;
			}
			$(items).each(function(i) {
			//alert(this.title + "_" + rsscount);
			$("div.rss").eq(rsscount-1).append("<a target='_blank' href='"+ this.link +"'><h4 class='mb05'><strong>"+this.title+"</strong></h4></a>");
			$("div.rss").eq(rsscount-1).append("<div class='mt10 ml10 mr10 mb00'>"+this.content+"</div>");
			$("div.rss").eq(rsscount-1).append("<span class=' ml10 mr10 mb20'><small>"+this.publishedDate+"</small></span>");
			});
		});
	}
	
	
	if(!jQuery.support.checkOn && jQuery.support.checkClone){//chromesafari
	}else if(jQuery.support.checkOn && jQuery.support.htmlSerialize && window.globalStorage){//ff
	}else if(jQuery.support.checkOn && jQuery.support.htmlSerialize && !window.globalStorage){//opera
	}else if(!jQuery.support.htmlSerialize && jQuery.support.scriptEval){//ie9
	}else if(!jQuery.support.opacity){
		if(!jQuery.support.style){
			if (typeof document.documentElement.style.maxHeight != "undefined") {//7
			} else {//6
			$("body").prepend("<font size='2'>※お使いのブラウザでは対応していない機能があります。最新のブラウザをおすすめします。<a href='http://www.microsoft.com/japan/windows/products/winfamily/ie/function/default.mspx' target='_blank'>ダウンロードはこちら</a></font>");
				$("*").not("input,textarea,table").css({"border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px"});
				$("body").contents().find("div").not("#navigation,#container").css({"border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","margin-bottom":"0px","margin-top":"0px","margin-left":"0px","margin-right":"0px","line-heght":"1.5em","z-index":"30","overflow-y":"visible"});
				for(var i=0;i<Number($("body").contents().find("div").not("#navigation,#container,:has(img)").size());i++){
					var tempwidth=$("body").contents().find("div").not("#navigation,#container,:has(img)").eq(i).width();
					//var widthminus = Number(tempwidth.length)-2;
					//tempwidth=tempwidth.substr(0,widthminus);
					tempwidth=Number(tempwidth);
					tempwidth=Number(tempwidth + 2 + 10);
					//alert(tempwidth);
					$("body").contents().find("div").not("#navigation,#container,:has(img)").eq(i).width(tempwidth);

					var tempheight=$("body").contents().find("div").not("#navigation,#container,:has(img)").eq(i).height();
					//var heightminus = Number(tempheight.length)-2;
					//tempheight=tempheight.substr(0,heightminus);
					tempheight=Number(tempheight);
					tempheight=Number(tempheight + 2 + 10);
					$("body").contents().find("div").not("#navigation,#container,:has(img)").eq(i).height(tempheight);
				}
				$("body").contents().find("div:has('img')").css({"overflow-y":"hidden"});
				$("body").contents().find("a.button").css({"border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","margin-bottom":"0px","margin-top":"0px","margin-left":"0px","margin-right":"0px"});
				for(i=0;i<Number($("body").contents().find("a.button").size());i++){
					var tempwidth=$("body").contents().find("a.button").eq(i).width();
					//var widthminus = Number(tempwidth.length)-2;
					//tempwidth=tempwidth.substr(0,widthminus);
					tempwidth=Number(tempwidth);
					tempwidth=Number(tempwidth + 2 + 40);
					//alert(tempwidth);
					$("body").contents().find("a.button").eq(i).width(tempwidth);

					var tempheight=$("body").contents().find("a.button").eq(i).height();
					//var heightminus = Number(tempheight.length)-2;
					//tempheight=tempheight.substr(0,heightminus);
					tempheight=Number(tempheight);
					//tempheight=Number(tempheight + 2 + 10);
					$("body").contents().find("a.button").eq(i).height(tempheight);
				}
				$("#bigcontainer").contents().find("h2").css({"border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px"});
				$("#bigcontainer").contents().find("h3").css({"border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px"});
				for(i=0;i<Number($("#bigcontainer").contents().find("h2").size());i++){
					//if($("#bigcontainer").contents().find("h2,h3").eq(i).css("background-image")!=""){
						$("#bigcontainer").contents().find("h2").eq(i).css({"background-color":"transparent"});
					//}
					var tempwidth=$("#bigcontainer").contents().find("h2").eq(i).width();
					//var widthminus = Number(tempwidth.length)-2;
					//tempwidth=tempwidth.substr(0,widthminus);
					tempwidth=Number(tempwidth);
					tempwidth=Number(tempwidth + 2 + 10);
					//alert(tempwidth);
					$("#bigcontainer").contents().find("h2").eq(i).width(tempwidth);

					var tempheight=$("#bigcontainer").contents().find("h2").eq(i).height();
					//var heightminus = Number(tempheight.length)-2;
					//tempheight=tempheight.substr(0,heightminus);
					tempheight=Number(tempheight);
					tempheight=Number(tempheight + 2 + 10);
					$("#bigcontainer").contents().find("h2").eq(i).height(tempheight);
				}
				for(i=0;i<Number($("#bigcontainer").contents().find("h3").size());i++){
					//if($("#bigcontainer").contents().find("h2,h3").eq(i).css("background-image")!=""){
						$("#bigcontainer").contents().find("h3").eq(i).css({"background-color":"transparent"});
					//}
					var tempwidth=$("#bigcontainer").contents().find("h3").eq(i).width();
					//var widthminus = Number(tempwidth.length)-2;
					//tempwidth=tempwidth.substr(0,widthminus);
					tempwidth=Number(tempwidth);
					tempwidth=Number(tempwidth + 2 + 10);
					//alert(tempwidth);
					$("#bigcontainer").contents().find("h3").eq(i).width(tempwidth);

					var tempheight=$("#bigcontainer").contents().find("h3").eq(i).height();
					//var heightminus = Number(tempheight.length)-2;
					//tempheight=tempheight.substr(0,heightminus);
					tempheight=Number(tempheight);
					tempheight=Number(tempheight + 2 + 10);
					$("#bigcontainer").contents().find("h3").eq(i).height(tempheight);
				}

			}
		}else{
		//ie8
		}
	}else{

	}
});
