function findObj(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=findObj(n,d.layers[i].document);
	return x;
}

function swapImg()
{
	var i,j=0,x,a=swapImg.arguments;
	document.imgs=new Array;
	for(i=0;i<(a.length-1);i+=2)
		if ((x=findObj(a[i]))!=null)
		{
			document.imgs[j++]=x;
			if(!x.oSrc) x.oSrc=x.src;
			x.src=a[i+1];
		}
}

function restoreImg()
{
	var i,x,a=document.imgs;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function openWin(src,width,height) {
	if (width==null) width = screen.width/2;
	if (height==null) height = screen.height/2;
	var left=(screen.width-width) / 2;
	var top=(screen.height-height) / 2;
  var win = window.open(src,"", "toolbar=no,scrollbars=yes,resizable=yes,location=no,status=no,width="+width+",height="+height+",left="+left+",top="+top+"");
	win.focus();
}

function openWinCommon(src,width,height,left,top,scroll,resize) {
	if (left==null || left=="") left=(screen.width-width) / 2;
	if (top==null || top=="") top=(screen.height-height) / 2;
	if (scroll=="") scroll="auto";
	var win = window.open(src,"", "toolbar=no,scrollbars="+scroll+",resizable="+resize+",location=no,status=no,width="+width+",height="+height+",left=" + left + ", top=" + top);
	win.focus();
}

function openPic(src,title,width,height,left,top) {
	if (window.pic!=null) window.pic.close();
	//var left = screen.width-width-20;
	//var top = 10;
	if (left==null) left=(screen.width-width) / 2;
	if (top==null) top=(screen.height-height) / 2;
	pic = window.open('','pic','width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',statusbar=0,menu=0');
	pic.focus();
	pic.document.open();
	pic.document.write("<html><head><title>" + title + "</title></head>");
	pic.document.write("<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
	pic.document.write("<a href='javascript:this.close()'><img src='" + src + "' border='0' width='" + width + "' height='" + height + "'></a>");
	pic.document.write("</body></html>");
	pic.document.close();
}

function openPicCommon(src,title,width,height,left,top) {
	if (window.pic!=null) window.pic.close();
	if (left==null) left=(screen.width-width) / 2;
	if (top==null) top=(screen.height-height) / 2;
	pic = window.open('','pic','width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',statusbar=0,menu=0');
	pic.focus();
	pic.document.open();
	pic.document.write("<html><head><title>" + title + "</title></head>");
	pic.document.write("<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
	pic.document.write("<a href='javascript:this.close()'><img src='" + src + "' border='0' width='" + width + "' height='" + height + "'></a>");
	pic.document.write("</body></html>");
	pic.document.close();
}

function menuLeft(ref,mode) {
	if (mode) {
		ref.className = "none";
		if (document.all) {
			ref.parentElement.className = "none";
			ref.parentElement.parentElement.className = "none";
		} else {
			ref.parentNode.className = "none";
			ref.parentNode.parentNode.className = "none";
		}
	} else {
		ref.className = "";
		if (document.all) {
			ref.parentElement.className = "";
			ref.parentElement.parentElement.className = "";
		} else {
			ref.parentNode.className = "";
			ref.parentNode.parentNode.className = "";
		}
	}
}
