function flip(x, y)
{
	x.src = 'images_ar/' + y + '1.png';
}

function flipback(x, y)
{
	x.src = 'images_ar/' + y + '.png';
}

function size(x)
{
	formvote.size.value = x;
}

function color(x)
{
	//here you can load the picture with the chosen color as the name of the color should match the filename.
}

function swap(x)
{
	var y = x.src;
	var g = 1;
	var z = 1;

	if((x == fourth) && (fifth.src.substring(fifth.src.length, (fifth.src.length - 8)) == '5_17.gif'))
	{
		g = 0;
	}
	
	if((x == third) && (fourth.src.substring(fourth.src.length, (fourth.src.length - 8)) == '5_17.gif'))
	{
		g = 0;
	}

	if((x == second) && (third.src.substring(third.src.length, (third.src.length - 8)) == '5_17.gif'))
	{
		g = 0;
	}

	if((x == first) && (second.src.substring(second.src.length, (second.src.length - 8)) == '5_17.gif'))
	{
		g = 0;
	}

///////////////////////

	if((x == fifth) && (fourth.src.substring(fourth.src.length, (fourth.src.length - 8)) == '5_19.gif'))
	{
		z = 0;
	}
	
	if((x == fourth) && (third.src.substring(third.src.length, (third.src.length - 8)) == '5_19.gif'))
	{
		z = 0;
	}

	if((x == third) && (second.src.substring(second.src.length, (second.src.length - 8)) == '5_19.gif'))
	{
		z = 0;
	}

	if((x == second) && (first.src.substring(first.src.length, (first.src.length - 8)) == '5_19.gif'))
	{
		z = 0;
	}

	if ((y.substring(y.length, (y.length - 8)) == '5_17.gif') && (g == 1))
	{
		x.src = 'images_ar/5_19.gif';
		formvote.stars.value++;
	}
	else if ((z == 1) && (y.substring(y.length, (y.length - 8)) == '5_19.gif'))
	{
		x.src = 'images_ar/5_17.gif';
 		formvote.stars.value--;
	}
}
/*
function swap1(x)
{
	var y = x.src;
 
    if (y.substring(y.length, (y.length - 8)) == '1_30.gif')
	{
		x.style.background-image = 'url(images/1_29.gif)';
	}
	else
	{
		x.style.background-image = 'url(images/1_30.gif)';
	}
}*/


function doSearch(){

	
var strSeach=document.getElementById("searchkey");

	if(strSeach.value !="" ){
				str="default.cfm?view=prodlist&searchkey="+strSeach.value;
		}
		window.open(str,"_self");
}


function changeAmount(linkto){
	
	var selectItems=document.getElementById("selectItemsAm");
	var selIndex = selectItems.selectedIndex;
	
	window.open(linkto+"&viewcant="+selectItems.options[selIndex].value,"_self");
}

function getCart(linktc){

		var quantity=1;
		var sqty="";
		
		try{
			sqty=document.getElementById('selectqty');
			quantity=sqty.options[sqty.options.selectedIndex].value ;
		}
		catch(err)
		{
			quantity=1;
		}
	
	window.open(linktc+"&quantity="+quantity,"_self");
	
}