var _Common_ = {
	initRollovers:function(){
		if (!document.getElementById) return
		var aPreLoad = new Array();
		var sTempSrc;
		var aImages = document.getElementsByTagName('img');
		var img_Len = aImages.length;
		for (var i = 0; i < img_Len; i++) {		
			if (aImages[i].className == 'over') {
				var src = aImages[i].getAttribute('src');
				var ftype = src.substring(src.lastIndexOf('.'), src.length);
				var hsrc = src.replace(ftype, '_over'+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('_x'+ftype, ftype);
					this.setAttribute('src', sTempSrc);
				}
			}
		} 
		
		var aInputs = document.getElementsByTagName('input');
		var img_Len = aInputs.length;
		for (var i = 0; i < img_Len; i++) {		
			if (aInputs[i].className == 'over') {
				var src = aInputs[i].getAttribute('src');
				var ftype = src.substring(src.lastIndexOf('.'), src.length);
				var hsrc = src.replace(ftype, '_over'+ftype);
	
				aInputs[i].setAttribute('hsrc', hsrc);
				aPreLoad[i] = new Image();
				aPreLoad[i].src = hsrc;
				aInputs[i].onmouseover = function() {
					sTempSrc = this.getAttribute('src');
					this.setAttribute('src', this.getAttribute('hsrc'));
				}	
				aInputs[i].onmouseout = function() {
					if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_x'+ftype, ftype);
					this.setAttribute('src', sTempSrc);
				}
			}
		}   
		return;
	},
	rand:function(x){
		number = Math.floor(Math.random() * x);
		return number;
	},
	addLoadEvent:function(func){
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		}
		else {
			window.onload = function() {
				func();
				oldonload();
			}
		}
	}
}
var Cookie = { //cookie
	read:function(CookieName){
		if(document.cookie){
			var cookie_Data = document.cookie;
			var Name =cookie_Data.indexOf(CookieName + "=",0);
			if(Name >= 0){
				var Data = cookie_Data.indexOf(";",Name + CookieName.length + 1);
				Data >= 0? Data = cookie_Data.substring(Name + CookieName.length + 1,Data): Data = cookie_Data.substring(Name + CookieName.length + 1,cookie_Data.length);
				return(Data);
			}
		}
		return(false);
	},
	set:function(CookieName,Value){
		var time =new Date();
		time.setTime(time.getTime() + (1000*365*60*60*24));
		var exptime =";expires=" + time.toGMTString();
		document.cookie = CookieName + "=" + Value + exptime + "; path=/";
	},
	Delete:function(CookieName){
		var time =new Date();
		time.setTime(time.getTime() - (1000*365*60*60*24));
		var exptime =";expires=" + time.toGMTString();
		document.cookie = CookieName + "=" + exptime + "; path=/";
	}
}


function tab_Switch(Obj,num){
	var id = "tab_0";
	var li = Obj.parentNode.parentNode.getElementsByTagName("li");
	var count = li.length;

	for(i=0;i<count;i++){
		li[i].getElementsByTagName("a")[0].className = "";
		document.getElementById(id + ( i + 1 )).style.display = "none";
	}
	Obj.className = "current";
	document.getElementById(id + num).style.display = "block";
	
}

_Common_.addLoadEvent(_Common_.initRollovers);




//-- google ajax feed --//

google.load("feeds", "1");
 
function initialize() {
	var feed = new google.feeds.Feed("http://www.voxmusicweb.com/blog/feed/");
feed.setNumEntries(4);//フィードの表示数の設定
						
feed.load(function(result) {
if (!result.error) {
	var container = document.getElementById("feed");
	var temp = '';

for (var i = 0; i < result.feed.entries.length; i++) {
	var entry = result.feed.entries[i];
	
	var dd = new Date(entry.publishedDate); // now
	var yearNum = dd.getYear();
if (yearNum < 2000) yearNum += 1900;
	var date = yearNum + "."+(dd.getMonth()+1)+"."+dd.getDate()+"";

temp += "<dt>"+ date +"<\/dt><dd><a href='" + entry.link + "'>" + entry.title + "<\/a><\/dd>";
}
container.innerHTML = '<dl>' + temp + '</dl>';
}
});
 }
google.setOnLoadCallback(initialize);


