function removeItem(idnum){
	for (d=1; d < 11; d++){
		if (eval('visitordata.stvalue' + (d) + ' == ' + idnum)){			
			eval('visitordata.stvalue' + (d) + ' = ""')			
			visitordata.store();			
			break;
		}
	}
clipstart()
}
function removeall(){
	for (d=1; d < 11; d++){
		eval('visitordata.stvalue' + (d) + ' = ""')			
		visitordata.store();
		
	}
clipstart()	
}

var visitordata = new Cookie(document, "name_color_count_state", 240);

if (!visitordata.load() || !visitordata.name || !visitordata.color) {
    visitordata.name = "empty"
    visitordata.color = "1"
	visitordata.stvalue1 = ""
	visitordata.stvalue2 = ""
	visitordata.stvalue3 = ""
	visitordata.stvalue4 = ""
	visitordata.stvalue5 = ""
	visitordata.stvalue6 = ""
	visitordata.stvalue7 = ""
	visitordata.stvalue8 = ""
	visitordata.stvalue9 = ""
	visitordata.stvalue10 = ""
}

if (visitordata.visits == null) visitordata.visits = 0;
visitordata.visits++;

visitordata.store();

if (visitordata.name == "empty"){
visitordata.name = "/clipboard.php?"
}

storedValue = new Array("test","","","","","","","","","","");

stored = new Array();

var cows

function createPassValue(){
var cow = "/clipboard.php?"
var o = 1
	for (n=1; n < 11; n++){
		if (eval('visitordata.stvalue' + (n)) == ""){
		}
		else{
			stored[o] = eval('visitordata.stvalue' + (n))
			o++	
		}
	}

	for (s=1; s < o; s++){
		if (cow == "/clipboard.php?"){
			cow = cow + "alldetails" + s + "=" + stored[s]
		}
		else{
			cow = cow + "&alldetails" + s + "=" + stored[s]
			}
	}
cows = cow
}

function clipboard(idvalue){

visitordata.load()
	for (e=1; e < 12; e++){
		/*
		if this function has looped 10 times and there are no blank spaces
		then alert the user their 10 id number storage limit has been reached
		and break the loop
		*/
		if (e == 11){
			alert("limit")
			break
		}
		/*
		if this value is = to the id number, alert user its in the clipboard already
		else move to the next if
		*/
		if (eval('visitordata.stvalue' + (e) + ' == ' + idvalue)){
		alert("This car is already in your clipboard")
			break
		} 
		/*
		if this value is = to blank, then add the value to the clipboard
		else loop through the next number
		*/
		if (eval('visitordata.stvalue' + (e) + ' == ""')){
			storedValue[e] = idvalue
			alert("Successfully stored in your Clipboard \n\nClick on the 'My Clipboard' button at the top \nright of the screen to view your Clipboard items.")
			eval('visitordata.stvalue' + (e) + ' = ' + storedValue[e]);			
			visitordata.store();
			break
		}
	}
}

function cliprestart(){	
	setTimeout("clipstart()",100);
}

function clipstart(){
createPassValue()
	location.href = cows
}
