﻿// JScript 檔

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

/*-------------------------------------------------------------*/
/* onLoad function
/*-------------------------------------------------------------*/
function onLoad()
{
	MM_preloadImages('buynow/images/back-top2.gif');	
	//if (parent.frames[0]==null && parent.frames[1]==null && parent.frames[2]==null)	
	//	window.navigate ("index.asp");
}

function change(){


}
function SelectXv3(){
var XV3 = window.document.getElementById('SelectXv3');
var n=document.all.selectxv3.selectedIndex;
//document.form1.submit(n);
//alert(XV2.options[n].innerText);
//alert(n);
}

function SelectPr1(){
var PR1 = window.document.getElementById('selectPr1');
var n=document.all.selectPr1.selectedIndex;
//alert(PR1.options[n].innerText);
}

function SelectPr2(){
var PR2 = window.document.getElementById('selectPr2');
var n=document.all.selectPr2.selectedIndex;
//alert(PR2.options[n].innerText);
}

function SelectPr3(){
var PR3 = window.document.getElementById('selectPr3');
var n=document.all.selectPr3.selectedIndex;
//alert(PR3.options[n].innerText);
}

function SelectPr4(){
var PR4 = window.document.getElementById('selectPr4');
var n=document.all.selectPr4.selectedIndex;
//alert(PR4.options[n].innerText);
}

function SelectPr5(){
var PR5 = window.document.getElementById('selectPr5');
var n=document.all.selectPr5.selectedIndex;
//alert(PR4.options[n].innerText);
}

function SelectPr6(){
var PR6 = window.document.getElementById('selectPr6');
var n=document.all.selectPr6.selectedIndex;
//alert(PR4.options[n].innerText);
}
function CheckAll(){
var xv3 = document.all.selectxv3.selectedIndex;
var pr1 = document.all.selectPr1.selectedIndex;
var pr2 = document.all.selectPr2.selectedIndex;
var pr3 = document.all.selectPr3.selectedIndex;
var pr4 = document.all.selectPr4.selectedIndex;
var szUrl;
	if (xv3 == 0 && pr1 == 0 && pr2 == 0 && pr3 == 0 && pr4 == 0){
		alert("Please select one product!");
		//return;
		}
		else{
		//szUrl="b1.aspx?numbers=" + "<%=GetData()%>" + "&XV2=" + xv2 + "&Pr1=" + pr1 + "&Pr2=" + pr2 + "&Pr3=" + pr3 + "&Pr4=" + pr4 ;
		szUrl="b1.aspx"
		}
		window.navigate (szUrl);
	}
	
function GetPr(xv3,pr1,pr2,pr3,pr4,pr5,pr6){
var xv3 = document.all.selectxv2.selectedIndex;
var pr1 = document.all.selectPr1.selectedIndex;
var pr2 = document.all.selectPr2.selectedIndex;
var pr3 = document.all.selectPr3.selectedIndex;
var pr4 = document.all.selectPr4.selectedIndex;
var pr5 = document.all.selectPr5.selectedIndex;
var pr6 = document.all.selectPr6.selectedIndex;
document.form1.xv3.value = xv3;
document.form1.pr1.value = pr1;
document.form1.pr2.value = pr2;
document.form1.pr3.value = pr3;
document.form1.pr4.value = pr4;
document.form1.pr5.value = pr5;
document.form1.pr6.value = pr6;
document.form1.submit();

//var a = document.all.selectxv2.selectedIndex;
//var b = document.all.selectPr1.selectedIndex;
//var c = document.all.selectPr2.selectedIndex;
//var d = document.all.selectPr3.selectedIndex;
//var e = document.all.selectPr4.selectedIndex;

//document.all.xv2.value="a";
//alert(document.form1.xv2.value);
}
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;
}
function MM_findObj(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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}