function MM_findObj(n, d) { //v3.0
 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); 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];}
}
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_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];}}
}

function changeclass(id, newClass)
	{identity=document.getElementById(id);identity.className=newClass;}

function popup(url,x,y)
	{n=open(url,'PopUp','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+x+',height='+y);}
	

function cms_itemswap(x,y)
	{
	if(y != "")
		{
		document.cms.id.value=x
		document.cms.genvar.value=y
		document.cms.doit.value='swap'
		document.cms.submit()
		}
	}

function cms_deletecasestudy(x)
	{
	if(x != '' && confirm('Are you sure you want to delete this case study?'))
		{
		document.cms.doit.value='del'
		document.cms.pg.value='case_studies'
		document.cms.genvar.value=x
		document.cms.submit()
		}
	}

function cms_deleteclient(x)
	{
	if(x != '' && confirm('Are you sure you want to delete client: \n'+ x +'?'))
		{
		document.cms.doit.value='delclient'
		document.cms.pg.value='client_work_index'
		document.cms.genvar.value=x
		document.cms.submit()
		}
	}

function cms_clientdeletepage(x)
	{
	if(x != '' && confirm('Are you sure you want to delete: \n'+ x +'?'))
		{
		document.cms.doit.value='del'
		document.cms.submit()
		}
	}

function cms_newsector(x)
	{
	document.cms.doit.value='newsector'
	document.cms.submit()
	}

function cms_clientnewpage(x)
	{
	document.cms.doit.value='new'
	document.cms.submit()
	}

function cms_newcasestudy(x)
	{
	if(x != '')
		{
		document.cms.pg.value='case_studies'
		document.cms.doit.value='new'
		document.cms.genvar.value=x
		document.cms.submit()
		}
	else
		{
		document.cms.newclient.options.selectedIndex = 0
		}
	}

function cms_newclient(x)
	{
	if(x != '')
		{
		document.cms.pg.value='client_work'
		document.cms.doit.value='newclient'
		document.cms.genvar.value=x
		document.cms.submit()
		}
	else
		{
		document.cms.newclient.options.selectedIndex = 0
		}
	}

function cms_logout(x)
	{
	if(confirm('Are you sure you want to log-out '+x+'?'))
		{
		document.cms.doit.value='logout'
		document.cms.submit()
		}
	}
	
function cms_bup(f,n)
	{
	if(f != '' && confirm('Are you sure you want to restore to back-up?'))
		{
		document.cms.doit.value='bup'
		document.cms.genvar.value=f
		document.cms.submit()
		}
	else
		{
		document.cms.backup.options.selectedIndex = 0
		}
	}

function cms_movesec(x)
	{
	if(x != '')
		{
		document.cms.doit.value='movesec'
		document.cms.genvar.value=x
		document.cms.submit()
		}
	else
		{
		document.cms.movesector.options.selectedIndex = 0
		}
	}

function cms_pmandel(x)
	{
	if(x != '' && confirm('Are you sure you want to delete: \n'+ x +'?'))
		{
		document.cms.pman.value='del'
		document.cms.genvar.value=x
		document.cms.submit()
		}
	else
		{
		document.cms.pmandelpic.options.selectedIndex = 0
		}
	}
	
function cms_pmanupload(x)
	{
	document.cms.pman.value='upload'
	document.cms.submit()
	}

function change()
	{
	document.cms.submit()
	}
	
function cms_newsitemdel(x)
	{
	if(x != '' && confirm('Are you sure you want to delete this news item?'))
		{
		document.cms.doit.value='del'
		document.cms.genvar.value=x
		document.cms.submit()
		}
	else
		{
		document.cms.delnews.options.selectedIndex = 0
		}
	}

function cms_sectordel(x)
	{
	if(x != '' && confirm('Are you sure you want to delete the sector: '+x+'?'))
		{
		document.cms.doit.value='del'
		document.cms.genvar.value=x
		document.cms.submit()
		}
	else
		{
		document.cms.delsec.options.selectedIndex = 0
		}
	}

function XXXclientlogin(x)
	{
	document.clin.clinsel.options.selectedIndex = 0
	if(x != '')
		{
		n=open('http://www.raindesign.com/'+x+'/','_blank','toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=900,height=500')
		}
	}

function clientjump(x)
	{if (x != "") {x='client_work_'+x+'.html';self.location=x}};
	
function clientlogin(x)
	{
	document.clin.clinsel.options.selectedIndex = 0
	if(x != '')
		{
		self.location='http://www.raindesign.com/'+x
		}
	}

function ftpcli(x)
	{
	if(x != '')
		{
		var myString = x;
		var mySplitResult = myString.split("~");
		document.cms.cid.value=mySplitResult[1];
		document.cms.password.value=mySplitResult[2];
		}
	else
		{
		document.clin.clinsel.options.selectedIndex = 0;
		}
	}

