// JavaScript Document
function removeComp(val){
	if(val==1){
		window.location = "compare.php?rem=1";
		}
		if(val==2){
	 window.location = "compare.php?rem=2";
		}
		if(val==3){
   window.location = "compare.php?rem=3";
		}
		if(val==4){
     window.location = "compare.php?rem=4";
		}
	
	}
	function compareItems(val){
	var val1=document.getElementById('comp1').value;
	var val2=document.getElementById('comp2').value;
	var val3=document.getElementById('comp3').value;
	var val4=document.getElementById('comp4').value;
	if(val1=="0"&& val2=="0" && val3=="0"&& val4=="0")
	{
		alert("There is no Item in the Cart");
		return false;
		
		}
	else if(val2=="0" && val3=="0"&& val4=="0")
		{
			alert("Minimum 2 models to Compare");
			return false;
		}
	else
		{
			
			window.location = "compareall.php?id1="+val1+"&id2="+val2+"&id3="+val3+"&id4="+val4;
			
			return false;
		}
	
	}
	
function validate(val){
	
	returnValue = false;
	var val1=document.getElementById('comp1').value;
	var val2=document.getElementById('comp2').value;
	var val3=document.getElementById('comp3').value;
	var val4=document.getElementById('comp4').value;
	if(val1==val){
			alert("Mobile already into Compare");
		returnValue = false;
		}
		else if(val2==val){
				alert("Mobile already into Compare");
		returnValue = false;
		}
		else if(val3==val){
			alert("Mobile already into Compare");
		returnValue = false;
		}
		else if(val4==val){
		alert("Mobile already into Compare");
		returnValue = false;
		}
		else if(val4!=0){
			alert("Only 4 Items can be compared");
			returnValue = false;
			}
		else{
			
			returnValue = true;
	
			}
		
	

return returnValue;
	
	}
	
	
	
	//remove all values
	
	function clearAll(val){
		//alert("inside removeall");
		 window.location = "compare.php?rem=5";
		return false;
		}
