/*function NewWindow(url,name,www,hhh){
  var info = window.open(url,name,"width="+www+",height="+hhh+",scrollbars=no,resizable=no,menubar=no,toolbar=no,location=no,directories=no,status=yes");
  info.moveTo(0,0);
  info.focus();
}
function NewWindow69(url,name,www,hhh,sbar){
  window.open(url,name,"width="+www+",height="+hhh+",scrollbars="+sbar+",resizable=no,menubar=no,toolbar=no,location=no,directories=no,status=no");
}*/

function MM_openBrWindow(theURL,winName,features,www,hhh) {
  var height = window.screen.availHeight;
  var width = window.screen.availWidth;
  var left_point = parseInt(width/2) - parseInt(www/2);
  var top_point = parseInt(height/2) - parseInt(hhh/2);
  var move = window.open(theURL,winName,features);
  move.moveTo(left_point,top_point);
  move.focus();
}

function CTpreloadImages() { //v3.0
	var d=document;
	if(d.images){
		if(!d.CTp) d.CTp=new Array();
		var i,j=d.CTp.length,a=CTpreloadImages.arguments;
		for(i=0; i<a.length-1; i++)
		if (a[i].indexOf("#")!=0){ 
			d.CTp[j]=new Image; d.CTp[j++].src=a[i];
		}
	}
}

function CTswapImgRestore() { //v3.0
  var i,x,a=document.CTsr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function CTfindObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=CTfindObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function CTswapImage() { //v3.0
  var i,j=0,x,a=CTswapImage.arguments; document.CTsr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=CTfindObj(a[i]))!=null){document.CTsr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function CT_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {
		if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.CT_pgW=innerWidth; document.CT_pgH=innerHeight; onresize=CT_reloadPage; 
		}
	}else if (innerWidth!=document.CT_pgW || innerHeight!=document.CT_pgH) location.reload();
}
CT_reloadPage(true);

function openMap(mapString){
	window.open("popup.html","_blank");
	document.CTstring = new Object();
	document.CTstring.mapString = mapString;
}

function loadImg (){
	if(opener.document.CTstring){
		document.images["mapImg"].src = "img/"+opener.document.CTstring.mapString;
	}
}

CTwindowSize = new Object();

CTwindowSize.add = function (number,x,y){
	this[number] = new Array();
	this[number].x = x;
	this[number].y = y;
}

CTwindowSize.add(1,600,400);
CTwindowSize.add(2,440,250);
CTwindowSize.add(3,310,350);
CTwindowSize.add(4,390,210);
CTwindowSize.add(5,420,420);
CTwindowSize.add(6,330,240);
CTwindowSize.add(7,330,240);
CTwindowSize.add(8,470,230);
CTwindowSize.add(9,450,240);
CTwindowSize.add(10,290,380);
//EXTEC 写真展示
CTwindowSize.add(11,600,400);

function winopenPop(number){
	
	var url = "popup"+(number) +".html";
	window.open(url,"_blank","toolbar=no,location=no,directories=no,menubar=no,width="+CTwindowSize[number].x+",height="+CTwindowSize[number].y);
}
///特別窓設定
function openWindow1() {
	window.open("extec/robotrac/robotrac.html","","WIDTH=600,HEIGHT=400,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no");
}
function openWindow2() {
	window.open("extec/S_5/s_5.html","","WIDTH=600,HEIGHT=400,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no");
}
function openWindow3() {
	window.open("extec/trommel/trommel.html","","WIDTH=600,HEIGHT=400,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no");
}
function openWindow4() {
	window.open("extec/3600S/3600S.html","","WIDTH=600,HEIGHT=400,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no");
}
function openWindow5() {
	window.open("extec/c-10/c-10.html","","WIDTH=600,HEIGHT=400,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no");
}
function openWindow6() {
	window.open("extec/c-12/c_12.html","","WIDTH=600,HEIGHT=400,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no");
}
function openWindow7() {
	window.open("extec/impact/impact.html","","WIDTH=600,HEIGHT=400,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no");
}
