/*--------------------------------------
	スクロールしながら目的地へ
---------------------------------------*/

function getScrollLeft() { 
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {

  /*WinIE6標準モード稼動オブジェクト差異対応
    WinIE6標準モードとそれ以外で、それぞれ稼動しているオブジェクトを取り出す*/
  docele=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;

  return docele.scrollLeft;

 } else if (window.pageXOffset) {
  return window.pageXOffset;
 } else {
  return 0;
 }
}

function getScrollTop() { 
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {

  /*WinIE6標準モード稼動オブジェクト差異対応
    WinIE6標準モードとそれ以外で、それぞれ稼動しているオブジェクトを取り出す*/
  docele=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;
  
  return docele.scrollTop;

 } else if (window.pageYOffset) {
  return window.pageYOffset;
 } else {
  return 0;
 }
}

var pageScrollTimer;

function pageScroll(toX,toY,frms,cuX,cuY) { 
 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 jumpToPageTop() { 
  pageScroll(0,0,7);
}




/*--------------------------------------
	DW標準の「サブウィンドウで開く」
---------------------------------------*/
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}





/*--------------------------------------------
	FireFoxでも強引にウインドウを閉じる
---------------------------------------------*/

function close_win(){
var nvua = navigator.userAgent;
if(nvua.indexOf('MSIE') >= 0){
if(nvua.indexOf('MSIE 5.0') == -1) {
top.opener = '';
}
}
else if(nvua.indexOf('Gecko') >= 0){
top.name = 'CLOSE_WINDOW';
wid = window.open('','CLOSE_WINDOW');
}
top.close();
}






// 縫い合わせユニフォームカラーシミュレーターのページをポップアップで開く
//------------------------------------------------------------------------------
var dspWidth  = screen.width;
var dspHeight = screen.height;

function openwind(){
	var winWidht  = dspWidth-10;
	var winHeight = dspHeight-55;
	var winLeft   = 0;
	var winTop    = 0;

	var optSt = "directories=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,";

	optSt += "width=" +winWidht + ",height=" +winHeight + ",left=" +winLeft + ",top=" +winTop;
	
	if (dspWidth < 1000){
		var win1 = window.open('http://www.longyong.jp/it/uniform_info/UniformSimulator2.htm','LONGLONG3D',optSt);
		/* var win1 = window.open('http://dp17283101.lolipop.jp/simulator/stitch/UniformSimulator2.htm','LONGLONG3D',optSt); */
	}
	else{
		var win1 = window.open('http://www.longyong.jp/it/uniform_info/UniformSimulator1.htm','LONGLONG3D',optSt);
		/* var win1 = window.open('http://dp17283101.lolipop.jp/simulator/stitch/UniformSimulator1.htm','LONGLONG3D',optSt); */
	}
}


// 昇華プリントユニフォームカラーシミュレーターのページをポップアップで開く
//------------------------------------------------------------------------------
function openStSimulator(){
	win=window.open('http://www.longyong.jp/it/simulator/print/index.html','','toolbar=0,status=0,location=0,menubar=0,fullscreen=0,scrollbars=yes,resizable=yes,width=955,height=715');
}

// 縫い合わせユニフォームカラーシミュレーターのページをポップアップで開く
//------------------------------------------------------------------------------
var dspWidth  = screen.width;
var dspHeight = screen.height;

function openwind2(){
	var winWidht  = dspWidth-10;
	var winHeight = dspHeight-55;
	var winLeft   = 0;
	var winTop    = 0;

	var optSt = "directories=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,";

	optSt += "width=" +winWidht + ",height=" +winHeight + ",left=" +winLeft + ",top=" +winTop;
	
	if (dspWidth < 1000){
		var win1 = window.open('http://www.longyong.jp/it/uniform_info/UniformSimulator2a.htm','LONGLONG3D',optSt);
		/* var win1 = window.open('http://dp17283101.lolipop.jp/simulator/stitch/UniformSimulator2.htm','LONGLONG3D',optSt); */
	}
	else{
		var win1 = window.open('http://www.longyong.jp/it/uniform_info/UniformSimulator1a.htm','LONGLONG3D',optSt);
		/* var win1 = window.open('http://dp17283101.lolipop.jp/simulator/stitch/UniformSimulator1.htm','LONGLONG3D',optSt); */
	}
}


// 昇華プリントユニフォームカラーシミュレーターのページをポップアップで開く
//------------------------------------------------------------------------------
function openStSimulator2(){
	win=window.open('http://www.longyong.jp/it/simulator/print/index.html','','toolbar=0,status=0,location=0,menubar=0,fullscreen=0,scrollbars=yes,resizable=yes,width=955,height=715');
}



