/**
 * @author Admin
 */

var coords = JSON.parse( '[ {"ycord":-5, "text": "<ul><li>We will appretiate your efforts to contribute. We will try to do our best to improve the product.</li></ul>"} , {"ycord":72, "text": "<ul><li>We will appretiate your efforts to contribute. We will try to do our best to improve the product.</li></ul>"} , {"ycord":150, "text": "<ul><li>We will appretiate your efforts to contribute. We will try to do our best to improve the product.</li></ul>"} , {"ycord":229, "text": "<ul><li>We will appretiate your efforts to contribute. We will try to do our best to improve the product.</li></ul>"} , {"ycord":306, "text": "<ul><li>We will appretiate your efforts to contribute. We will try to do our best to improve the product.</li></ul>"} , ]' );
var curSelectPrice = 2;

function SetPrice(num, newPrice)
{
	if ( num == curSelectPrice ) return true;
	$('#selectPrice').val( $('#price'+num+' .price').html() );
	
	$('#selectBG').css('top', coords[num].ycord );
	$('#selectScroll').css('top', coords[num].ycord );
	
	
	
	if (num == 0) {
		$('#greyArrowBody').css('display', 'none');
		$('#selectScroll').css('background-image', 'url("/i/buyit/scroll_first.jpg")' );
	}
	else
	{
		( num == 4 ) ?
			$('#selectScroll').css('background-image', 'url("/i/buyit/scroll_last.jpg")' ):
			$('#selectScroll').css('background-image', 'url("/i/buyit/scroll.jpg")' );
		
		$('#greyArrowBody').css('height', coords[num].ycord + 5);
		$('#greyArrowBody').css('display', 'block');
	}
	
	$('#selectItem').html($('#price'+num+' .header').html() );
	
	$('#greyArrowEnd').css('top', coords[num].ycord + 12 );
	
	$('#price'+num+' .mdash').css('display', 'none');
	$('#price'+curSelectPrice+' .mdash').css('display', 'block');
	
	$('#price'+num+' .price').addClass('selectPrice');
	$('#price'+curSelectPrice+' .price').removeClass('selectPrice');
	
	$('#leftDescBlockText').html(coords[num].text);
	
	$('#amount').val(newPrice);
	
	curSelectPrice = num;
}
