// JavaScript Document

$(document).ready(function()
{
$('#preloader').hide();		
	$('#preloader')
		.ajaxStart(function(){
		$(this).show();
		}).ajaxStop(function(){
		$(this).hide();
	});
	
// Change State As per slected country	
$("#country").change(function()
{
var dataString = 'country='+ $(this).val();
$.ajax
({
type: "POST",
url: "getState.php",
data: dataString,
cache: false,
success: function(html)
{
$("#state").html(html);
} 
});

});

// change city as per selected state
$('#state').live("change",function(){									   
var dataString = 'state='+ $(this).val();
$.ajax
({
type: "POST",
url: "getCity2.php",
data: dataString,
cache: false,
success: function(html)
{
$("#city").html(html);
} 
});

});


// Check Crn Valid or Invalid
$('#crn').live("change",function(){									   
var dataString = 'crn='+ $(this).val();
$.ajax
({
type: "POST",
url: "checkCrn.php",
data: dataString,
cache: false,
success: function(html)
{
$("#checkcrn").html(html);
} 
});

});

//Change directory State as per selected Country  
$("#directoryCountry").change(function()
{
var dataString = 'country='+ $(this).val();
$.ajax
({
type: "POST",
url: "getDirectoryState.php",
data: dataString,
cache: false,
success: function(html)
{
$("#directroyState").html(html);
} 
});

});


//Change directory City as per selected State  
$('#directroyState').live("change",function(){									   
var dataString = 'state='+ $(this).val();
$.ajax
({
type: "POST",
url: "getCity.php",
data: dataString,
cache: false,
success: function(html)
{
$("#directoryCity").html(html);
} 
});

});

// Change (Non Coal) State as per Origin

$('#origin').live("change",function(){									   
var dataString = 'origin='+ $(this).val();
$.ajax
({
type: "POST",
url: "getNonCoalStateCity.php",
data: dataString,
cache: false,
success: function(html)
{
$("#noncoal_state").html(html);
} 
});

});

// Change (Non Coal) City as per State

$('#noncoal_state').live("change",function(){									   
var dataString = 'noncoal_state='+ $(this).val();
$.ajax
({
type: "POST",
url: "getNoncoalCity.php",
data: dataString,
cache: false,
success: function(html)
{
$("#noncoaldistrict").html(html);
} 
});

});


// Change (Non Coal) Port as per District

$('#noncoaldistrict').live("change",function(){									   
var dataString = 'noncoaldistrict='+ $(this).val();
$.ajax
({
type: "POST",
url: "getNoncoalPort.php",
data: dataString,
cache: false,
success: function(html)
{
$("#noncoal_port").html(html);
} 
});

});

// Change (Coal) Mines Name as per Area/Mines

$('#area_mines').live("change",function(){									   
var dataString = 'area_mines='+ $(this).val();
$.ajax
({
type: "POST",
url: "getMinesName.php",
data: dataString,
cache: false,
success: function(html)
{
$("#mines_name").html(html);
} 
});

});


// Change (Transporter) City as per State

$('#work_state').live("change",function(){									   
var dataString = 'work_state='+ $(this).val();
$.ajax
({
type: "POST",
url: "getWorkCity.php",
data: dataString,
cache: false,
success: function(html)
{
$("#work_district").html(html);
} 
});

});

// Change (liasoning) Sub Area as per Area/mines

$('#area').live("change",function(){									   
var dataString = 'area='+ $(this).val();
$.ajax
({
type: "POST",
url: "getSubArea.php",
data: dataString,
cache: false,
success: function(html)
{
$("#sub_area").html(html);
} 
});

});


// Change (Steave Dors) port as per country

$('#work_country').live("change",function(){									   
var dataString = 'work_country='+ $(this).val();
$.ajax
({
type: "POST",
url: "getPort.php",
data: dataString,
cache: false,
success: function(html)
{
$("#port").html(html);
} 
});

});

// pupup box 

$(".pupUpBox").fancybox({
				ajax : {
				    type	: "POST",
				    example	: 'myexample=test'
				}
});


});