DC Motor and Potentiometer positioning

Still no code

here is the code

void Motor()
{
	val1=analogRead(Poti1);
	val2=analogRead(Poti2);
	targetval1=(val1<(val1-10)||val1>(val1+10));
	if ((val1>val2)&&(val1>minval))
	{
		Motor_1_3();
	}
	if ((val1<val2)&&(val1<maxval))
	{
		Motor_2_4();
	}
	if ((targetval1=val2)||(val1=minval)||(val1=maxval))
	{
		Motor_OFF();
	}
}

The below might need some attention, depending on just what you are trying to accomplish.

if ((targetval1=val2)||(val1=minval)||(val1=maxval))

my minval is 10 and my maxval 1000 thats because i don't want damage the potentiometer so im using this as a stop point
it seems to me as hes in loop with this part

             if ((val1>val2)&&(val1>minval))
	{
		Motor_1_3();
	}
	if ((val1<val2)&&(val1<maxval))
	{
		Motor_2_4();
	}

Something that may/may not make a difference depending on what you are trying to do.

http://arduino.cc/en/Reference/If