function makeRequest4(url,obj)
	{
		var obj2 = "#" + obj; 
		$.ajax({
		  url: url,
		  cache: false,
		  success: function(html){ 
			$(obj2).html(html);
		  }
		});
	
	}
	

		
//-----------------------------------------------------------------------------
				// country, state city functions
//-------------------------------------------------------------------------------

function getCountry(countryId)
 {
	 
	 if(countryId!='')
		{   
			var myRandom = parseInt(Math.random()*99999999);
			url =  RU+"ajax_php/ajax.php?countryId="+encodeURI(countryId)+"&rand="+myRandom;
			makeRequest4(url,'statediv');
		}
	 
 }
	
function getState(state)
 {
	 if(state!='')
		{   
			var myRandom = parseInt(Math.random()*99999999);
			url = RU+"ajax_php/ajax.php?state="+encodeURI(state)+"&rand="+myRandom;
			makeRequest4(url,'citydiv');
		}
	 
 }


//-----------------------------------------------------------------------------
				// country, state city functions
//-------------------------------------------------------------------------------

function getCountry2(countryId)
 {
	 
	 if(countryId!='')
		{   
			var myRandom = parseInt(Math.random()*99999999);
			url =  RU+"ajax_php/ajax.php?country_prof="+encodeURI(countryId)+"&rand="+myRandom;
			
			
			makeRequest4(url,'statediv');
		}
	 
 }
	
function getState2(state)
 {
	 if(state!='')
		{   
			var myRandom = parseInt(Math.random()*99999999);
			url = RU+"ajax_php/ajax.php?state_prof="+encodeURI(state)+"&rand="+myRandom;
			makeRequest4(url,'citydiv');
		}
	 
 }

// -------------------------------- -
          // del cart items 
//-----------------------------------

function delTempProduct(prodId ,popup)
{
	var con = confirm('Are you sure, you want to delete this item!');
 	if(prodId!='')
		{   
		  if(con)
		   {
			var myRandom = parseInt(Math.random()*99999999);
			url = RU+"ajax_php/ajax_temp_product.php?del_prod_id="+encodeURI(prodId)+"&popup="+popup+"&rand="+myRandom;
			makeRequest4(url,'div_temp_prod');
			countItems();
		   }
		}
}

// -------------------------------- -
          // close light box
//-----------------------------------
function closeLightBox()
{
	SexyLightbox.close();	
}


// -------------------------------- -
          // count cart items 
//-----------------------------------
function countItems()
{
		var myRandom = parseInt(Math.random()*99999999);
		url = RU+"ajax_php/ajax.php?total=yes&rand="+myRandom;
		makeRequest4(url,'total');
}

// -------------------------------- -
          // clear search text 
//-----------------------------------
function clearText(val)
{
	if(val=='Keyword, Title, Author, IDBMS')
	{
	  $('#searchtxt').val('');
	}

}


