
function baseChooser(color,cel){

	var butt_on = "<img src=images/x.gif border=0 onClick='PaperInternalClosePopup()'>";
	var name_on = "<font style='font-family:arial;font-size:10pt;font-weight:bold;color:white'>&nbsp;&nbsp;Wallpaper Pallette</font>";

	var llt = "<table width=100% border=0 cellspacing=0 cellpadding=1 bgcolor=#DDDCCC>";
	llt +="<tr><td align=left bgcolor=#CCCDDD>"+name_on+"</td>";
	llt +="<td align=right bgcolor=#CCCDDD>"+butt_on+"</td></tr>";
	llt +="<form name=Paperform method=post><tr><td align=center colspan=2> ";
	llt +="<table border=0 cellspacing=0 width=100% bgcolor=#FFFFFF><tr><td align=center>";

	llt +="<table>";

	llt +="<tr>";
	llt +="<td onClick=baseSelect('sets/wallpaper/a1.gif','testcell1') width=20 height=20><img src='sets/wallpaper/a1.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/a2.gif','testcell1') width=20 height=20><img src='sets/wallpaper/a2.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/a3.gif','testcell1') width=20 height=20><img src='sets/wallpaper/a3.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/a4.gif','testcell1') width=20 height=20><img src='sets/wallpaper/a4.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/a5.gif','testcell1') width=20 height=20><img src='sets/wallpaper/a5.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/a6.gif','testcell1') width=20 height=20><img src='sets/wallpaper/a6.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/a7.gif','testcell1') width=20 height=20><img src='sets/wallpaper/a7.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/a8.gif','testcell1') width=20 height=20><img src='sets/wallpaper/a8.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/a9.gif','testcell1') width=20 height=20><img src='sets/wallpaper/a9.gif' width=18 height=18></td>";
	llt +="</tr>";

	llt +="<tr>";
	llt +="<td onClick=baseSelect('sets/wallpaper/b1.gif','testcell1') width=20 height=20><img src='sets/wallpaper/b1.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/b2.gif','testcell1') width=20 height=20><img src='sets/wallpaper/b2.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/b3.gif','testcell1') width=20 height=20><img src='sets/wallpaper/b3.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/b4.gif','testcell1') width=20 height=20><img src='sets/wallpaper/b4.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/b5.gif','testcell1') width=20 height=20><img src='sets/wallpaper/b5.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/b6.gif','testcell1') width=20 height=20><img src='sets/wallpaper/b6.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/b7.gif','testcell1') width=20 height=20><img src='sets/wallpaper/b7.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/b8.gif','testcell1') width=20 height=20><img src='sets/wallpaper/b8.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/b9.gif','testcell1') width=20 height=20><img src='sets/wallpaper/b9.gif' width=18 height=18></td>";
	llt +="</tr>";

	llt +="<tr>";
	llt +="<td onClick=baseSelect('sets/wallpaper/c1.gif','testcell1') width=20 height=20><img src='sets/wallpaper/c1.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/c2.gif','testcell1') width=20 height=20><img src='sets/wallpaper/c2.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/c3.gif','testcell1') width=20 height=20><img src='sets/wallpaper/c3.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/c4.gif','testcell1') width=20 height=20><img src='sets/wallpaper/c4.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/c5.gif','testcell1') width=20 height=20><img src='sets/wallpaper/c5.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/c6.gif','testcell1') width=20 height=20><img src='sets/wallpaper/c6.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/c7.gif','testcell1') width=20 height=20><img src='sets/wallpaper/c7.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/c8.gif','testcell1') width=20 height=20><img src='sets/wallpaper/c8.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/c9.gif','testcell1') width=20 height=20><img src='sets/wallpaper/c9.gif' width=18 height=18></td>";
	llt +="</tr>";

	llt +="<tr>";
	llt +="<td onClick=baseSelect('sets/wallpaper/d1.gif','testcell1') width=20 height=20><img src='sets/wallpaper/d1.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/d2.gif','testcell1') width=20 height=20><img src='sets/wallpaper/d2.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/d3.gif','testcell1') width=20 height=20><img src='sets/wallpaper/d3.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/d4.gif','testcell1') width=20 height=20><img src='sets/wallpaper/d4.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/d5.gif','testcell1') width=20 height=20><img src='sets/wallpaper/d5.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/d6.gif','testcell1') width=20 height=20><img src='sets/wallpaper/d6.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/d7.gif','testcell1') width=20 height=20><img src='sets/wallpaper/d7.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/d8.gif','testcell1') width=20 height=20><img src='sets/wallpaper/d8.gif' width=18 height=18></td>";
	llt +="<td onClick=baseSelect('sets/wallpaper/d9.gif','testcell1') width=20 height=20><img src='sets/wallpaper/d9.gif' width=18 height=18></td>";
	llt +="</tr>";

	llt +="<tr>";
	llt +="<td onClick=baseSelect('sets/tex/t1.gif','testcell1') width=20 height=20><img src='sets/tex/t1.gif' width=18 height=18 alt='This texture allows the background color to show through'></td>";
	llt +="<td onClick=baseSelect('sets/tex/t2.gif','testcell1') width=20 height=20><img src='sets/tex/t2.gif' width=18 height=18 alt='This texture allows the background color to show through'></td>";
	llt +="<td onClick=baseSelect('sets/tex/t3.gif','testcell1') width=20 height=20><img src='sets/tex/t3.gif' width=18 height=18 alt='This texture allows the background color to show through'></td>";
	llt +="<td onClick=baseSelect('sets/tex/t4.gif','testcell1') width=20 height=20><img src='sets/tex/t4.gif' width=18 height=18 alt='This texture allows the background color to show through'></td>";
	llt +="<td onClick=baseSelect('sets/tex/t5.gif','testcell1') width=20 height=20><img src='sets/tex/t5.gif' width=18 height=18 alt='This texture allows the background color to show through'></td>";
	llt +="<td onClick=baseSelect('sets/tex/t6.gif','testcell1') width=20 height=20><img src='sets/tex/t6.gif' width=18 height=18 alt='This texture allows the background color to show through'></td>";
	llt +="<td onClick=baseSelect('sets/tex/t7.gif','testcell1') width=20 height=20><img src='sets/tex/t7.gif' width=18 height=18 alt='This texture allows the background color to show through'></td>";
	llt +="<td onClick=baseSelect('sets/tex/t8.gif','testcell1') width=20 height=20><img src='sets/tex/t8.gif' width=18 height=18 alt='This texture allows the background color to show through'></td>";
	llt +="<td onClick=baseSelect('sets/tex/t9.gif','testcell1') width=20 height=20><img src='sets/tex/t9.gif' width=18 height=18 alt='This texture allows the background color to show through'></td>";
	llt +="</tr>";

	llt +="</table>";

	llt +="<table border='0' cellspacing='0' width='80%' bgcolor='#FFFFFF'>";
	llt +="<tr><td id='Papercell' align='center' valign='middle' height='50'>&nbsp;</td></tr>";
	llt +="</table>";

	llt +="<table border='0' cellspacing='0' width='100%' bgcolor='#FFFFFF'>";
	llt +="<tr><td align=center>";
	llt +="<input type=button name=select value=Clear onClick=\"baseSelect('images/spacer.gif')\">";
	llt +="</td></tr></table>";
	
	llt +="</td></tr></form></table>";
	
	llt +="</td></tr></table>";


	var obj = document.all.waPaper;
	obj.style.visibility = 'visible';
	obj.style.left = document.body.scrollLeft+event.clientX;
	obj.style.top	= document.body.scrollTop+event.clientY;
	document.all.waPaper.innerHTML = llt;
}


function PaperInternalClosePopup(){
	var obj = document.all.waPaper;
	obj.style.visibility = "hidden";
}

function baseSelect(color,cel){
	if(color){ 
		document.all.Papercell.innerHTML = "<img src='"+color+"'>";
		document.all.testcell4.style.backgroundImage = "url('"+color+"')";
	}
}

