function fnGrow(im, flag)
{
	if (flag)
	{
		im.width  = 100;
		im.height = 100;
	}	
	else
	{
		im.width  = 50;
		im.height = 50;
	}	
}

function selectPaint(n)
{
	parent.Panel.selectPaint(n);			
}		
		
function makeDisable()
{
	var x=document.forms.myForm.mySelect
	x.disabled=true
}

function makeEnable()
{
	var x=document.forms.myForm.mySelect
	x.disabled=false
}

function fnGlow(im, flag)
{
	if (flag)
		im.style.filter="Gray()";
	else
		im.style.filter=false;
		
}
				
function onSingletClick(n)
{
	 var x= parent.Panel.document.forms.DESIGN.SingletDesign;
	 x.selectedIndex = n;
	 tweakLists(n);
	 
	if (parent.Studio.document.SelSinglet && (n > 0))
	{		 		
				parent.Studio.document.SelSinglet.src= "images/designb"+n+".jpg";			 			 		
				parent.Studio.document.SelSinglet.alt= "Design "+n;			 			 		
			   if (parent.Studio.document.colorA)
				{
					parent.Studio.document.colorA.src = "";				
			   	parent.Studio.document.colorA.width = 0;				
			   	parent.Studio.document.colorA.height = 0;				

					var obj = parent.Panel.document.getElementById("ColorSelectA");
					if (obj) obj.click();
			   }
			   if (parent.Studio.document.colorB)
				{
					parent.Studio.document.colorB.src = "";				
				   parent.Studio.document.colorB.width = 0;				
				   parent.Studio.document.colorB.height = 0;				
				}
			   if (parent.Studio.document.colorC)
				{
				   parent.Studio.document.colorC.src = "";				
				   parent.Studio.document.colorC.width = 0;				
				   parent.Studio.document.colorC.height = 0;				
				}
			   if (parent.Studio.document.colorD)
				{
				   parent.Studio.document.colorD.src = "";				
				   parent.Studio.document.colorD.width = 0;				
				   parent.Studio.document.colorD.height = 0;				
				}
			   if (parent.Studio.document.colorE)
				{
				   parent.Studio.document.colorE.src = "";				
				   parent.Studio.document.colorE.width = 0;				
				   parent.Studio.document.colorE.height = 0;
				}
		}		
		else
		{
				parent.Studio.document.SelSinglet.width= 1;			 			 		
				parent.Studio.document.SelSinglet.height= 1;			 			 		
				parent.Studio.document.SelSinglet.src= "";			 			 		
				parent.Studio.document.SelSinglet.alt= "";			 			 		
		}

	if (n > 0)
	{
		parent.Panel.onMouseClick('Button1');
		parent.Picker.location = "palette.php";											 			 			
	}
}

function hide(o)
{
	o.style.display ='none';
}

function show(o)
{
	o.style.display ='';
}

function tweakLists(n)
{
	var f= parent.Panel.document.forms.DESIGN;
	f.ColorA.selectedIndex=0;
	f.ColorB.selectedIndex=0;
	f.ColorC.selectedIndex=0;
	f.ColorD.selectedIndex=0;
	f.ColorE.selectedIndex=0;
	optA = parent.Panel.document.getElementById("ColorSelectA");
	optB = parent.Panel.document.getElementById("ColorSelectB");
	optC = parent.Panel.document.getElementById("ColorSelectC");
	optD = parent.Panel.document.getElementById("ColorSelectD");
	optE = parent.Panel.document.getElementById("ColorSelectE");
	ra = parent.Panel.document.getElementById("rA");
	rb = parent.Panel.document.getElementById("rB");
	rc = parent.Panel.document.getElementById("rC");
	rd = parent.Panel.document.getElementById("rD");
	re = parent.Panel.document.getElementById("rE");
	
	switch (n)
	{
		case 1:	
					show(f.ColorA); 
					hide(f.ColorB);  hide(f.ColorC);  hide(f.ColorD); hide(f.ColorE);
					
					show(optA);
					hide(optB); hide(optC); hide(optD); hide(optE);

					show(ra);
					hide(rb); hide(rc); hide(rd); hide(re);
					break;
			
		case 2: case 3: case 6: case 10: case 12: case 14:	
		case 15: case 23: case 56:
					show(f.ColorA); show(f.ColorB);  
					hide(f.ColorC);  hide(f.ColorD); hide(f.ColorE);
					
					show(optA); show(optB); 
					hide(optC); hide(optD); hide(optE);

					show(ra); show(rb); 
					hide(rc); hide(rd); hide(re);
					break;
			
		case 4: case 5: case 9: case 11: case 13: case 16:
		case 17: case 19: case 20: case 24:
		case 31: case 32: case 33: case 34:
		case 35: case 36: case 37: case 38:
		case 41: case 42: case 43: case 45:
		case 46: case 47: case 48: case 49:
		case 50: case 51: case 52: case 53:
		case 54: case 55: case 58: case 59: case 60:
					show(f.ColorA); show(f.ColorB); show(f.ColorC);   
					hide(f.ColorD); hide(f.ColorE);
					
					show(optA); show(optB); show(optC); 
					hide(optD); hide(optE);

					show(ra); show(rb); show(rc); 
					hide(rd); hide(re);
					break;
			
		case 7: case 21: case 25: case 27: case 28: case 29:
		case 39: case 40: case 44:
					show(f.ColorA); show(f.ColorB); show(f.ColorC); show(f.ColorD);   
					hide(f.ColorE);
					
					show(optA); show(optB); show(optC); show(optD); 
					hide(optE);

					show(ra); show(rb); show(rc); show(rd); 
					hide(re);
					break;
			
		case 8: case 18: case 22: case 26: case 30:
		case 57:
					show(f.ColorA); show(f.ColorB); show(f.ColorC); show(f.ColorD); show(f.ColorE);   
					
					show(optA); show(optB); show(optC); show(optD); show(optE);
					
					show(ra); show(rb); show(rc); show(rd); show(re);
					
					break;
			
	}
	
}
