//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
//_/ Copyright (C) 2004 PC-Apollon All rights reserved. _/_/
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

// focus form element
function SelSelect(objElm){
	objElm.focus();
	if(objElm.type=='text')objElm.select();
}

// parent reload
function ParentWindowReload(){
	if (window.opener){
		window.opener.location.href='illegalaccess.asp';
		window.close();
	}
}
// window close
function WinCloseR(){
	window.close();
	if(window.opener.closed==false){
		window.opener.location.reload();
	}
}
// checked change
function SetAllChecked(FormName,ElementName,OnOff){
	objForm=eval('document.'+FormName);
	for(i=0;i<objForm.length;i++){
		if(objForm.elements[i].name==ElementName){
			objForm.elements[i].checked=OnOff;
		}
	}
}
// on Image load error
function ItemImgErr(objImg){
	objImg.src = '/images/sorry.gif';
}
// be disabled all submit and button
function AllSubmitButtonDisabled(){
	for(i=0;i<document.forms.length;i++){
		for(j=0;j<document.forms[i].elements.length;j++){
			if(document.forms[i].elements[j].type=='submit'||document.forms[i].elements[j].type=='button'){
				document.forms[i].elements[j].disabled='true';
			}
		}
	}
}

//Flash Plugin
function NonFlash(objFlash){
	apollonswf.style.display = "none";
}

//Add to Favorite List
function AddFavorite(){
	window.external.addFavorite('http://www.pc-apollon.com/','■ＰＣアポロン　-パソコン・周辺機器・家電・ゲーム・ＤＶＤの流通革命！-');
}



//Page Scroll st
function Scrolling(pFrom, pTo) {
	this.pFrom = pFrom;
	this.pTo   = pTo;
	this.step  = 0;
}
Scrolling.prototype.MAXSTEPS = 70;
Scrolling.prototype.CURVE = 0.9;
Scrolling.prototype.run = function() {
	++this.step;
	var x = this.pTo.x - Math.pow(this.CURVE, this.step) * (this.pTo.x - this.pFrom.x);
	var y = this.pTo.y - Math.pow(this.CURVE, this.step) * (this.pTo.y - this.pFrom.y);
	window.scrollTo(x, y);
	return this.step >= this.MAXSTEPS;
};

function pageScroll(hash) {
	var cpos = new CurPoint(); location = hash;
	var dpos = new CurPoint(); window.scrollTo(cpos.x, cpos.y);
	var scr = new Scrolling(cpos, dpos);
	scr.iid = setInterval(function() { if (scr.run()) clearInterval(scr.iid); }, 10);
}

if (document.all) {
	if (document.compatMode == "CSS1Compat") {
		CurPoint = function () {
			this.x = document.documentElement.scrollLeft;
			this.y = document.documentElement.scrollTop;
		};
	} else {
		CurPoint = function () {
			this.x = document.body.scrollLeft;
			this.y = document.body.scrollTop;
		};
	}
} else if (window.pageXOffset !== undefined) {
	CurPoint = function () {
		this.x = window.pageXOffset;
		this.y = window.pageYOffset;
	};
} else {
	CurPoint = function () {
		this.x = window.scrollX;
		this.y = window.scrollY;
	};
}
//Page Scroll ed



