

function toggle_disabled()
{
	
	
	
	if( document.getElementById('DELIVERY_METHOD_SELF').checked == true )	
	{
		document.getElementById('STORE').disabled = false;
	}
	else
	{
		document.getElementById('STORE').disabled = true;	
	}
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function swapImage(images, id, id1, type, current, linkId, colors, rlink)
{
	var images = images;
	var colors = colors;
	var currentIndex = 0;
	var newIndex = 0;
	var maxIndex = images.length-1;
	
	//alert(images);
	
	//alert(document.getElementById(id1).value);
	
	for(i=0;i<images.length;i++)
	{
		if( images[i] == document.getElementById(id1).value )
		{
			currentIndex = i;
		}
	}

	
	if( type == 'prev' )
	{
		if( currentIndex - 1 < 0 )
		{
			newIndex = maxIndex;
		}
		else
		{
			newIndex = currentIndex - 1;
		}
	}
	
	if( type == 'next' )
	{
		if( currentIndex + 1 > maxIndex )
		{
			newIndex = 0;
		}
		else
		{
			newIndex = currentIndex + 1;
		}
	}
	
	document.getElementById(id).style.backgroundImage="url(files/p4/"+ images[newIndex] +")" ;
	document.getElementById(id1).value = images[newIndex];
	document.getElementById(linkId).href = document.getElementById(rlink).value + '&color=' + colors[newIndex];
	
	//alert(document.getElementById(rlink).value);
	
	return false;
	
}
