var cardglobal;
var setcolor;

function selectredio(selectedID)
{
var Count = document.forms['VisitorForm'].imageCount.value;



 var i=1;
 var j=1;
 
 cardglobal=selectedID;
 if("selectedCard04"==selectedID)
 {
  theme(selectedID);
  /*document.getElementById(selectedID).style.backgroundImage ="url('../images/selected_like2designmycard_blue.gif')"*/
  while(j<=Count)
  {
  var cardselected="selectedCard0"+j;
  document.getElementById(cardselected).style.backgroundImage=""
  j++;
  }
  
 }
  
 else 
 {
 document.getElementById('selectedCard04').style.backgroundImage="url("+contextPath+'/images/ilike2designOwncard.gif'+")" 
 while(i<=Count)
 {
 var cardselected="selectedCard0"+i;
 if(cardselected==selectedID)
  changeCard(selectedID);
  /*document.getElementById(cardselected).style.backgroundImage="url('../images/selected_designCard_nopic_blue.gif')"*/
 
 else
 document.getElementById(cardselected).style.backgroundImage=""
 i++;
 }
 
}
}
 

function theme(designImage)
{

//setcolor=currentColor.substring(0,currentColor.indexOf('swatch'));
setcolor=currentColor
document.getElementById(designImage).style.backgroundImage ="url("+contextPath+'/images/selected_like2designmycard_'+setcolor+'.gif'+")";
document.getElementById('previewebpgBg_holder').style.backgroundImage ="url("+contextPath+'/images/faq_bg_'+setcolor+'.jpg'+")";
//document.getElementById(designImage).style.backgroundRepeat = "repeat";
document.getElementById('previewebpgBg_holder').style.backgroundRepeat = "repeat";
}

function changeCard(cardID)
{
//setcolor=currentColor.substring(0,currentColor.indexOf('swatch'));
setcolor=currentColor
if(document.getElementById(cardID)){
		document.getElementById(cardID).style.backgroundImage ="url("+contextPath+'/images/selectedcardBorder_'+setcolor+'.gif'+")";
	}
document.getElementById('previewebpgBg_holder').style.backgroundImage ="url("+contextPath+'/images/faq_bg_'+setcolor+'.jpg'+")";
 
}

