function sendemail() { 
    var ev = document.getElementById( "Cemail" ).value;
	//var ev=document.detail_form.Cemail.value; 
	if (ev.indexOf('@')<1||ev.lastIndexOf('.')-2 < ev.indexOf('@')) { 
		alert("You must input a valid email address!"); 
		return; 
	} 
	//document.forms["detail_form"].submit();
    else {
         document.getElementById("dform").submit();
    }
} 
function SelectImg(id) {
	if (morph==true) { 
		document.images.theImage.style.filter="blendTrans(duration=  1)"; 
		document.images.theImage.filters.blendTrans(duration= 1).Apply();
		document.images.theImage.filters.blendTrans.Play();
	}
	//document.theImage.src=imagesPreloaded[id].src;
	document.theImage.src = MyImages[id];
	var slidestatus= slide;stopslide();
	if(slidestatus==true) setTimeout("continueslide()",15000);
	currentIndx=id;
}
function continueslide() {
	slide=true; 
	var subMenu =document.getElementById("stop_continue");
	subMenu.innerHTML="<img src=\"http://dls.diamondlot.com/inventory/images/pause.gif\" vspace=0 hspace=0 onClick=\"stopslide();\">"; 
} 
function stopslide() { 
	slide=false;
	var subMenu = document.getElementById("stop_continue");
	subMenu.innerHTML="<img src=\"http://dls.diamondlot.com/inventory/images/play.gif\" vspace=0 hspace=0 onClick=\"continueslide();\">"; 	
}

function automaticly() {
//alert("slide="+slide);
	if (slide==true) { 
		currentIndx=currentIndx+1;
		//if (currentIndx>=imagesPreloaded.length)
		if (currentIndx >= MyImages.length) 
			currentIndx=0; 
		if (morph==true) { 
			document.images.theImage.style.filter="blendTrans(duration=\"morphtime\")"; 
			document.images.theImage.filters.blendTrans(duration="morphtime").Apply(); 
			document.images.theImage.filters.blendTrans.Play(); 
		}
		//document.theImage.src=imagesPreloaded[currentIndx].src;
		document.theImage.src = MyImages[currentIndx];
	} 
	setTimeout("automaticly()",5000); 
}
function bigpic(pids) { 
	if (agt.indexOf("msie 5")>0 || agt.indexOf("msie 6")>0) 
		window.open("../VehicleDetailSlideshow.aspx?cind="+currentIndx+"&picture_ids="+pids,"VehicleDetailSlideshow",'width=750,height=760,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes'); 
	else 
		window.open("../VehicleDetailSlideshow.aspx?cind="+currentIndx+"&picture_ids="+pids,"VehicleDetailSlideshow",'width=700,height=600,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes'); 
} 

function bigpicurl(vehicle_id) { 
	if (agt.indexOf("msie 5")>0 || agt.indexOf("msie 6")>0) 
		window.open("../VehicleDetailSlideshow.aspx?cind="+currentIndx+"&vehicle_id="+vehicle_id,"VehicleDetailSlideshow",'width=750,height=760,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes'); 
	else 
		window.open("../VehicleDetailSlideshow.aspx?cind="+currentIndx+"&vehicle_id="+vehicle_id,"VehicleDetailSlideshow",'width=700,height=600,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes'); 
} 

function bigpicurl1024(vehicle_id) { 
	if (agt.indexOf("msie 5")>0 || agt.indexOf("msie 6")>0) 
		window.open("../VehicleDetailSlideshow.aspx?cind="+currentIndx+"&vehicle_id="+vehicle_id+"&lw=1024&lh=768","VehicleDetailSlideshow",'width=1150,height=960,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes'); 
	else 
		window.open("../VehicleDetailSlideshow.aspx?cind="+currentIndx+"&vehicle_id="+vehicle_id+"&lw=1024&lh=768","VehicleDetailSlideshow",'width=1100,height=900,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes'); 
} 

var initPrice; 
function open_calculator(init_price) { 
	init_price=init_price.replace(",","");
	init_price=init_price.replace("$","");
	initPrice = init_price;
	window.open("../VehicleDetailCalculator.htm","calculator",'width=550,height=230,resizable=yes'); 
}
		var currentIndx=0, slide=true, morph; 
		var morphtime=1; 
		var agt=navigator.userAgent.toLowerCase(); 
		if (agt.indexOf("msie 5")>0||agt.indexOf("msie 6")>0)
			morph = true;
		else morph=false; 
