function getWindowWidth(){
	return window.innerWidth ? window.innerWidth : document.documentElement.offsetWidth;
}
function getWindowHeight(){
	return window.innerHeight ? window.innerHeight : document.documentElement.offsetHeight;
}
function changeContent(){
	var type   = "unknown";
	var mode   = "";
	var folder   = "";
	var agent  = navigator.userAgent;
	var width  = getWindowWidth();
	var height = getWindowHeight();
	if(agent.match(/PLAYSTATION 3/)) {
	
	if(height > 720){
		type = "1080";
		     if(width == 1152) { mode = "an"; }
		else if(width == 1920) { mode = "af"; }
		else if(width == 1094) { mode = "bn"; }
		else if(width == 1824) { mode = "bf"; }
		else if(width == 1036) { mode = "cn"; }
		else if(width == 1728) { mode = "cf"; }
		else if(width ==  980) { mode = "dn"; }
		else if(width == 1632) { mode = "df"; }
	}
	else if(height > 480){
		type = "720";
		     if(width == 1024) { mode = "an"; }
		else if(width == 1280) { mode = "af"; }
		else if(width ==  972) { mode = "bn"; }
		else if(width == 1216) { mode = "bf"; }
		else if(width ==  922) { mode = "cn"; }
		else if(width == 1152) { mode = "cf"; }
		else if(width ==  870) { mode = "dn"; }
		else if(width == 1088) { mode = "df"; }
	}
	else if(width >= 640 && height <= 480) {
		if(width == 640 && height == 480) { type = "n480"; }
		else { type = "w480"; }
		
		     if(width ==  754) { mode = "an"; }
		else if(width ==  854) { mode = "af"; }
		else if(width ==  716) { mode = "bn"; }
		else if(width ==  812) { mode = "bf"; }
		else if(width ==  678) { mode = "cn"; }
		else if(width ==  768) { mode = "cf"; }
		else if(width ==  640) { mode = "dn"; }
		else if(width ==  726) { mode = "df"; }
	}
	else {
		type = "n480";
		     if(width ==  566) { mode = "an"; }
		else if(width ==  640) { mode = "af"; }
		else if(width ==  536) { mode = "bn"; }
		else if(width ==  608) { mode = "bf"; }
		else if(width ==  508) { mode = "cn"; }
		else if(width ==  576) { mode = "cf"; }
		else if(width ==  480) { mode = "dn"; }
		else if(width ==  544) { mode = "df"; }
	}
		folder = type;
		type = type + mode;
		pc   = false;
//		alert(type+",w"+width+",h"+height+",pc="+pc);
	} else { 
		type = "pc";
		folder = type;
		pc   = true;
	}
	location.href='/jp/'+folder+'/index.html?l='+type+'&pc='+pc;
}