
//center
function Wopen(url,w,h,n) {
	var winName = n;
	var Width   = 'width='   + w;
	var Height  = ',height=' + h;
	var Left    = ',left='   + ((screen.width - w) / 2);
	var Top     = ',top='    + ((screen.height- h) / 2);
	var Option = ',status=1,menubar=0,scrollbars=0,resizable=0';
	var features = Width + Height + Left + Top + Option;
	winName = window.open(url,winName,features);
	if (window.focus) {
		winName.focus();
	}
}

function WopenScroll(url,w,h,n) {
	var winName = n;
	var Width   = 'width='   + w;
	var Height  = ',height=' + h;
	var Left    = ',left='   + ((screen.width - w) / 2);
	var Top     = ',top='    + ((screen.height- h) / 2);
	var Option = ',status=1,menubar=0,scrollbars=1,resizable=0';
	var features = Width + Height + Left + Top + Option;
	winName = window.open(url,winName,features);
	if (window.focus) {
		winName.focus();
	}
}

//ブラウザサイズ可変
function WopenScrollVariable(url,w,h,n) {
	var winName = n;
	var Width   = 'width='   + w;
	var Height  = ',height=' + h;
	var Left    = ',left='   + ((screen.width - w) / 2);
	var Top     = ',top='    + ((screen.height- h) / 2);
	var Option = ',status=1,menubar=0,scrollbars=1,resizable=1';
	var features = Width + Height + Left + Top + Option;
	winName = window.open(url,winName,features);
	if (window.focus) {
		winName.focus();
	}
}

//左上
function WopenL(url,w,h,n) {
	var winName = n;
	var Width   = 'width='   + w;
	var Height  = ',height=' + h;
	var Left    = ',left='   + 2;
	var Top     = ',top='    + 2;
	var Option = ',status=1,menubar=0,scrollbars=1,resizable=1';
	var features = Width + Height + Left + Top + Option;
	winName = window.open(url,winName,features);
	if (window.focus) {
		winName.focus();
	}
}
//左上メニューバーあり
function WopenLmenubar(url,w,h,n) {
	var winName = n;
	var Width   = 'width='   + w;
	var Height  = ',height=' + h;
	var Left    = ',left='   + 2;
	var Top     = ',top='    + 2;
	var Option = ',status=1,menubar=1,toolbars=yes,location=0,scrollbars=1,resizable=1';
	var features = Width + Height + Left + Top + Option;
	winName = window.open(url,winName,features);
	if (window.focus) {
		winName.focus();
	}
}

function WopenL0(url,w,h,n) {
	var winName = n;
	var Width   = 'width='   + w;
	var Height  = ',height=' + h;
	var Left    = ',left='   + 2;
	var Top     = ',top='    + 2;
	var Option = ',status=1,menubar=0,scrollbars=0,resizable=0';
	var features = Width + Height + Left + Top + Option;
	winName = window.open(url,winName,features);
	if (window.focus) {
		winName.focus();
	}
}

//fullwindow
var ms = navigator.appVersion.indexOf("MSIE");
var ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)
var nesc = navigator.appName.lastIndexOf("Netscape"); //一致した位置(0)を返す
var nesc4 = (nesc >= 0) && (parseInt(navigator.appVersion.substring(0,2)) >= 4);

function fullwin(url){
	if (nesc4){
    	newwindow = window.open(url,"newwindow",
"scrollbars,width=" + window.screen.width + ",height=" + window.screen.height);
		newwindow.moveTo(0,0);
		newwindow.focus();

	}else if (ie4){
		window.open(url,"screen","status=0,scrollbars=1,fullscreen=yes");

	}else{
		location.href=url;
	}
}

//ムービーロード
function MovieLoad(shop,key,size) {
	var url = '../movie.php?sk=' + shop + '&g=' + key + '&s=' + size;
	var w		=648;
	var h		=530;
	var winName = 'movie';
	var Width   = 'width='   + w;
	var Height  = ',height=' + h;
	var Left    = ',left='   + ((screen.width - w) / 2);
	var Top     = ',top='    + ((screen.height- h) / 2);
	var Option = ',status=0,menubar=0,scrollbars=0,resizable=0';
	var features = Width + Height + Left + Top + Option;
	winName = window.open(url,winName,features);
	if (window.focus) {
		winName.focus();
	}
}

//ジャンプ
	function jump(url){
		if(!!window.opener)window.opener.location.href = url;
		else parent.window.location.href = url;
		return;
	}

	function jump2(url){
		if(!!parent.window.opener)parent.window.opener.location.href = url;
		else parent.window.location.href = url;
		return;
	}


//画像切り替え
function imgcng(iName,str){
	document.images[iName].src = str;
}


//pagetop
function getScrollLeft() { 
	if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
		return document.body.scrollLeft;
	}
	else if (window.pageXOffset) {
		return window.pageXOffset;
	}
	else {
		return 0;
	}
}

function getScrollTop() { 
	if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
		return document.body.scrollTop;
	}
	else if (window.pageYOffset) {
		return window.pageYOffset;
	}
	else {
		return 0;
	}
}

var pageScrollTimer;
function pageScroll(toX,toY,frms,cuX,cuY) { // 020314
	if (pageScrollTimer) clearTimeout(pageScrollTimer);
	if (!toX || toX < 0) toX = 0;
	if (!toY || toY < 0) toY = 0;
	if (!cuX) cuX = 0 + getScrollLeft();
	if (!cuY) cuY = 0 + getScrollTop();
	if (!frms) frms = 6;

	if (toY > cuY && toY > (getAnchorPosObj('end','enddiv').y) - getInnerSize().height) toY = (getAnchorPosObj('end','enddiv').y - getInnerSize().height) + 1;
	cuX += (toX - getScrollLeft()) / frms; if (cuX < 0) cuX = 0;
	cuY += (toY - getScrollTop()) / frms;  if (cuY < 0) cuY = 0;
	var posX = Math.floor(cuX);
	var posY = Math.floor(cuY);
	window.scrollTo(posX, posY);

	if (posX != toX || posY != toY) {
		pageScrollTimer = setTimeout("pageScroll("+toX+","+toY+","+frms+","+cuX+","+cuY+")",16);
	}
}

function pagetop() {
// if (!MacIE3 && !MacIE4 && !NN && window.scrollTo || NN && (Vminor >= 4.75) && window.scrollTo) {
	pageScroll(0,0,5);
// } else {
//  location.hash = "top";
// }
}


//ジャンル別リストバナーのオンマウス画像チェンジ
function changeImage1(){
    document.myimg1.src="../img/toppage/new/b_sorp_p.jpg";
}
function changeImage2(){
    document.myimg1.src="../img/toppage/new/b_sorp.jpg";
}
function changeImage3(){
    document.myimg2.src="../img/toppage/new/b_helth_p.jpg";
}
function changeImage4(){
    document.myimg2.src="../img/toppage/new/b_helth.jpg";
}
function changeImage5(){
    document.myimg3.src="../img/toppage/new/b_deli_p.jpg";
}
function changeImage6(){
    document.myimg3.src="../img/toppage/new/b_deli.jpg";
}
function changeImage7(){
    document.myimg4.src="../img/toppage/new/b_pink_p.jpg";
}
function changeImage8(){
    document.myimg4.src="../img/toppage/new/b_pink.jpg";
}
function changeImage9(){
    document.myimg5.src="../img/toppage/new/b_este_p.jpg";
}
function changeImage10(){
    document.myimg5.src="../img/toppage/new/b_este.jpg";
}
function changeImage11(){
    document.myimg6.src="../img/toppage/new/b_all_p.jpg";
}
function changeImage12(){
    document.myimg6.src="../img/toppage/new/b_all.jpg";
}
