jQuery(function($) {

	$(".export1").each(function() {
		$(this).change(function() {
			if ($(this).val() == 'africa' ||
				$(this).val() == 'AO' ||
				$(this).val() == 'BJ' ||
				$(this).val() == 'CM' ||
				$(this).val() == 'GH' ||
				$(this).val() == 'GN' ||
				$(this).val() == 'KE' ||
				$(this).val() == 'MG' ||
				$(this).val() == 'MV' ||
				$(this).val() == 'MU' ||
				$(this).val() == 'MA' ||
				$(this).val() == 'MZ' ||
				$(this).val() == 'NG' ||
				$(this).val() == 'RE' ||
				$(this).val() == 'SN' ||
				$(this).val() == 'SC' ||
				$(this).val() == 'ZA' ||
				$(this).val() == 'TZ' ||
				$(this).val() == 'TG' ||
				$(this).val() == 'UG') {
					 // window.open('/forcedownload/Africa.pdf/hkocs/export_hk_schedule','_self');
					//$('select').each(function() {
					//						  $(this+' option:nth(0)').attr("selected","selected");
					//						  });
				window.open('/forcedownload/Africa.xls/hkocs/export_hk_schedule','_self');
				$('select option:nth(0)').attr("selected","selected");
				return false;
			}
			
			if ($(this).val() == 'australia' ||
				$(this).val() == 'AU' ||
				$(this).val() == 'NZ') {
					window.open('/forcedownload/Australia.xls/hkocs/export_hk_schedule','_self');
					$('select option:nth(0)').attr("selected","selected");
				return false;
			}
			
			if ($(this).val() == 'india' ||
				$(this).val() == 'BD' ||
                                   	$(this).val() == 'SA' ||
				$(this).val() == 'LK' ||
                                     $(this).val() == 'IN' ||
                                     $(this).val() == 'PK' ||
				$(this).val() == 'AE') {
					window.open('/forcedownload/Middle_East.xls/hkocs/export_hk_schedule','_self');
					$('select option:nth(0)').attr("selected","selected");
					return false;
			}
			
			if ($(this).val() == 'europe' ||
				$(this).val() == 'AT' ||
				$(this).val() == 'BE' ||
				$(this).val() == 'DK' ||
				$(this).val() == 'EG' ||
				$(this).val() == 'FI' ||
				$(this).val() == 'FR' ||
				$(this).val() == 'DE' ||
				$(this).val() == 'GR' ||
				$(this).val() == 'HU' ||
				$(this).val() == 'IE' ||
				$(this).val() == 'IT' ||
				$(this).val() == 'LT' ||
				$(this).val() == 'MT' ||
				$(this).val() == 'NL' ||
				$(this).val() == 'NO' ||
				$(this).val() == 'PL' ||
				$(this).val() == 'PT' ||
				$(this).val() == 'RO' ||
				$(this).val() == 'RU' ||
				$(this).val() == 'SK' ||
				$(this).val() == 'ES' ||
				$(this).val() == 'SE' ||
				$(this).val() == 'CH' ||
				$(this).val() == 'TR' ||
				$(this).val() == 'UA' ||
				$(this).val() == 'GB') {
					window.open('/forcedownload/Europe.xls/hkocs/export_hk_schedule','_self');
					$('select option:nth(0)').attr("selected","selected");
					return false;
			}
			
			if ($(this).val() == 'asia' ||
				$(this).val() == 'BN' ||
				$(this).val() == 'KH' ||
				$(this).val() == 'ID' ||
				$(this).val() == 'KP' ||
				$(this).val() == 'KR' ||
				$(this).val() == 'MY' ||
				$(this).val() == 'MM' ||
				$(this).val() == 'PH' ||
				$(this).val() == 'SG' ||
				$(this).val() == 'TH') {
					window.open('/forcedownload/Intra-Asia.xls/hkocs/export_hk_schedule','_self');
					$('select option:nth(0)').attr("selected","selected");
					return false;
			}
			
			if ($(this).val() == 'japan' ||
				$(this).val() == 'JP') {
					window.open('/forcedownload/Japan.xls/hkocs/export_hk_schedule','_self');
					$('select option:nth(0)').attr("selected","selected");
					return false;
			}
			
			if ($(this).val() == 'latin' ||
				$(this).val() == 'AR' ||
				$(this).val() == 'BO' ||
				$(this).val() == 'BR' ||
				$(this).val() == 'CL' ||
				$(this).val() == 'CO' ||
				$(this).val() == 'CR' ||
				$(this).val() == 'CO' ||
				$(this).val() == 'EC' ||
				$(this).val() == 'SV' ||
				$(this).val() == 'GT' ||
				$(this).val() == 'JM' ||
				$(this).val() == 'MX' ||
				$(this).val() == 'PA' ||
				$(this).val() == 'PY' ||
				$(this).val() == 'PE' ||
				$(this).val() == 'PR' ||
				$(this).val() == 'UY' ||
				$(this).val() == 'VE') {
					window.open('/forcedownload/Latin_America.xls/hkocs/export_hk_schedule','_self');
					$('select option:nth(0)').attr("selected","selected");
					return false;
			}
			
			if ($(this).val() == 'northamerica' ||
				$(this).val() == 'CA' ||
				$(this).val() == 'US') {
					window.open('/forcedownload/North_America.xls/hkocs/export_hk_schedule','_self');
					$('select option:nth(0)').attr("selected","selected");
					return false;
			}
			
			if ($(this).val() == 'vietnam' ||
				$(this).val() == 'VN') {
					window.open('/forcedownload/Vietnam.xls/hkocs/export_hk_schedule','_self');
					$('select option:nth(0)').attr("selected","selected");
					return false;
			}
		})
	});
	
	
	$(".export2").each(function() {
		$(this).change(function() {
			if ($(this).val() == 'africa' ||
				$(this).val() == 'AO' ||
				$(this).val() == 'BJ' ||
				$(this).val() == 'CM' ||
				$(this).val() == 'GH' ||
				$(this).val() == 'GN' ||
				$(this).val() == 'KE' ||
				$(this).val() == 'MG' ||
				$(this).val() == 'MV' ||
				$(this).val() == 'MU' ||
				$(this).val() == 'MA' ||
				$(this).val() == 'MZ' ||
				$(this).val() == 'NG' ||
				$(this).val() == 'RE' ||
				$(this).val() == 'SN' ||
				$(this).val() == 'SC' ||
				$(this).val() == 'ZA' ||
				$(this).val() == 'TZ' ||
				$(this).val() == 'TG' ||
				$(this).val() == 'UG') {
					window.open('/forcedownload/Africa.pdf/hkocs/export_xiamen_schedule','_self');
					$('select option:nth(0)').attr("selected","selected");
			}
			
			if ($(this).val() == 'australia' ||
				$(this).val() == 'AU' ||
				$(this).val() == 'NZ') {
				window.open('/forcedownload/Australia.pdf/hkocs/export_xiamen_schedule','_self');
				$('select option:nth(0)').attr("selected","selected");
			}
			
			if ($(this).val() == 'india' ||
				$(this).val() == 'BD' ||
				$(this).val() == 'SA' ||
				$(this).val() == 'LK' ||
                                     $(this).val() == 'IN' ||
                                     $(this).val() == 'PK' ||
				$(this).val() == 'AE') {
				window.open('/forcedownload/India.pdf/hkocs/export_xiamen_schedule','_self');
				$('select option:nth(0)').attr("selected","selected");
			}
			
			if ($(this).val() == 'europe' ||
				$(this).val() == 'AT' ||
				$(this).val() == 'BE' ||
				$(this).val() == 'DK' ||
				$(this).val() == 'EG' ||
				$(this).val() == 'FI' ||
				$(this).val() == 'FR' ||
				$(this).val() == 'DE' ||
				$(this).val() == 'GR' ||
				$(this).val() == 'HU' ||
				$(this).val() == 'IE' ||
				$(this).val() == 'IT' ||
				$(this).val() == 'LT' ||
				$(this).val() == 'MT' ||
				$(this).val() == 'NL' ||
				$(this).val() == 'NO' ||
				$(this).val() == 'PL' ||
				$(this).val() == 'PT' ||
				$(this).val() == 'RO' ||
				$(this).val() == 'RU' ||
				$(this).val() == 'SK' ||
				$(this).val() == 'ES' ||
				$(this).val() == 'SE' ||
				$(this).val() == 'CH' ||
				$(this).val() == 'TR' ||
				$(this).val() == 'UA' ||
				$(this).val() == 'GB') {
				window.open('/forcedownload/Europe.pdf/hkocs/export_xiamen_schedule','_self');
				$('select option:nth(0)').attr("selected","selected");
			}
			
			if ($(this).val() == 'asia' ||
				$(this).val() == 'BN' ||
				$(this).val() == 'KH' ||
				$(this).val() == 'ID' ||
				$(this).val() == 'KP' ||
				$(this).val() == 'KR' ||
				$(this).val() == 'MY' ||
				$(this).val() == 'MM' ||
				$(this).val() == 'PH' ||
				$(this).val() == 'SG' ||
				$(this).val() == 'TH') {
				window.open('/forcedownload/Intra-Asia.pdf/hkocs/export_xiamen_schedule','_self');
				$('select option:nth(0)').attr("selected","selected");
			}
			
			if ($(this).val() == 'japan' ||
				$(this).val() == 'JP') {
				window.open('/forcedownload/Japan.pdf/hkocs/export_xiamen_schedule','_self');
				$('select option:nth(0)').attr("selected","selected");
			}
			
			if ($(this).val() == 'latin' ||
				$(this).val() == 'AR' ||
				$(this).val() == 'BO' ||
				$(this).val() == 'BR' ||
				$(this).val() == 'CL' ||
				$(this).val() == 'CO' ||
				$(this).val() == 'CR' ||
				$(this).val() == 'CO' ||
				$(this).val() == 'EC' ||
				$(this).val() == 'SV' ||
				$(this).val() == 'GT' ||
				$(this).val() == 'JM' ||
				$(this).val() == 'MX' ||
				$(this).val() == 'PA' ||
				$(this).val() == 'PY' ||
				$(this).val() == 'PE' ||
				$(this).val() == 'PR' ||
				$(this).val() == 'UY' ||
				$(this).val() == 'VE') {
				window.open('/forcedownload/Latin_America.pdf/hkocs/export_xiamen_schedule','_self');
				$('select option:nth(0)').attr("selected","selected");
			}
			
			if ($(this).val() == 'northamerica' ||
				$(this).val() == 'CA' ||
				$(this).val() == 'US') {
				window.open('/forcedownload/North_America.pdf/hkocs/export_xiamen_schedule','_self');
				$('select option:nth(0)').attr("selected","selected");
			}
			
			if ($(this).val() == 'vietnam' ||
				$(this).val() == 'VN') {
				window.open('/forcedownload/Vietnam.pdf/hkocs/export_xiamen_schedule','_self');
				$('select option:nth(0)').attr("selected","selected");
			}
		})
	});
	
	
	$(".import1").each(function() {
		$(this).change(function() {
			if ($(this).val() == 'africa' ||
				$(this).val() == 'AO' ||
				$(this).val() == 'BJ' ||
				$(this).val() == 'CM' ||
				$(this).val() == 'GH' ||
				$(this).val() == 'GN' ||
				$(this).val() == 'KE' ||
				$(this).val() == 'MG' ||
				$(this).val() == 'MV' ||
				$(this).val() == 'MU' ||
				$(this).val() == 'MA' ||
				$(this).val() == 'MZ' ||
				$(this).val() == 'NG' ||
				$(this).val() == 'RE' ||
				$(this).val() == 'SN' ||
				$(this).val() == 'SC' ||
				$(this).val() == 'ZA' ||
				$(this).val() == 'TZ' ||
				$(this).val() == 'TG' ||
				$(this).val() == 'UG') {
				window.open('/forcedownload/Africa_Schedule.xls/hkics/import_hk_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'australia' ||
				$(this).val() == 'AU' ||
				$(this).val() == 'NZ') {
				window.open('/forcedownload/Australia_New_Zealand_Schedule.xls/hkics/import_hk_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'india' ||
				$(this).val() == 'BD' ||
				$(this).val() == 'SA' ||
				$(this).val() == 'LK' ||
                                     $(this).val() == 'IN' ||
                                     $(this).val() == 'PK' ||
				$(this).val() == 'AE') {
				window.open('/forcedownload/India_Pakistan_Middle_East_Schedule.xls/hkics/import_hk_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'europe' ||
				$(this).val() == 'AT' ||
				$(this).val() == 'BE' ||
				$(this).val() == 'DK' ||
				$(this).val() == 'EG' ||
				$(this).val() == 'FI' ||
				$(this).val() == 'FR' ||
				$(this).val() == 'DE' ||
				$(this).val() == 'GR' ||
				$(this).val() == 'HU' ||
				$(this).val() == 'IE' ||
				$(this).val() == 'IT' ||
				$(this).val() == 'LT' ||
				$(this).val() == 'MT' ||
				$(this).val() == 'NL' ||
				$(this).val() == 'NO' ||
				$(this).val() == 'PL' ||
				$(this).val() == 'PT' ||
				$(this).val() == 'RO' ||
				$(this).val() == 'RU' ||
				$(this).val() == 'SK' ||
				$(this).val() == 'ES' ||
				$(this).val() == 'SE' ||
				$(this).val() == 'CH' ||
				$(this).val() == 'TR' ||
				$(this).val() == 'UA' ||
				$(this).val() == 'GB') {
				window.open('/forcedownload/Europe_Mediterranean_Black_Sea_Schedule.xls/hkics/import_hk_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'asia' ||
				$(this).val() == 'BN' ||
				$(this).val() == 'KH' ||
				$(this).val() == 'ID' ||
				$(this).val() == 'KP' ||
				$(this).val() == 'KR' ||
				$(this).val() == 'MY' ||
				$(this).val() == 'MM' ||
				$(this).val() == 'PH' ||
				$(this).val() == 'SG' ||
				$(this).val() == 'TH') {
				window.open('/forcedownload/Intra-Asia_Schedule.xls/hkics/import_hk_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'japan' ||
				$(this).val() == 'JP') {
				window.open('/forcedownload/Japan_Schedule.xls/hkics/import_hk_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'latin' ||
				$(this).val() == 'AR' ||
				$(this).val() == 'BO' ||
				$(this).val() == 'BR' ||
				$(this).val() == 'CL' ||
				$(this).val() == 'CO' ||
				$(this).val() == 'CR' ||
				$(this).val() == 'CO' ||
				$(this).val() == 'EC' ||
				$(this).val() == 'SV' ||
				$(this).val() == 'GT' ||
				$(this).val() == 'JM' ||
				$(this).val() == 'MX' ||
				$(this).val() == 'PA' ||
				$(this).val() == 'PY' ||
				$(this).val() == 'PE' ||
				$(this).val() == 'PR' ||
				$(this).val() == 'UY' ||
				$(this).val() == 'VE') {
				window.open('/forcedownload/Latin_America_Schedule.xls/hkics/import_hk_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'northamerica' ||
				$(this).val() == 'CA' ||
				$(this).val() == 'US') {
				window.open('/forcedownload/North_America_Canada_Schedule.xls/hkics/import_hk_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'vietnam' ||
				$(this).val() == 'VN') {
				window.open('/forcedownload/Vietnam_Schedule.xls/hkics/import_hk_schedule','_self');
				return false;
			}
		})
	});
	
	$(".import2").each(function() {
		$(this).change(function() {
			if ($(this).val() == 'africa' ||
				$(this).val() == 'AO' ||
				$(this).val() == 'BJ' ||
				$(this).val() == 'CM' ||
				$(this).val() == 'GH' ||
				$(this).val() == 'GN' ||
				$(this).val() == 'KE' ||
				$(this).val() == 'MG' ||
				$(this).val() == 'MV' ||
				$(this).val() == 'MU' ||
				$(this).val() == 'MA' ||
				$(this).val() == 'MZ' ||
				$(this).val() == 'NG' ||
				$(this).val() == 'RE' ||
				$(this).val() == 'SN' ||
				$(this).val() == 'SC' ||
				$(this).val() == 'ZA' ||
				$(this).val() == 'TZ' ||
				$(this).val() == 'TG' ||
				$(this).val() == 'UG') {
				window.open('/forcedownload/Africa_Schedule.pdf/hkics/import_xiamen_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'australia' ||
				$(this).val() == 'AU' ||
				$(this).val() == 'NZ') {
				window.open('/forcedownload/Australia_New_Zealand_Schedule.pdf/hkics/import_xiamen_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'india' ||
				$(this).val() == 'BD' ||
				$(this).val() == 'SA' ||
				$(this).val() == 'LK' ||
                                    $(this).val() == 'PK' ||
                                    $(this).val() == 'IN' ||
				$(this).val() == 'AE') {
				window.open('/forcedownload/India_Pakistan_Middle_East_Schedule.pdf/hkics/import_xiamen_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'europe' ||
				$(this).val() == 'AT' ||
				$(this).val() == 'BE' ||
				$(this).val() == 'DK' ||
				$(this).val() == 'EG' ||
				$(this).val() == 'FI' ||
				$(this).val() == 'FR' ||
				$(this).val() == 'DE' ||
				$(this).val() == 'GR' ||
				$(this).val() == 'HU' ||
				$(this).val() == 'IE' ||
				$(this).val() == 'IT' ||
				$(this).val() == 'LT' ||
				$(this).val() == 'MT' ||
				$(this).val() == 'NL' ||
				$(this).val() == 'NO' ||
				$(this).val() == 'PL' ||
				$(this).val() == 'PT' ||
				$(this).val() == 'RO' ||
				$(this).val() == 'RU' ||
				$(this).val() == 'SK' ||
				$(this).val() == 'ES' ||
				$(this).val() == 'SE' ||
				$(this).val() == 'CH' ||
				$(this).val() == 'TR' ||
				$(this).val() == 'UA' ||
				$(this).val() == 'GB') {
				window.open('/forcedownload/Europe_Mediterranean_Black_Sea_Schedule.pdf/hkics/import_xiamen_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'asia' ||
				$(this).val() == 'BN' ||
				$(this).val() == 'KH' ||
				$(this).val() == 'ID' ||
				$(this).val() == 'KP' ||
				$(this).val() == 'KR' ||
				$(this).val() == 'MY' ||
				$(this).val() == 'MM' ||
				$(this).val() == 'PH' ||
				$(this).val() == 'SG' ||
				$(this).val() == 'TH') {
				window.open('/forcedownload/Intra_Asia_Schedule.pdf/hkics/import_xiamen_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'japan' ||
				$(this).val() == 'JP') {
				window.open('/forcedownload/Japan_Schedule.pdf/hkics/import_xiamen_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'latin' ||
				$(this).val() == 'AR' ||
				$(this).val() == 'BO' ||
				$(this).val() == 'BR' ||
				$(this).val() == 'CL' ||
				$(this).val() == 'CO' ||
				$(this).val() == 'CR' ||
				$(this).val() == 'CO' ||
				$(this).val() == 'EC' ||
				$(this).val() == 'SV' ||
				$(this).val() == 'GT' ||
				$(this).val() == 'JM' ||
				$(this).val() == 'MX' ||
				$(this).val() == 'PA' ||
				$(this).val() == 'PY' ||
				$(this).val() == 'PE' ||
				$(this).val() == 'PR' ||
				$(this).val() == 'UY' ||
				$(this).val() == 'VE') {
				window.open('/forcedownload/Latin_America_Schedule.pdf/hkics/import_xiamen_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'northamerica' ||
				$(this).val() == 'CA' ||
				$(this).val() == 'US') {
				window.open('/forcedownload/North_America_Canada_Schedule.pdf/hkics/import_xiamen_schedule','_self');
				return false;
			}
			
			if ($(this).val() == 'vietnam' ||
				$(this).val() == 'VN') {
				window.open('/forcedownload/Vietnam_Schedule.pdf/hkics/import_xiamen_schedule','_self');
				return false;
			}
		})
	});
	
	$("#detentionsel").each(function() {
		$(this).change(function() {
			if ($(this).val() == 'hongkong') {
				window.open('/forcedownload/FT_detention_ demurrage_HongKong.pdf/detention_demurrage','_self');
				//window.open('/forcedownload/files/uploads/file/detention_demurrage/FT_detention_ demurrage_HongKong.pdf','Download');
				return false;
			}
			if ($(this).val() == 'fujian') {
				window.open('/forcedownload/FT_detention_ demurrage_Fujian.pdf/detention_demurrage','_self');
				return false;
			}
			if ($(this).val() == 'guangzhou') {
				window.open('/forcedownload/FT_detention_ demurrage_Guangzhou.pdf/detention_demurrage','_self');
				return false;
			}
			if ($(this).val() == 'shenzhen') {
				window.open('/forcedownload/FT_detention_ demurrage_Shenzhen.pdf/detention_demurrage','_self');
				return false;
			}
		});
	});
	
	$("#paymentsel").each(function() {
		$(this).change(function() {
			if ($(this).val() == 'guangzhou') {
				//window.open('/files/uploads/file/payment_method/Guangzhou_ Payment_Instructions.doc','_self');
				window.open('/forcedownload/Guangzhou_ Payment_Instructions.doc/payment_method','_self');
				return false;
			}
			if ($(this).val() == 'hkgchi') {
				//window.open('/forcedownload/MOL_ASIA_BANK_ACT_CHN.doc/payment_method','_self');
				window.open('/forcedownload/MOLHK_ACT_CHN.doc/payment_method','_self');
				return false;
			}
			if ($(this).val() == 'hkgeng') {
				//window.open('/forcedownload/MOL_ASIA_BANK_ACT_ENG.doc/payment_method','_self');
				window.open('/forcedownload/MOLHK_ACT_ENG.doc/payment_method','_self');
				return false;
			}
			if ($(this).val() == 'shenzhen') {
				window.open('/forcedownload/Shenzhen_Payment_instructions.doc/payment_method','_self');
				return false;
			}
			if ($(this).val() == 'xiamen') {
				window.open('/forcedownload/Xiamen_ Payment_Instructions.doc/payment_method','_self');
				return false;
			}
		});
	});

});