function openNew(uri, l, t, w, h){
	var windowOptions = 'location=no';
 	windowOptions += ',toolbar=no';
	windowOptions += ',menubar=no';
	windowOptions += ',status=no';
	if(name != 'about_wutan' && name != 'about_tai_chi' && name!= 'technical_note')
		windowOptions += ',scrollbars=no';
	else
		windowOptions += ',scrollbars=yes';
	windowOptions += ',resizable=no';
	windowOptions += ',left='+l+'';
	windowOptions += ',top='+t+'';
	windowOptions += ',width='+w+'';
	windowOptions += ',height='+h+'';
	tmp = window.open(uri, 'x', windowOptions);
	tmp.focus();
}

function findObject(n, d){
  	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 = findObject(n,d.layers[i].document);
  	if(!x && d.getElementById)
		x = d.getElementById(n);
	return x;
}

function swapImage(){
  	var i, j = 0, x, args = swapImage.arguments;
  	document.sr = new Array;
	for(i = 0; i < (args.length - 2); i+=3)
   		if((x = findObject(args[i])) != null){
			document.sr[j++] = x;
			if(!x.oSrc)
				x.oSrc = x.src;
			x.src = args[i+2];
		}
}

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

function preloadImages(){
 	if(document.images){ 
 		if(!document.imageArray)
			var args = preloadImages.arguments;
		document.imageArray = new Array(args.length);
		var j = document.imageArray.length;	
   		for(var i = 0; i < args.length; i++)
   			if(args[i].indexOf('#') != 0){ 
				document.imageArray[j] = new Image;
			document.imageArray[j++].src = args[i];
			}
 	}
}
