var inputname = '';
var imgobjec = '';
var imgsrc = '';
function modifyCSS(object,object1,clas)
{
  obj = $(object);
  obj1 = $(object1);
  obj2 = $('on'+object1);

  if(inputname != '')
  {
	if(inputname == object)
	{
		if(obj.className == 'varient_solid' || obj.className == 'varient_selected')
		{
			if(obj.className == 'varient_solid')	obj.className = 'varient_selected';
			else obj.className = 'varient_solid';
			obj1.style.display = 'none';
			obj2.style.display = '';
		}
		else
		{
			if(obj.className == 'varient_solid_one')	obj.className = 'varient_selected_one';
			else obj.className = 'varient_solid_one';
			obj1.style.display = '';
			obj2.style.display = 'none';
		}
	}
	else
	{
		//set click select style;
		if(clas == 'varient_solid')	obj.className = 'varient_selected';
		else obj.className = 'varient_selected_one';

		//get old object
		_obj = $(inputname);
		if(_obj.className == 'varient_selected')	_obj.className = 'varient_solid';
		else _obj.className = 'varient_solid_one';
		_obj1 = $(imgobjec);
		_obj1.style.display = '';
		_obj2 = $('on'+imgobjec);
		_obj2.style.display = 'none';
		obj1.style.display = 'none';
		obj2.style.display = '';
	}
  }
  else
  {
	if(clas == 'varient_solid')	obj.className = 'varient_selected';
	else obj.className = 'varient_selected_one';
	imgsrc = obj1.src;
	obj1.style.display = 'none';
	obj2.style.display = '';
  }

  inputname = object;
  imgobjec = object1;

}


function autoinput(object)
{
	obj = $('Delivery'+object);
	obj1 = $('Billing'+object);
	//alert(obj.value);
	obj1.value = obj.value;
}

function autoUpdatePrice(objname,productID)
{
	quantity = $('quantity'+objname).value;
    if(quantity.search("^-?\\d+$")!=0){
        alert("please input number!");
        return false;
    }
	var myAjax = new Ajax.Updater(
                'checkoutbaset',
                '/store/ajaxCheckout/quantity/' + quantity + '/id/' + productID,
                {
                    method: 'get'
                }
    );
}



function autoCarUpdatePrice(objname,productID)
{

	quantity = objname.value;
    if(quantity.search("^-?\\d+$")!=0){
        alert("please input number!");
        return false;
    }
	var myAjax = new Ajax.Updater(
                'overlayBasket',
                '/store/ajaxUpdata/quantity/' + quantity + '/id/' + productID,
                {
                    method: 'get'
                }
    );

}
