function chf(){
isOK=true;
n=0;
fq=0;
   for(var x=1; x<=6; x++)
   {
if(document.getElementById("t"+x)){
fq++;
if((document.getElementById("t"+x).value=='jmale') || (document.getElementById("t"+x).value=='jfemale') || (document.getElementById("t"+x).value=='jpet') || (document.getElementById("t"+x).value=='jbaby'))
{
d='name'+x;
var isStoryMaker = (document.getElementById("selectedImage"+x).src.indexOf('storymakers')!=-1 && document.getElementById("selectedImage"+x).src.indexOf('BUBBLE')==-1) ? true : false;

if(document.getElementById("name"+x)){
if(isStoryMaker){
}else{
	f=document.getElementById("name"+x);
	if(f.value){
	if(f.value == 'Name (Optional)' || f.value.name == '' ){
	//isOK=false;
	//n++;
	//alert("Forget someone? Please make sure to name all of your humans and pets (Image "+ x +"), or, you can leave them all blank if you prefer.");
	//	f.focus();
	var answer = confirm ("Forget someone? Please make sure to name all of your humans and pets (Image "+ x +"), or, you can leave them all blank if you prefer. Press 'Cancel' to skip")
	if (!answer){
	}else{
		f.focus();
		isOK=false;
	}
		}	
	}/*else if(f.value.length == 0 ){
	isOK=false;
	n++;
	alert("Forget someone? Please make sure to name all of your humans and pets, or, you can leave them all blank if you prefer.");
	f.focus();
	}
	
	f=document.getElementById("name"+x);
	if(f.value == 'Name (Optional)' ){
	isOK=false;
	n++;
	alert("Forget someone? Please make sure to name all of your humans and pets, or, you can leave them all blank if you prefer.");
	f.focus();
	}else if(f.value.length > 0){
	//	alert(f.value);
	}else if(f.value.length == 0 ){
	isOK=false;
	n++;
	alert("Please make sure to name all of your humans and pets, or, you can leave them all blank if you prefer, but please don't leave anyone out!");
	f.focus();
	}else{
	isOK=false;
	n++;
		alert("Please make sure to name all of your humans and pets, or, you can leave them all blank if you prefer, but please don't leave anyone out!");
		f.focus();
		}*/
}//end storymaker
}

}

}

}
//alert(n);
//alert(fq);

   for(var x=1; x<=6; x++)
   {
if(n<fq){

//alert(h);
if(document.getElementById("t"+x)){
if((document.getElementById("t"+x).value=='jmale') || (document.getElementById("t"+x).value=='jfemale') || (document.getElementById("t"+x).value=='jpet') || (document.getElementById("t"+x).value=='jbaby'))
{

d='name'+x;
if(document.getElementById(d)){

f=document.getElementById(d);
if(f.value){}
else{
//isOK=false;
//alert("Please provide name for character number "+x+".");
}
}

}

}}


if(document.getElementById("hair"+x)){
ok=2;
if(document.getElementById("accface"+x)){
if(document.getElementById("accface"+x).value==""){ok=1;}
}
if((document.getElementById("selectedImage"+x).src=='http://www.doodlekins.com/female/female001.gif') || (document.getElementById("selectedImage"+x).src=='http://www.doodlekins.com/baby/baby1.gif') || 
((document.getElementById("selectedImage"+x).src=='http://www.doodlekins.com/male/male31.gif')&(ok==1))){}else{
if(document.getElementById("hair"+x).value){}
else{
isOK=false;
//alert("Please select haircolor for character number "+x+".");
alert("Please click on all blue buttons to customize your image!  If you don't want an accessory, choose \"no accessory\" option.");
}
}
}


if(document.getElementById("t"+x)){
f1=document.getElementById("t"+x);


if(document.getElementById("t"+x).value=='jpet'){

if(document.getElementById("colora"+x)){
f=document.getElementById("colora"+x);
//if(document.getElementById("colora"+x).style.display != ""){
if(f.value){}
else{
isOK=false;
alert("Please select pet color for gray area shown on character number "+x+".");
}
}
//}  

if(document.getElementById("colorb"+x)){
f=document.getElementById("colorb"+x);
if(document.getElementById("colorBodyb"+x).style.display != "none"){
if(f.value){}
else{
isOK=false;
//alert("Please select pet color for yellow area shown on character number "+x+".");
alert("Please click on all blue buttons to customize your image!  If you don't want an accessory, choose \"no accessory\" option.");

}}
}  

if(document.getElementById("colorc"+x)){
f=document.getElementById("colorc"+x);
//alert(document.getElementById("colorCDiv"+x).style.display);
//if(document.getElementById("colorc"+x).style.display){alert("ss");}
if(document.getElementById("colorBodyc"+x).style.display!="none"){
if(f.value){}
else{
isOK=false;
//alert("Please select pet color for orange area shown on character number "+x+".");
alert("Please click on all blue buttons to customize your image!  If you don't want an accessory, choose \"no accessory\" option.");

}}
}  

}
}
if(document.getElementById("size"+x)){
f=document.getElementById("size"+x);
if(f.value){}
else{
isOK=false;
//alert("Please select size for character number "+x+".");
alert("Please click on all blue buttons to customize your image!  If you don't want an accessory, choose \"no accessory\" option.");

}}

if(document.getElementById("skin"+x)){
f=document.getElementById("skin"+x);
if(f.value){}
else{
isOK=false;
//alert("Please select skin color for character number "+x+".");
alert("Please click on all blue buttons to customize your image!  If you don't want an accessory, choose \"no accessory\" option.");

}}

}
return isOK;
}

function getMaleForm(imgNum){
	
 var formText = "";

 formText +="<input type='hidden' name='type" + imgNum + "' id='type" + imgNum + "' value='jmale'>"; 
 
 formText +="<table width='100%' style='font-family: Tahoma; font-size: 12px; color: #717171;' cellspacing='0' cellpadding='0'>";
 
 formText +="<tr>";

 formText +="<td bgcolor='#FFFFFF' valign='top' align=left>";

 formText +="<table width='100%' class='ordertext2' cellspacing='0'  cellpadding='0'>";
 
 formText +="<tr bgcolor='#FFFFFF' >";

 formText +="<td align='center' width=''>Head Size</td>";

 formText +="<td align='center' width=''>Skin Color</td>";

 formText +="<td align='center' width='' id='hairHeader" + imgNum + "'>Hair Color</td>";

 formText +="<td align='center' width=''>Eyes</td>";

 formText +="<td align='center' width=''>Mouth</td>";

 formText +="<td align='center' width=''>Neck</td>";
 
 //formText +="  <td align='center' width='70px'>Color</td>";

 formText +="<td align='center' width=''>Head</td>";

 formText +="</tr>";
   
 formText +="<tr bgcolor='#FFFFFF' >";
 
 formText +="<td valign='bottom' align='center' width='' style='border-top:2px solid #FFFFFF'><a href='' onclick='openHeadsizeSelector(" + imgNum + ",\"male\"); return false;'><div id='headsizeSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='size" + imgNum + "' id='size" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openSkinSelector(" + imgNum + ",\"male\"); return false;'><div id='skinSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='skin" + imgNum + "' id='skin" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center' id='hairBody" + imgNum + "'><a href='' onclick='openHairSelector(" + imgNum + ",\"male\"); return false;'><div id='hairSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='hair" + imgNum + "' id='hair" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openEyesSelector(" + imgNum + ",\"male\"); return false;'><div id='eyesSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acceyes" + imgNum + "' id='acceyes" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openMouthSelector(" + imgNum + ",\"male\"); return false;'><div id='mouthSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accmouth" + imgNum + "' id='accmouth" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openNeckSelector(" + imgNum + ",\"male\",\"male\"); return false;'><div id='neckSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accneck" + imgNum + "' id='accneck" + imgNum + "'></td>";

 //formText +="  <td valign='bottom' align='center'><a href='' onclick='openColorSelector(" + imgNum + "); return false;'><div id='colorSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><br><input type='hidden' name='color" + imgNum + "' id='color" + imgNum + "'><br></td>";
   
 formText +="<td valign='bottom' align='center'><a href='' onclick='openHeadSelector(" + imgNum + ",\"male\"); return false;'><div id='headSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acchead" + imgNum + "' id='acchead" + imgNum + "'></td>";

 formText +="</tr>";

 formText +="</table>";

 formText +="</td>";

 formText +="<td bgcolor='#FFFFFF' valign='top'></td>";

 formText +="</tr>";
 
 formText +="</table>";

 formText +="<input type='hidden' id='t"+imgNum+"' name='t"+imgNum+"' value='jmale'>";

 formText +="<input type='hidden' id='im"+imgNum+"' name='im"+imgNum+"' value=''>";
 
 return formText;
 
}

function getMaletForm(imgNum){
	
 var formText = "";

 formText +="<input type='hidden' name='type" + imgNum + "' id='type" + imgNum + "' value='jmale'>"; 
 
 formText +="<table width='100%' style='font-family: Tahoma; font-size: 12px; color: #717171;' cellspacing='0' cellpadding='0'>";
 
 formText +="<tr>";

 formText +="<td bgcolor='#FFFFFF' valign='top' align=left>";

 formText +="<table width='100%' class='ordertext2' cellspacing='0'  cellpadding='0'>";
 
 formText +="<tr bgcolor='#FFFFFF' >";

 formText +="<td align='center' width=''>Head Size</td>";

 formText +="<td align='center' width=''>Skin Color</td>";

 //formText +="<td align='center' width='' id='hairHeader" + imgNum + "'>Hair Color</td>";

 formText +="<td align='center' width=''>Eyes</td>";

 formText +="<td align='center' width=''>Mouth</td>";

 formText +="<td align='center' width=''>Neck</td>";
 
 //formText +="  <td align='center' width='70px'>Color</td>";

 formText +="<td align='center' width=''>Head</td>";

 formText +="</tr>";
   
 formText +="<tr bgcolor='#FFFFFF' >";
 
 formText +="<td valign='bottom' align='center' width='' style='border-top:2px solid #FFFFFF'><a href='' onclick='openHeadsizeSelector(" + imgNum + ",\"male\"); return false;'><div id='headsizeSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='size" + imgNum + "' id='size" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openSkinSelector(" + imgNum + ",\"male\"); return false;'><div id='skinSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='skin" + imgNum + "' id='skin" + imgNum + "'></td>";

 //formText +="<td valign='bottom' align='center' id='hairBody" + imgNum + "'><a href='' onclick='openHairSelector(" + imgNum + ",\"male\"); return false;'><div id='hairSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='hair" + imgNum + "' id='hair" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openEyesSelector(" + imgNum + ",\"male\"); return false;'><div id='eyesSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acceyes" + imgNum + "' id='acceyes" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openMouthSelector(" + imgNum + ",\"male\"); return false;'><div id='mouthSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accmouth" + imgNum + "' id='accmouth" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openNeckSelector(" + imgNum + ",\"male\",\"male\"); return false;'><div id='neckSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accneck" + imgNum + "' id='accneck" + imgNum + "'></td>";

 //formText +="  <td valign='bottom' align='center'><a href='' onclick='openColorSelector(" + imgNum + "); return false;'><div id='colorSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><br><input type='hidden' name='color" + imgNum + "' id='color" + imgNum + "'><br></td>";
   
 formText +="<td valign='bottom' align='center'><a href='' onclick='openHeadSelector(" + imgNum + ",\"male\"); return false;'><div id='headSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acchead" + imgNum + "' id='acchead" + imgNum + "'></td>";

 formText +="</tr>";

 formText +="</table>";

 formText +="</td>";

 formText +="<td bgcolor='#FFFFFF' valign='top'></td>";

 formText +="</tr>";
 
 formText +="</table>";

 formText +="<input type='hidden' id='t"+imgNum+"' name='t"+imgNum+"' value='jmale'>";

 formText +="<input type='hidden' id='im"+imgNum+"' name='im"+imgNum+"' value=''>";
 
 return formText;
 
}

function getFemaleForm(imgNum)

{

  var formText = "";

 formText +="<input type='hidden' name='type" + imgNum + "' id='type" + imgNum + "' value='jfemale'>"; 
 
 formText +="<table width='100%' style='font-family: Tahoma; font-size: 12px; color: #717171;' cellspacing='0'>";
 
 formText +="<tr>";

 formText +=" <td bgcolor='#FFFFFF' valign='top' align=left>";

 formText +=" <table width='100%' class='ordertext2' cellspacing='0'>";
 
 formText +=" <tr bgcolor='#FFFFFF' >";

 formText +="  <td align='center' width=''>Head Size</td>";

 formText +="  <td align='center' width=''>Skin Color</td>";

 formText +="  <td align='center' width=''>Hair Color</td>";

 formText +="  <td align='center' width=''>Eyes</td>";

 formText +="  <td align='center' width=''>Mouth</td>";

 formText +="  <td align='center' width=''>Neck</td>";
 
// formText +="  <td align='center' width='70px'>Color</td>";

 formText +="  <td align='center' width=''>Head</td>";

 formText +=" </tr>";
 
  
 formText +=" <tr bgcolor='#FFFFFF' >";
 

 formText +="  <td valign='bottom' align='center' width='' style='border-top:2px solid #FFFFFF'><a href='' onclick='openHeadsizeSelector(" + imgNum + ",\"female\"); return false;'><div id='headsizeSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='size" + imgNum + "' id='size" + imgNum + "'></td>";

 formText +="  <td valign='bottom' align='center'><a href='' onclick='openSkinSelector(" + imgNum + ",\"female\"); return false;'><div id='skinSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='skin" + imgNum + "' id='skin" + imgNum + "'></td>";

 formText +="  <td valign='bottom' align='center'><a href='' onclick='openHairSelector(" + imgNum + ",\"female\"); return false;'><div id='hairSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='hair" + imgNum + "' id='hair" + imgNum + "'></td>";

 formText +="  <td valign='bottom' align='center'><a href='' onclick='openEyesSelector(" + imgNum + ",\"female\"); return false;'><div id='eyesSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acceyes" + imgNum + "' id='acceyes" + imgNum + "'></td>";

 formText +="  <td valign='bottom' align='center'><a href='' onclick='openMouthSelector(" + imgNum + ",\"female\"); return false;'><div id='mouthSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accmouth" + imgNum + "' id='accmouth" + imgNum + "'></td>";

 formText +="  <td valign='bottom' align='center'><a href='' onclick='openNeckSelector(" + imgNum + ",\"female\"); return false;'><div id='neckSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accneck" + imgNum + "' id='accneck" + imgNum + "'></td>";

 //formText +="  <td valign='bottom' align='center'><a href='' onclick='openColorSelector(" + imgNum + "); return false;'><div id='colorSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><br><input type='hidden' name='color" + imgNum + "' id='color" + imgNum + "'><br></td>";
   
 formText +="  <td valign='bottom' align='center'><a href='' onclick='openHeadSelector(" + imgNum + ",\"female\"); return false;'><div id='headSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acchead" + imgNum + "' id='acchead" + imgNum + "'></td>";

 formText +=" </tr>";

 formText +=" </table>";

 formText +=" </td>";

 formText +=" <td bgcolor='#FFFFFF' valign='top'></td>";

 formText +="</tr>";
 

 formText +="</table>";

 formText +="<input type='hidden' id='t"+imgNum+"' name='t"+imgNum+"' value='jfemale'>";

 formText +="<input type='hidden' id='im"+imgNum+"' name='im"+imgNum+"' value=''>";
 
 return formText;
}

function getFemaletForm(imgNum)

{

  var formText = "";

 formText +="<input type='hidden' name='type" + imgNum + "' id='type" + imgNum + "' value='jfemale'>"; 
 
 formText +="<table width='100%' style='font-family: Tahoma; font-size: 12px; color: #717171;' cellspacing='0'>";
 
 formText +="<tr>";

 formText +=" <td bgcolor='#FFFFFF' valign='top' align=left>";

 formText +=" <table width='100%' class='ordertext2' cellspacing='0'>";
 
 formText +=" <tr bgcolor='#FFFFFF' >";

 formText +="  <td align='center' width=''>Head Size</td>";

 formText +="  <td align='center' width=''>Skin Color</td>";

// formText +="  <td align='center' width=''>Hair Color</td>";

 formText +="  <td align='center' width=''>Eyes</td>";

 formText +="  <td align='center' width=''>Mouth</td>";

 formText +="  <td align='center' width=''>Neck</td>";
 
// formText +="  <td align='center' width='70px'>Color</td>";

 formText +="  <td align='center' width=''>Head</td>";

 formText +=" </tr>";
 
  
 formText +=" <tr bgcolor='#FFFFFF' >";
 

 formText +="  <td valign='bottom' align='center' width='' style='border-top:2px solid #FFFFFF'><a href='' onclick='openHeadsizeSelector(" + imgNum + ",\"female\"); return false;'><div id='headsizeSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='size" + imgNum + "' id='size" + imgNum + "'></td>";

 formText +="  <td valign='bottom' align='center'><a href='' onclick='openSkinSelector(" + imgNum + ",\"female\"); return false;'><div id='skinSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='skin" + imgNum + "' id='skin" + imgNum + "'></td>";

// formText +="  <td valign='bottom' align='center'><a href='' onclick='openHairSelector(" + imgNum + ",\"female\"); return false;'><div id='hairSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='hair" + imgNum + "' id='hair" + imgNum + "'></td>";

 formText +="  <td valign='bottom' align='center'><a href='' onclick='openEyesSelector(" + imgNum + ",\"female\"); return false;'><div id='eyesSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acceyes" + imgNum + "' id='acceyes" + imgNum + "'></td>";

 formText +="  <td valign='bottom' align='center'><a href='' onclick='openMouthSelector(" + imgNum + ",\"female\"); return false;'><div id='mouthSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accmouth" + imgNum + "' id='accmouth" + imgNum + "'></td>";

 formText +="  <td valign='bottom' align='center'><a href='' onclick='openNeckSelector(" + imgNum + ",\"female\"); return false;'><div id='neckSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accneck" + imgNum + "' id='accneck" + imgNum + "'></td>";

 //formText +="  <td valign='bottom' align='center'><a href='' onclick='openColorSelector(" + imgNum + "); return false;'><div id='colorSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><br><input type='hidden' name='color" + imgNum + "' id='color" + imgNum + "'><br></td>";
   
 formText +="  <td valign='bottom' align='center'><a href='' onclick='openHeadSelector(" + imgNum + ",\"female\"); return false;'><div id='headSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acchead" + imgNum + "' id='acchead" + imgNum + "'></td>";

 formText +=" </tr>";

 formText +=" </table>";

 formText +=" </td>";

 formText +=" <td bgcolor='#FFFFFF' valign='top'></td>";

 formText +="</tr>";
 

 formText +="</table>";

 formText +="<input type='hidden' id='t"+imgNum+"' name='t"+imgNum+"' value='jfemale'>";

 formText +="<input type='hidden' id='im"+imgNum+"' name='im"+imgNum+"' value=''>";
 
 return formText;
}

function getBabyForm(imgNum){

  var formText = "";

 formText +="<input type='hidden' name='type" + imgNum + "' id='type" + imgNum + "' value='jmale'>"; 
 
 formText +="<table width='100%' style='font-family: Tahoma; font-size: 12px; color: #717171;' cellspacing='0' cellpadding='0'>";
 
 formText +="<tr>";

 formText +="<td bgcolor='#FFFFFF' valign='top' align=left>";

 formText +="<table width='100%' class='ordertext2' cellspacing='0'  cellpadding='0'>";
 
 formText +="<tr bgcolor='#FFFFFF' >";

 formText +="<td align='center' width=''>Head Size</td>";

 formText +="<td align='center' width=''>Skin Color</td>";

 formText +="<td align='center' width=''>Hair Color</td>";

 formText +="<td align='center' width=''>Eyes</td>";

 formText +="<td align='center' width=''>Mouth</td>";

 formText +="<td align='center' width=''>Neck</td>";
 
 //formText +="  <td align='center' width='70px'>Color</td>";

 formText +="<td align='center' width=''>Head</td>";

 formText +="</tr>";
   
 formText +="<tr bgcolor='#FFFFFF' >";
 
 formText +="<td valign='bottom' align='center' width='' style='border-top:2px solid #FFFFFF'><a href='' onclick='openHeadsizeSelector(" + imgNum + ",\"baby\"); return false;'><div id='headsizeSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='size" + imgNum + "' id='size" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openSkinSelector(" + imgNum + ",\"baby\"); return false;'><div id='skinSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='skin" + imgNum + "' id='skin" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openHairSelector(" + imgNum + ",\"baby\"); return false;'><div id='hairSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='hair" + imgNum + "' id='hair" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openEyesSelector(" + imgNum + ",\"baby\"); return false;'><div id='eyesSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acceyes" + imgNum + "' id='acceyes" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openMouthSelector(" + imgNum + ",\"baby\"); return false;'><div id='mouthSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accmouth" + imgNum + "' id='accmouth" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openNeckSelector(" + imgNum + ",\"baby\",\"male\"); return false;'><div id='neckSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accneck" + imgNum + "' id='accneck" + imgNum + "'></td>";

 //formText +="  <td valign='bottom' align='center'><a href='' onclick='openColorSelector(" + imgNum + "); return false;'><div id='colorSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><br><input type='hidden' name='color" + imgNum + "' id='color" + imgNum + "'><br></td>";
   
 formText +="<td valign='bottom' align='center'><a href='' onclick='openHeadSelector(" + imgNum + ",\"baby\"); return false;'><div id='headSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acchead" + imgNum + "' id='acchead" + imgNum + "'></td>";

 formText +="</tr>";

 formText +="</table>";

 formText +="</td>";

 formText +="<td bgcolor='#FFFFFF' valign='top'></td>";

 formText +="</tr>";
 
 formText +="</table>";

 formText +="<input type='hidden' id='t"+imgNum+"' name='t"+imgNum+"' value='jbaby'>";

 formText +="<input type='hidden' id='im"+imgNum+"' name='im"+imgNum+"' value=''>";
 
 return formText;
 
}

function getBabytForm(imgNum){

  var formText = "";

 formText +="<input type='hidden' name='type" + imgNum + "' id='type" + imgNum + "' value='jmale'>"; 
 
 formText +="<table width='100%' style='font-family: Tahoma; font-size: 12px; color: #717171;' cellspacing='0' cellpadding='0'>";
 
 formText +="<tr>";

 formText +="<td bgcolor='#FFFFFF' valign='top' align=left>";

 formText +="<table width='100%' class='ordertext2' cellspacing='0'  cellpadding='0'>";
 
 formText +="<tr bgcolor='#FFFFFF' >";

 formText +="<td align='center' width=''>Head Size</td>";

 formText +="<td align='center' width=''>Skin Color</td>";

// formText +="<td align='center' width=''>Hair Color</td>";

 formText +="<td align='center' width=''>Eyes</td>";

 formText +="<td align='center' width=''>Mouth</td>";

 formText +="<td align='center' width=''>Neck</td>";
 
 //formText +="  <td align='center' width='70px'>Color</td>";

 formText +="<td align='center' width=''>Head</td>";

 formText +="</tr>";
   
 formText +="<tr bgcolor='#FFFFFF' >";
 
 formText +="<td valign='bottom' align='center' width='' style='border-top:2px solid #FFFFFF'><a href='' onclick='openHeadsizeSelector(" + imgNum + ",\"baby\"); return false;'><div id='headsizeSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='size" + imgNum + "' id='size" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openSkinSelector(" + imgNum + ",\"baby\"); return false;'><div id='skinSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='skin" + imgNum + "' id='skin" + imgNum + "'></td>";

// formText +="<td valign='bottom' align='center'><a href='' onclick='openHairSelector(" + imgNum + ",\"baby\"); return false;'><div id='hairSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='hair" + imgNum + "' id='hair" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openEyesSelector(" + imgNum + ",\"baby\"); return false;'><div id='eyesSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acceyes" + imgNum + "' id='acceyes" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openMouthSelector(" + imgNum + ",\"baby\"); return false;'><div id='mouthSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accmouth" + imgNum + "' id='accmouth" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openNeckSelector(" + imgNum + ",\"baby\",\"male\"); return false;'><div id='neckSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accneck" + imgNum + "' id='accneck" + imgNum + "'></td>";

 //formText +="  <td valign='bottom' align='center'><a href='' onclick='openColorSelector(" + imgNum + "); return false;'><div id='colorSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><br><input type='hidden' name='color" + imgNum + "' id='color" + imgNum + "'><br></td>";
   
 formText +="<td valign='bottom' align='center'><a href='' onclick='openHeadSelector(" + imgNum + ",\"baby\"); return false;'><div id='headSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acchead" + imgNum + "' id='acchead" + imgNum + "'></td>";

 formText +="</tr>";

 formText +="</table>";

 formText +="</td>";

 formText +="<td bgcolor='#FFFFFF' valign='top'></td>";

 formText +="</tr>";
 
 formText +="</table>";

 formText +="<input type='hidden' id='t"+imgNum+"' name='t"+imgNum+"' value='jbaby'>";

 formText +="<input type='hidden' id='im"+imgNum+"' name='im"+imgNum+"' value=''>";
 
 return formText;
 
}



function getPetForm(imgNum)

{

  var formText = "";

 formText +="<input type='hidden' name='type" + imgNum + "' id='type" + imgNum + "' value='jpet'>";
 
 formText +="<table width='100%' style='font-family: Tahoma; font-size: 12px; color: #717171;' cellspacing='0'>";
 
 formText +="<tr bgcolor='#FFFFFF'>";

 formText +="<td bgcolor='#FFFFFF' valign='top' align=left>";

 formText +="<table width='100%' class='ordertext2' cellspacing='0'>";
 
 formText +="<tr bgcolor='#FFFFFF' >";

 formText +="<td align='center' width=''>Head Size</td>";
 
 formText +="<td align='center' width='' id='colorHeadera" + imgNum + "'>Color Gray</td>";

 formText +="<td align='center' width='' id='colorHeaderb" + imgNum + "'>Color Yellow</td>";

 formText +="<td align='center' width='' id='colorHeaderc" + imgNum + "'>Color Orange</td>";
 
 formText +="<td align='center' width=''>Eyes</td>";

 formText +="<td align='center' width=''>Neck</td>";

 formText +="<td align='center' width=''>Head</td>";
 
 formText +="<td align='center' width='' id='colorHeaderClonea" + imgNum + "' style='display:none;' >&nbsp;</td>";
 
 formText +="<td align='center' width='' id='colorHeaderCloneb" + imgNum + "' style='display:none;' >&nbsp;</td>";
 
 formText +="</tr>";

 formText +="<tr bgcolor='#FFFFFF' >";
 
 formText +="<td valign='bottom' align='center' width='' style='border-top:3px solid #FFFFFF'><a href='' onclick='openHeadsizeSelector(" + imgNum + ",\"pet\"); return false;'><div id='headsizeSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='size" + imgNum + "' id='size" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center' id='colorBodya" + imgNum + "'><a href='' onclick='openColoraSelector(" + imgNum + ",\"pet\"); return false;'><div id='coloraSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='colora" + imgNum + "' id='colora" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center' id='colorBodyb" + imgNum + "'><a href='' onclick='openColorbSelector(" + imgNum + ",\"pet\"); return false;'><div id='colorbSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='colorb" + imgNum + "' id='colorb" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center' id='colorBodyc" + imgNum + "'><a href='' onclick='openColorcSelector(" + imgNum + ",\"pet\"); return false;'><div id='colorcSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='colorc" + imgNum + "' id='colorc" + imgNum + "'></td>";
 
 formText +="<td valign='bottom' align='center'><a href='' onclick='openEyesSelector(" + imgNum + ",\"pet\"); return false;'><div id='eyesSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acceyes" + imgNum + "' id='acceyes" + imgNum + "'></td>";

 formText +="<td valign='bottom' align='center'><a href='' onclick='openNeckSelector(" + imgNum + ",\"pet\"); return false;'><div id='neckSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='accneck" + imgNum + "' id='accneck" + imgNum + "'></td>";
 
 formText +="<td valign='bottom' align='center'><a href='' onclick='openHeadSelector(" + imgNum + ",\"pet\"); return false;'><div id='headSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='acchead" + imgNum + "' id='acchead" + imgNum + "'></td>";
  
 formText +="<td bgcolor='#FFFFFF' valign='bottom' align='center' id='colorBodyClonea" + imgNum + "' style='display:none;' >&nbsp;</td>";
 
 formText +="<td bgcolor='#FFFFFF' valign='bottom' align='center' id='colorBodyCloneb" + imgNum + "' style='display:none;' >&nbsp;</td>";
 
 formText +="</tr>";

 formText +="</table>";

 formText +="</td>";

 formText +="<td bgcolor='#FFFFFF' valign='top'><input type='hidden' id='t"+imgNum+"' name='t"+imgNum+"' value='jpet'></td>";

 formText +="</tr>";
 
 formText +="</table>";
 
 return formText;
 
}


function getStoryForm0(imgNum)

{

 var formText = "";

 

 formText +=" <input type='hidden' name='type" + imgNum + "' id='type" + imgNum + "' value='jstorymaker0'>";

 formText +="<input type='hidden' id='t"+imgNum+"' name='t"+imgNum+"' value='jstory0'>&nbsp;";

 return formText;

}



function getStoryForm1(imgNum)

{

 var formText = "";

 formText +=" <input type='hidden' name='type" + imgNum + "' id='type" + imgNum + "' value='jstorymaker1'>";

 formText +="<table width='70px' style='font-family: Tahoma; font-size: 12px; color: #717171;' cellspacing='0' align='left'>";
 
 formText +="<tr>";

 formText +=" <td bgcolor='#FFFFFF' valign='top' align=left>";

 formText +=" <table width='70px' class='ordertext2' cellspacing='0' align='left'>";
 
 formText +=" <tr bgcolor='#FFFFFF' >";

 formText +="  <td align='center' width='70px' id='colorHeadera" + imgNum + "'>Color 1</td>";

 formText +=" </tr>";
 
 formText +=" <tr bgcolor='#FFFFFF' >";
 
 formText +="  <td valign='bottom' align='left' id='colorBodya" + imgNum + "' style='border-top:3px solid #FFFFFF'><a href='' onclick='openStoryColoraSelector(" + imgNum + "); return false;'><div id='coloraSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><br><input type='hidden' name='colora" + imgNum + "' id='colora" + imgNum + "'><br></td>";

 formText +=" </tr>";

 formText +=" </table>";

 formText +=" </td>";

 formText +=" <td bgcolor='#FFFFFF' valign='top'></td>";

 formText +="</tr>";
 

 formText +="</table>";

 formText +="<input type='hidden' id='t"+imgNum+"' name='t"+imgNum+"' value='jstory1'>";

 return formText;

}



function getStoryForm3(imgNum)

{

 var formText = "";
 

 formText +=" <input type='hidden' name='type" + imgNum + "' id='type" + imgNum + "' value='jstorymaker3'>";

 formText +="<table width='100%' style='font-family: Tahoma; font-size: 12px; color: #717171;' cellspacing='0'>";
 
 formText +="<tr>";

 formText +=" <td bgcolor='#FFFFFF' valign='top' align=left>";

 formText +=" <table width='100%' class='ordertext2' cellspacing='0'>";
 
 formText +=" <tr bgcolor='#FFFFFF' >";

 formText +="  <td align='center' width='' id='colorHeadera" + imgNum + "'>Roof, window trim <br>and step colors</td>";

 formText +="  <td align='center' width='' id='colorHeaderb" + imgNum + "'>House Paint Color</td>";

 formText +="  <td align='center' width='' id='colorHeaderc" + imgNum + "'>Door Color</td>";

 formText +=" </tr>";
 
 formText +=" <tr bgcolor='#FFFFFF' >";
 
 formText +="  <td valign='bottom' align='center' id='colorBodya" + imgNum + "' style='border-top:3px solid #FFFFFF'><a href='' onclick='openStoryColoraSelector(" + imgNum + "); return false;'><div id='coloraSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='colora" + imgNum + "' id='colora" + imgNum + "'></td>";

 formText +="  <td valign='bottom' align='center' id='colorBodyb" + imgNum + "'><a href='' onclick='openStoryColorbSelector(" + imgNum + "); return false;'><div id='colorbSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='colorb" + imgNum + "' id='colorb" + imgNum + "'></td>";

 formText +="  <td valign='bottom' align='center' id='colorBodyc" + imgNum + "'><a href='' onclick='openStoryColorcSelector(" + imgNum + "); return false;'><div id='colorcSelected" + imgNum + "'><img src='cats_other/mice.gif' border=0></div></a><input type='hidden' name='colorc" + imgNum + "' id='colorc" + imgNum + "'></td>";
 
 formText +=" </tr>";

 formText +=" </table>";

 formText +=" </td>";

 formText +=" <td bgcolor='#FFFFFF' valign='top'></td>";

 formText +="</tr>";
 

 formText +="</table>";


 formText +="<input type='hidden' id='t"+imgNum+"' name='t"+imgNum+"' value='jstory2'>";
 

 return formText;

}



function getSpeechForm(imgNum)

{

 var formText = "";

 

 formText +=" <input type='hidden' name='type" + imgNum + "' id='type" + imgNum + "' value='jspeechbubble'>";

 formText +=" <table width='100%' style='font-family: Tahoma; font-size: 12px; color: #717171;' cellspacing='0'>";

 formText +=" <tr>";

 formText +="  <td><b>&nbsp;</b></td>";

 formText +=" </tr>";

 formText +=" <tr>";

 formText +="  <td align=left align='left'>";

 formText +="  <b>Choose one of ours: </b><select name='sbtext" + imgNum + "' id='sbtext" + imgNum + "'>";

 formText +="   <option value=''> </option>";

 formText +="   <option value=\"It's a boy!!!\" >It's a boy!!!</option>";

 formText +="   <option value=\"It's a girl!!!\">It's a girl!!!</option>";
 formText +="   <option value=\"We have TWINS!\">We have TWINS!</option>";
 formText +="   <option value=\"We have THREE!\">We have THREE!</option>";
 formText +="   <option value=\"We're engaged!\">We're engaged!</option>";
 formText +="   <option value=\"Will you?\">Will you?</option>";
 formText +="   <option value=\"YES!\">YES!</option>";
 formText +="   <option value=\"We're getting' hitched!\">We're getting' hitched!</option>";
 formText +="   <option value=\"I love my dog!\">I love my dog!</option>";
 formText +="   <option value=\"I love my cat!\">I love my cat!</option>";
 formText +="   <option value=\"We've moved!\">We've moved!</option>";
 formText +="   <option value=\"I moved!\">I moved!</option>";
 formText +="   <option value=\"Happy Holidays!\">Happy Holidays!</option>";
 formText +="   <option value=\"Merry Christmas!\">Merry Christmas!</option>";
 formText +="   <option value=\"Happy Hanukka!\">Happy Hanukka!</option>";
 formText +="   <option value=\"Happy New Year!\">Happy New Year!</option>";

 formText +="   </select>";

 formText +="   <br><br><b>Or</b><br><br>";

 formText +="  <b>Write your own custom text:</b><input type='text' name='sbctext" + imgNum + "' id='sbctext" + imgNum + "' maxlength='20' size='35'><br />";

 formText +="  </td>";

 formText +=" </tr>";

 formText +=" </table>";

 
 formText +="<input type='hidden' id='t"+imgNum+"' name='t"+imgNum+"' value='speech'>";
 return formText;

}



function serializeForm(imgNum)

{

 var serializedText = "";

 var type = "";

 var objForm = document.getElementById("type" + imgNum);

   

 if(objForm)

 {

  type = objForm.value;

  

  serializedText = type;

  

  serializedText += "|" + document.getElementById("selectedImage" + imgNum).src;

   

  

  // Speech Bubbles form

  if(type == "jspeechbubble")

  { 

   // KEY: type|src|sbtext|sbctext

  

   serializedText += "|" + document.getElementById("sbtext" + imgNum).value;

   serializedText += "|" + document.getElementById("sbctext" + imgNum).value;

  }

  

  // Storymaker 0 form

  if(type == "jstorymaker0")

  { 

   // KEY: type|src|name

  

   serializedText += "|" + document.getElementById("name" + imgNum).value;

  }

  

  // Storymaker 1 form

  if(type == "jstorymaker1")

  { 

   // KEY: type|src|name|colora

  

   serializedText += "|" + document.getElementById("name" + imgNum).value;

   serializedText += "|" + document.getElementById("colora" + imgNum).value;

  }

  

  // Storymaker 3 form

  if(type == "jstorymaker3")

  { 

   // KEY: type|src|name|colora|colorb|colorc

  

   serializedText += "|" + document.getElementById("name" + imgNum).value;

   serializedText += "|" + document.getElementById("colora" + imgNum).value;

   serializedText += "|" + document.getElementById("colorb" + imgNum).value;

   serializedText += "|" + document.getElementById("colorc" + imgNum).value;

  }



  // Male form

  if(type == "jmale")

  { 

   // KEY: type|src|name|size|hair|skin|asian|acceyes|accmouth|accface|acchead|accneck|colora

   var objhair;
   
   objhair = document.getElementById("hair" + imgNum);

   serializedText += "|" + document.getElementById("name" + imgNum).value;

   serializedText += "|" + document.getElementById("size" + imgNum).value;
   
   if(objhair){
	   
	   serializedText += "|" + objhair.value;
	   
   }else{
	   
	   serializedText += "|" ;
	
   }

   serializedText += "|" + document.getElementById("skin" + imgNum).value;

   serializedText += "|" ;

   serializedText += "|" + document.getElementById("acceyes" + imgNum).value;

   serializedText += "|" + document.getElementById("accmouth" + imgNum).value;
   
   serializedText += "|" ;

   serializedText += "|" + document.getElementById("acchead" + imgNum).value;

   serializedText += "|" + document.getElementById("accneck" + imgNum).value;

   //serializedText += "|" + document.getElementById("color" + imgNum).value;
   serializedText += "|" ;
      
  }

  

  // Female or Baby form

  if(type == "jfemale" ||  type == "jbaby")

  { 

   // KEY: type|src|name|size|hair|skin|asian|acceyes|accmouth|acchead|accneck|colora

   var objhairb;
   
   objhairb = document.getElementById("hair" + imgNum);


   serializedText += "|" + document.getElementById("name" + imgNum).value;

   serializedText += "|" + document.getElementById("size" + imgNum).value;
   
   if(objhairb){
	   
	   serializedText += "|" + objhairb.value;
	   
   }else{
	   
	   serializedText += "|" ;
	
   }

   serializedText += "|" + document.getElementById("skin" + imgNum).value;

   serializedText += "|" ;

   serializedText += "|" + document.getElementById("acceyes" + imgNum).value;

   serializedText += "|" + document.getElementById("accmouth" + imgNum).value;

   serializedText += "|" + document.getElementById("acchead" + imgNum).value;

   serializedText += "|" + document.getElementById("accneck" + imgNum).value;

   //serializedText += "|" + document.getElementById("color" + imgNum).value;
   serializedText += "|" ;

  }

  

  // Pet form

  if(type == "jpet")

  { 

   // KEY: type|src|name|size|acceyes|acchead|accneck|colora|colorb|colorc



   serializedText += "|" + document.getElementById("name" + imgNum).value;

   serializedText += "|" + document.getElementById("size" + imgNum).value;

   serializedText += "|" + document.getElementById("acceyes" + imgNum).value;

   serializedText += "|" + document.getElementById("acchead" + imgNum).value;

   serializedText += "|" + document.getElementById("accneck" + imgNum).value;

   serializedText += "|" + document.getElementById("colora" + imgNum).value;

   serializedText += "|" + document.getElementById("colorb" + imgNum).value;

   serializedText += "|" + document.getElementById("colorc" + imgNum).value;

  }
/*alert(imgNum);
alert(document.getElementById("holt"));
alert(document.getElementById("hats0"));
alert(document.getElementById("hats1"));
alert(document.getElementById("hats2"));
*/
   if(document.getElementById("charh"+imgNum))serializedText += "|" + document.getElementById("charh"+imgNum).value; 

 }
   if((document.getElementById("holt")))serializedText += "|" + document.getElementById("holt").value; 
 

 // replace special characters
//alert(serializedText);
 serializedText = serializedText.replace(/"/g,"dqt;");

 serializedText = serializedText.replace(/'/g,"sqt;");

 

 return serializedText;

}



function deserializeForm(imgNum){
var serializedText = document.getElementById("formData" + imgNum).value;
// replace special characters
serializedText = serializedText.replace(/dqt;/g,"\"");
serializedText = serializedText.replace(/sqt;/g,"'");
var formArray = serializedText.split("|");
if(formArray.length > 0){// show the image with the appropriate form
fillImage(imgNum, formArray[1]);
// fill the image's form
var type = formArray[0];
// Speech Bubbles form
if(type == "jspeechbubble"){
// KEY: type|src|sbtext|sbctext
document.getElementById("sbtext" + imgNum).value = formArray[2];
document.getElementById("sbctext" + imgNum).value = formArray[3];}
// Storymaker 0 form
if(type == "jstorymaker0"){// KEY: type|src|name
document.getElementById("name" + imgNum).value = formArray[2];}
// Storymaker 1 form
if(type == "jstorymaker1"){
// KEY: type|src|name|colora
document.getElementById("name" + imgNum).value = formArray[2];
document.getElementById("colora" + imgNum).value = formArray[3];}
// Storymaker 3 form
if(type == "jstorymaker3"){
// KEY: type|src|name|colora|colorb|colorc
document.getElementById("name" + imgNum).value = formArray[2];
document.getElementById("colora" + imgNum).value = formArray[3];
document.getElementById("coloraSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[3] + "' border='0'>";
document.getElementById("colorb" + imgNum).value = formArray[4];
document.getElementById("colorbSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[4] + "' border='0'>";
document.getElementById("colorc" + imgNum).value = formArray[5];
document.getElementById("colorcSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[5] + "' border='0'>";
}
// Male form
if(type == "jmale"){
// KEY: type|src|name|size|hair|skin|asian|acceyes|accmouth|accface|acchead|accneck|colora
document.getElementById("name" + imgNum).value = formArray[2];

document.getElementById("size" + imgNum).value = formArray[3];
document.getElementById("headsizeSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[3] + "' border='0'>";

if(document.getElementById("hair" + imgNum)){
document.getElementById("hair" + imgNum).value = formArray[4];
document.getElementById("hairSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[4] + "' border='0'>";
}else{
	
}
document.getElementById("skin" + imgNum).value = formArray[5];
document.getElementById("skinSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[5] + "' border='0'>";

//document.getElementById("asian" + imgNum).checked = (formArray[6] == "Asian") ? true : false;
document.getElementById("acceyes" + imgNum).value = formArray[7];
document.getElementById("eyesSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[7] + "' border='0'>";

document.getElementById("accmouth" + imgNum).value = formArray[8];
document.getElementById("mouthSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[8] + "' border='0'>";
//document.getElementById("accface" + imgNum).value = formArray[9];

document.getElementById("acchead" + imgNum).value = formArray[10];
document.getElementById("headSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[10] + "' border='0'>";

document.getElementById("accneck" + imgNum).value = formArray[11];
document.getElementById("neckSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[11] + "' border='0'>";

/*
if(formArray[11]=="" || formArray[11]==null ){
document.getElementById("colorSelected" + imgNum).innerHTML = "<img src='cats_other/mice.gif' border=0>";
}else{
document.getElementById("colorSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[11] + "' border='0'>";
}
document.getElementById("color" + imgNum).value = formArray[11];
*/
//document.getElementById("color" + imgNum).value = formArray[11];
//document.getElementById("colorSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[11] + "'>";

//document.getElementById("accneck" + imgNum).value = formArray[11];
//document.getElementById("colora" + imgNum).value = formArray[12];
if(document.getElementById("charh" + imgNum))document.getElementById("charh" + imgNum).value=formArray[13];
}
// Female or Baby form
if(type == "jfemale" ||  type == "jbaby"){
// KEY: type|src|name|size|hair|skin|asian|acceyes|accmouth|acchead|accneck|colora
document.getElementById("name" + imgNum).value = formArray[2];
document.getElementById("headsizeSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[3] + "' border='0'>";
document.getElementById("size" + imgNum).value = formArray[3];

if(document.getElementById("hair" + imgNum)){
document.getElementById("hair" + imgNum).value = formArray[4];
document.getElementById("hairSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[4] + "' border='0'>";
}else{
	
}
//document.getElementById("hairSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[4] + "' border='0'>";
//document.getElementById("hair" + imgNum).value = formArray[4];

document.getElementById("skinSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[5] + "' border='0'>";
document.getElementById("skin" + imgNum).value = formArray[5];
//document.getElementById("asian" + imgNum).checked = (formArray[6] == "Asian") ? true : false;

document.getElementById("eyesSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[7] + "' border='0'>";
document.getElementById("acceyes" + imgNum).value = formArray[7];

document.getElementById("mouthSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[8] + "' border='0'>";
document.getElementById("accmouth" + imgNum).value = formArray[8];

document.getElementById("headSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[9] + "' border='0'>";
document.getElementById("acchead" + imgNum).value = formArray[9];

document.getElementById("neckSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[10] + "' border='0'>";
document.getElementById("accneck" + imgNum).value = formArray[10];

/*if(formArray[11]=="" || formArray[11]==null ){
document.getElementById("colorSelected" + imgNum).innerHTML = "<img src='cats_other/mice.gif' border=0>";
}else{
document.getElementById("colorSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[11] + "' border='0'>";
}
document.getElementById("color" + imgNum).value = formArray[11];
*/
if(document.getElementById("charh" + imgNum))document.getElementById("charh" + imgNum).value=formArray[12];
}
// Pet form
if(type == "jpet"){// KEY: type|src|name|size|acceyes|acchead|accneck|colora|colorb|colorc
document.getElementById("name" + imgNum).value = formArray[2];
document.getElementById("size" + imgNum).value = formArray[3];
document.getElementById("headsizeSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[3] + "' border='0'>";
document.getElementById("acceyes" + imgNum).value = formArray[4];
document.getElementById("eyesSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[4] + "' border='0'>";
document.getElementById("acchead" + imgNum).value = formArray[5];
document.getElementById("headSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[5] + "' border='0'>";
document.getElementById("accneck" + imgNum).value = formArray[6];
document.getElementById("neckSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[6] + "' border='0'>";
document.getElementById("colora" + imgNum).value = formArray[7];
document.getElementById("coloraSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[7] + "' border='0'>";
document.getElementById("colorb" + imgNum).value = formArray[8];
document.getElementById("colorbSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[8] + "' border='0'>";
document.getElementById("colorc" + imgNum).value = formArray[9];
document.getElementById("colorcSelected" + imgNum).innerHTML = "<img id='" + imgNum + "' src='" + formArray[9] + "' border='0'>";
if(document.getElementById("charh" + imgNum))document.getElementById("charh" + imgNum).value=formArray[10];
}}}

function copyData(data){
var formArray = data.split("~~");
var active = 0;
if(formArray.length > 0){
for(var x=1; x<=formArray.length; x++ ){
document.getElementById("formData" + x).value = formArray[x-1];
if(formArray[x-1] != "") active++;}}
selectImage(active);
for(var y=1; y<=active; y++ )

 {

  deserializeForm(y);

 }

}