

var randomId;



function setRandomId(){

	randomId = parseInt(Math.random()*1000);

}



function getRandomId(){

	return randomId;

}





function setNewSize(h) {

	this.div = so.getAttribute('id');

	document.getElementById( this.div ).style.height = "100%";

	document.getElementById( this.div ).style.height = h+'px';

	if(navigator.userAgent.indexOf("Safari") != -1){

		var element = document.getElementById(this.div);

		element.focus();

	}

};



function removeEvent(){

	this.div = so.getAttribute('id');

	o = document.getElementById( this.div );

	o.removeEventListener("DOMMouseScroll", this, false);

}

	

jQuery.easing.quart = function (x, t, b, c, d) {

return -c * ((t=t/d-1)*t*t*t - 1) + b;

};



var j$ = jQuery;

function StageScroll(){

	var href= '#TopMain';

	var $target = j$(href == '#_top' ? 'body' : href); 

	if($target.size()) {

		var top = $target.offset().top;

		j$(j$.browser.safari ? 'body' : 'html')

		.animate({scrollTop:top}, 600, 'quart');

	}

	return false;

	

}

var ScrTop;



$(function(){

	$(window).scroll(function () {

		ScrTop = $(document).scrollTop();

		$('#intervalValue').val(ScrTop);

	});

});



function getScrollY(){

	return ScrTop;

}

function getWinH(){

	return winHeight;

}

/**
 * Y座標スクロール
 */
function scrY(_targetY)
{
	$('html, body').animate({ scrollTop:_targetY }, 600, 'quart');
}

$(function() {
	
	$(window).resize(resizer);

	function resizer()
	{
		winHeight = $(window).height();
	}
	resizer();
	
    function initialize() {
        var agent = navigator.userAgent;
        //
        if (agent.search(/iPhone/) != -1) {
            // iPhone
			$("#flashArea").remove();
			$("#sp").show();
        } else if (agent.search(/iPad/) != -1) {
            // iPad
			$("#flashArea").remove();
			$("#sp").show();
        } else if (agent.search(/iPod/) != -1) {
            // iPod
			$("#flashArea").remove();
			$("#sp").show();
        } else if (agent.search(/Android/) != -1) {
            // Android
			$("#sp").remove();
        } else {
            // PC
			$("#sp").remove();
        }
		setNewSize(1818);
    }
	
    initialize();
});
