function deleterecord(location,dialog){
		jConfirm('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>You must be login as buyer to add a car to your  favorite car  ?</span>', 'Alert Box !', function(r) {
			if(r == true){
				window.location = location;
				//alert(location);
			}
		});
	}

function confirmDialog(location,dialog){
		jConfirm('<div style=\'text-align:center;\'><span>'+dialog+'</span></div>', 'Alert Box !', function(r) {
			if(r == true){
				window.location = location;
				//alert(location);
			}
		});
	}




	
function confirmdelete(location){
		jConfirm('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Are you sure to delete this ?', 'Confirmation  Box !', function(r) {
			if(r == true){
				window.location = location;
				//alert(location);
			}
		});
	}


	
function addToFav(modelid,span){
	
	if(modelid){
			$.ajax({
	   type: "POST",
	   url: "add_fav.php",
	   data: "model_id="+modelid,
	  success: function(html){
					if(html){
				if(html==2)
				document.getElementById("span_"+modelid).innerHTML = "Already added !";
				else 
				document.getElementById("span_"+modelid).innerHTML = "<font style='color:#0000ff;'>Favorite added !</font>";
				
				
					} 
				
				}
	
	 });
} 
	
	
}


// Centered Pop-Up Window (v1.0)
// (C) 2002 www.smileycat.com
// Free for all users, but leave in this header

var win = null;
function newWindow(mypage,myname,w,h,features) {
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}
