﻿/**
 * @author Loong
 */
$(function(){
		$('#flash_pop').css('left',$('#flash').offset().left + 40);
		
		$('#test').css('left',$('#flash').offset().left );
		$('#test').css('left',$('#flash').offset().top );
	
	$('#pop_title1').css('left',$('#flash').offset().left + 40);
	$('#pop_title1').css('top',$('#flash_pop').offset().top);
	
	$('#p_left1').css('top',$('#flash_pop').offset().top);
	$('#p_left1').css('left',$('#flash').offset().left+40);
	
	$('#p_right1').css('top',$('#flash_pop').offset().top);
	$('#p_right1').css('left',$('#flash').offset().left+52);
	
	$('#pop_label1').css('left',$('#flash').offset().left+40); 
	$('#pop_label1').css('top',$('#flash_pop').offset().top + 25);
	
	$("#pop_text").css('top',$('#pop_label1').offset().top+25); 
	$("#pop_text").css('left',$('#flash').offset().left+10);//修改左边距，原left40
	
	$("#hwgz_submit").css('top',$('#pop_text').offset().top+10); //修改高度,原调度65
	$("#hwgz_submit").css('left',$('#flash').offset().left+210);
	
	$('#p_left2').css('top',$('#flash_pop').offset().top+110);//修改左边小图标top,原140
	$('#p_left2').css('left',$('#flash_pop').offset().left);
	
	$('#p_right2').css('top',$('#flash_pop').offset().top+110);//修改文字top,原140
	$('#p_right2').css('left',$('#flash_pop').offset().left+12);
	

	$('#p_left3').css('top',$('#flash_pop').offset().top+230);	//增加left3,right3
	$('#p_left3').css('left',$('#flash_pop').offset().left);
	
	$('#p_right3').css('top',$('#flash_pop').offset().top+230);
	$('#p_right3').css('left',$('#flash_pop').offset().left+12);
	
	$('#p_select1').css('top',$('#p_right2').offset().top+25);
	$('#p_select1').css('left',$('#flash_pop').offset().left+22);
	
	$('#p_select2').css('top',$('#p_right2').offset().top+25);
	$('#p_select2').css('left',$('#flash_pop').offset().left+122);
	
  
	$('#p_select3').css('top',$('#p_right3').offset().top+30);  //增加select3
	$('#p_select3').css('left',$('#flash_pop').offset().left+22);
	
	$('#p_select4').css('top',$('#p_right3').offset().top+30);  //增加select4
	$('#p_select4').css('left',$('#flash_pop').offset().left+130);
	
	$('#p_select5').css('top',$('#p_right3').offset().top+60);  //增加select5
	$('#p_select5').css('left',$('#flash_pop').offset().left+22);
	
	$('#p_select6').css('top',$('#p_right3').offset().top+60);  //增加select6
	$('#p_select6').css('left',$('#flash_pop').offset().left+130);


	
	$('#pop_label2').css('left',$('#flash').offset().left + 40);
	$('#pop_label2').css('top',$('#p_select1').offset().top + 30);
	
	$('#pop_label3').css('left',$('#flash').offset().left +40);//增加pop_label3
	$('#pop_label3').css('top',$('#p_select2').offset().top + 120);
	
	$("#pop_text2").css('top',$('#p_select1').offset().top+50);
	$("#pop_text2").css('left',$('#flash').offset().left+8);
	
	$("#hwgz_submit2").css('top',$('#pop_text2').offset().top+5); //修改高度,原调度65
	$("#hwgz_submit2").css('left',$('#flash').offset().left+210);
	
	//增加submit3	
	$("#jgcx_submit").css('top',$('#pop_text2').offset().top+135); 
	$("#jgcx_submit").css('left',$('#flash').offset().left+210);
	
	$('#hwgz_submit').click(function(){
		if($('#hwbh').val() == ''){
			alert('请输入货物编号');	
		}else{
			//window.location.href ="/khfw/?load=/drd/drd2.bak.php&hwbh=" + encodeURI($('#hwbh').val());
			window.location.href ="/wsfw/?load=http://online.hoau.net:8080/THOMS/traceTransByNoMain.do?hwbh=" + encodeURI($('#hwbh').val());
		}
	});

	
//20110504 by shirley,由于点击回车也可输入多个运单号，所以不能直接跳转
   /* $("#hwbh").keydown(function(e){
		if(e.keyCode == 13){
			if($('#hwbh').val() == ''){
				alert('请输入货物编号');	
			}else{
				window.location.href ="/khfw/?load=http://testoms.hoau.net:8080/THOMS/traceTransByNoMain.do?hwbh=" + encodeURI($('#hwbh').val());
			}
		}
	});
   */

	$(".index_wd").click(function(){
		var url = "/khfw/?load=/khfw/khfw1.php";
		//var url = "/wsfw/?load=/khfw/khfw1.php";
		url = url+"?wdbh=" + encodeURI($(this).attr('id'));
		window.location.href = url;
	})
	
	
	$('#hwgz_submit2').click(function(){
			var url = "/wsfw/?id=3&load=/khfw/khfw1.php";
			if($('#province').val()!=''){
				url = url+"&province=" + encodeURI($('#province').val());
			}
			if($('#city').val()!=''){
				url = url+"&city=" + encodeURI($('#city').val());
			}
			if($('#hwbh2').val()!=''){
				url = url+"&wdbh=" + encodeURI($('#hwbh2').val());
			}
			window.location.href = url;
	})
	
//增加价格查询 by shirley20110603
		
   $('#jgcx_submit').click(function(){
		if($('#city1').val() == ''){
			alert('请输入起运城市');	
		}
		else if($('#city2').val() == ''){
			alert('请输入目的城市');	
		}else{
		//window.location.href ="/khfw/?load=/drd/drd2.bak.php&hwbh=" + encodeURI($('#hwbh').val());
		//window.location.href ="/khfw/?load=http://testoms.hoau.net:8080/THOMS/priceQuery.do?shipperCity= "+ encodeURI($('#city1').val()+"&conCity="+ encodeURI($('#city2').val());

		var shipperCitySel = document.getElementById("city1");
		var shipperCity=shipperCitySel.options[shipperCitySel.selectedIndex].text;
		var conCitySel = document.getElementById("city2");
		var conCity=conCitySel.options[conCitySel.selectedIndex].text;		
		window.location.href ="/wsfw/?id=2&load=http://online.hoau.net:8080/THOMS/priceQueryResult.do?shipperCity=" + encodeURI(encodeURI(shipperCity)) + "&conCity=" + encodeURI(encodeURI(conCity));
		}
	});
			
	
	$("#hwbh2").keydown(function(e){
		if(e.keyCode == 13){
			var url = "/khfw/?load=/khfw/khfw1.php";
			if($('#province').val()!=''){
				url = url+"&province=" + encodeURI($('#province').val());
			}
			if($('#city').val()!=''){
				url = url+"&city=" + encodeURI($('#city').val());
			}
			if($('#hwbh2').val()!=''){
				url = url+"&wdbh=" + encodeURI($('#hwbh2').val());
			}
			window.location.href = url;
		}
	});
	
	$("#province").change(function(){
		$.post('/branch/show_index_city.php',{'p_id':$(this).val()},function(data){
			$("#city").html(data);		
		})
	})
/*	增加价格查询省市*/
	
		$("#province1").change(function(){
		$.post('/branch/show_index_city_oms.php',{'p_id':$(this).val()},function(data){
			$("#city1").html(data);		
		})
	})
	
	$("#province2").change(function(){
		$.post('/branch/show_index_city_oms.php',{'p_id':$(this).val()},function(data){
			$("#city2").html(data);		
		})
	})
	
	$('#index_close').click(function(){
		$('.index_pop').hide();
	});
	
});



function resize(){
	$('#flash_pop').css('left',$('#flash').offset().left + 40);
	
	$('#pop_title1').css('left',$('#flash').offset().left + 40);
	$('#pop_title1').css('top',$('#flash_pop').offset().top);
	
	$('#p_left1').css('top',$('#flash_pop').offset().top);
	$('#p_left1').css('left',$('#flash').offset().left+40);
	
	$('#p_right1').css('top',$('#flash_pop').offset().top);
	$('#p_right1').css('left',$('#flash').offset().left+52);
	
	$('#pop_label1').css('left',$('#flash').offset().left + 40);
	$('#pop_label1').css('top',$('#flash_pop').offset().top + 25);
	
	$("#pop_text").css('top',$('#pop_label1').offset().top+25);
	$("#pop_text").css('left',$('#flash').offset().left+40);
	
	$("#hwgz_submit").css('top',$('#pop_text').offset().top+65);
	$("#hwgz_submit").css('left',$('#flash').offset().left+180);
	
	$('#p_left2').css('top',$('#flash_pop').offset().top+140);
	$('#p_left2').css('left',$('#flash_pop').offset().left);
	
	$('#p_right2').css('top',$('#flash_pop').offset().top+140);
	$('#p_right2').css('left',$('#flash_pop').offset().left+12);
	
 
	
	$('#p_select1').css('top',$('#p_right2').offset().top+30);
	$('#p_select1').css('left',$('#flash_pop').offset().left+22);
	
	$('#p_select2').css('top',$('#p_right2').offset().top+30);
	$('#p_select2').css('left',$('#flash_pop').offset().left+122);
	
	$('#p_select2').css('top',$('#p_right2').offset().top+30);
	$('#p_select2').css('left',$('#flash_pop').offset().left+122);
	
	$('#pop_label2').css('left',$('#flash').offset().left + 40);
	$('#pop_label2').css('top',$('#p_select1').offset().top + 30);
	
	$("#pop_text2").css('top',$('#p_select1').offset().top+50);
	$("#pop_text2").css('left',$('#flash').offset().left+40);
	
	$("#hwgz_submit2").css('top',$('#pop_text2').offset().top+65);
	$("#hwgz_submit2").css('left',$('#flash').offset().left+188);
	
}



