function swap(){
	var i,j=0,x,a=swap.arguments;document.sr=new Array; for(i=0;i<(a.length-1);i+=2)
	if ((x=find(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+1];}
}

function swaprest(){
	var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preload(){
	var d=document; if(d.images){ if(!d.p) d.p=new Array();
	var i,j=d.p.length,a=preload.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function find(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=find(n,d.layers[i].document); return x;
}

function zoom(img,w,h,tit){
	var popup,dim='width='+w+',height='+h;
	popup=open('','popup',dim);
	if(!tit) tit='Zoom';
	with (popup.document){
	open("text/html", "replace");
	write('<html><head><title>'+tit+'</title></head>\n');
	write('<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onload="self.focus()">\n');
	write('<a href="javascript:self.close()" title="Click to close"><img src="'+img+'" width='+w+' height='+h+' border=0></a>\n');
	write('</body></html>');
	close()}
}

function middleWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    	//Non-IE
	    myWidth = window.innerWidth;
  	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    	//IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;
  	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myWidth = document.body.clientWidth;
  	}
	return (myWidth/2);
}

function middleHeight() {
	var myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    	//IE 6+ in 'standards compliant mode'
	    myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    	//IE 4 compatible
	    myHeight = document.body.clientHeight;
	}
	return (myHeight/2);
}

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];}}
}

