function showHidePanel(panelName) {

	var panel = $(panelName);
	var activePanel = $$('.activeForm')[0];
	
	
	var animatePanel = new Fx.Tween (panel, {transition:Fx.Transitions.linear, duration:300, wait:true});
	var animateActivePanel = new Fx.Tween (activePanel, {transition:Fx.Transitions.linear, duration:300, wait:true});
	
		
	
	var displayChain = new Chain();
		displayChain.chain(
							function(){ 
								
								if (activePanel != null) {
									animateActivePanel.start('opacity',1,0);
								}
							},
							
							function(){
								
								if (activePanel != null) {
 									activePanel.setStyle('display','none');
									activePanel.removeClass('activeForm')
								}
								
								panel.setStyle('opacity',0);
								panel.setStyle('display','block');
								panel.addClass('activeForm')
							},
							
							function(){ 
								animatePanel.start('opacity',0,1);
							}
	);
		
	displayChain.callChain(); 
	displayChain.callChain();
	displayChain.callChain();

}

function carrierSelection(e) {
	  	
		$('step2').setStyle('display','block');
		if (e.value == 'fedEx') {
			showHidePanel('fedExForm');
		}
		
		else if (e.value == 'YRC') {
			showHidePanel('YRCForm');
		}
		
		else if (e.value == 'NewPenn') {
			showHidePanel('NewPennForm');
		}
		
		else if (e.value == 'CentralFreight') {
			showHidePanel('CentralFreightForm');
		}
		
		else if (e.value == 'DuiePyle') {
			showHidePanel('DuiePyleForm');
		}
		
		else if (e.value == 'SouthEasternFreight') {
			showHidePanel('SouthEasternFreightForm');
		}
		
		else if (e.value == 'UPS') {
			showHidePanel('UPSForm');
		}
	
		else {
			$('step2').setStyle('display','none');
		}
		
}

function resetForms() {
   for (i = 0; i< document.forms.length; i++) {
     document.forms[i].reset();
   }
   
   document.getElementById('ddCarrier').options[0].selected = true;
   
}


function validateNumbers(low,high,e) {
		
	if (e.value.length > 0) {
	
		if ((low == high)&&(e.value.length != low)) {
			alert("Tracking number must be exactly " + low + " digits long");
		}
		
		if (e.value.length < low) {
			alert("Tracking number must be at least " + low + " digits long");
		}
		
		if (e.value.length > high) {
			alert("Tracking number must be at most " + high+ " digits long");
		}
	
	}
}


<!-- YRC TRACKING FUNCTIONS -->

function yrctrackBN() {

		numbers = document.getElementById("txtYRCBN").value;
		yrcTrack = window.open('http://my.yrc.com/dynamic/national/servlet?CONTROLLER=com.rdwy.ec.rextracking.http.controller.ProcessPublicTrackingController&PRONumber='+ numbers);
}

function yrctrackBOL() {
		
	
		rURL = "http://my.yrc.com/dynamic/national/servlet?CONTROLLER=com.rdwy.ec.rextracking.http.controller.ProcessPublicTrackingController&type=1";
		
		BOL0 = $('txtBOL0').value;
		ozip0 = $('ozip0').value;
		dzip0 = $('dzip0').value;
		
		BOL1 = $('txtBOL1').value;
		ozip1 = $('ozip1').value;
		dzip1 = $('dzip1').value;
		
		BOL2 = $('txtBOL2').value;
		ozip2 = $('ozip2').value;
		dzip2 = $('dzip2').value;
		
		if ( (BOL0!='')&&(ozip0!='')&&(dzip0!='')) {
			rURL += '&pro0=' + BOL0 + '&ozip0=' + ozip0 + '&dzip0='+dzip0;
		}
		
		if ( (BOL1!='')&&(ozip1!='')&&(dzip1!='')) {
			rURL += '&pro1=' + BOL1 + '&ozip1=' + ozip1 + '&dzip1='+dzip1;
		}
		
		if ( (BOL2!='')&&(ozip2!='')&&(dzip2!='')) {
			rURL += '&pro2=' + BOL2 + '&ozip2=' + ozip2 + '&dzip2='+dzip2;
		}
		
    
		yrcTrack = window.open(rURL);
}

function yrctrackPO() {
		
	
		rURL = "http://my.yrc.com/dynamic/national/servlet?CONTROLLER=com.rdwy.ec.rextracking.http.controller.ProcessPublicTrackingController&type=2";
		
		PO0 = $('txtPO0').value;
		ozip0 = $('pozip0').value;
		dzip0 = $('pdzip0').value;
		
		PO1 = $('txtPO1').value;
		ozip1 = $('pozip1').value;
		dzip1 = $('pdzip1').value;
		
		PO2 = $('txtPO2').value;
		ozip2 = $('pozip2').value;
		dzip2 = $('pdzip2').value;
		
		if ( (PO0!='')&&(ozip0!='')&&(dzip0!='')) {
			rURL += '&pro0=' + PO0 + '&ozip0=' + ozip0 + '&dzip0='+dzip0;
		}
		
		if ( (PO1!='')&&(ozip1!='')&&(dzip1!='')) {
			rURL += '&pro1=' + PO1 + '&ozip1=' + ozip1 + '&dzip1='+dzip1;
		}
		
		if ( (PO2!='')&&(ozip2!='')&&(dzip2!='')) {
			rURL += '&pro2=' + PO2 + '&ozip2=' + ozip2 + '&dzip2='+dzip2;
		}
		
    
		yrcTrack = window.open(rURL);
}

function yrctrackBO() {
		
	
		rURL = "http://my.yrc.com/dynamic/national/servlet?CONTROLLER=com.rdwy.ec.rextracking.http.controller.ProcessPublicTrackingController&type=3";
		
		PO0 = $('txtBO0').value;
		ozip0 = $('bozip0').value;
		dzip0 = $('bdzip0').value;
		
		PO1 = $('txtBO1').value;
		ozip1 = $('bozip1').value;
		dzip1 = $('bdzip1').value;
		
		PO2 = $('txtBO2').value;
		ozip2 = $('bozip2').value;
		dzip2 = $('bdzip2').value;
		
		if ( (PO0!='')&&(ozip0!='')&&(dzip0!='')) {
			rURL += '&pro0=' + PO0 + '&ozip0=' + ozip0 + '&dzip0='+dzip0;
		}
		
		if ( (PO1!='')&&(ozip1!='')&&(dzip1!='')) {
			rURL += '&pro1=' + PO1 + '&ozip1=' + ozip1 + '&dzip1='+dzip1;
		}
		
		if ( (PO2!='')&&(ozip2!='')&&(dzip2!='')) {
			rURL += '&pro2=' + PO2 + '&ozip2=' + ozip2 + '&dzip2='+dzip2;
		}
		
    
		yrcTrack = window.open(rURL);
}

<!-- NewPenn Tracking -->

function newPenntrack() {
		trackNo = $('txtNewPennID').value;
		rURL = "http://www.newpenn.com/npweb/frame.txt/input?location=/npweb/tracking.txt/process?tracking_no_1=" +  trackNo;
		newPennTrack = window.open(rURL);
	
}

<!-- NewPenn Tracking -->

function centralFreightTrack() {
		trackNo = $('txtCentralFreightID').value;
		rURL = "https://cicsc.centralfreight.com/cics/cwba/mkoi55?fb=" +  trackNo;
		if (trackNo.length == 9) {
			newPennTrack = window.open(rURL);
		}
		
		else {
			alert(trackNo + " is incorrect tracking number. Please make sure you have 9 digits.");
		}
		

	
}


<!-- DuiePyle Tracking -->

function DuiePyleTrack() {
		trackNo = $('txtDuiePyleID').value;
		rURL = "http://www.aduiepyle.com/publicdocs/LTLTracking.aspx?Pro=" +  trackNo;
		newPennTrack = window.open(rURL);
	
}

// South Eastern Freight Tracking

//Type=PN for pro number
//Type = IN for interline pro number
//Type = BL for Bill of Lading Number
//Type = PO for purchase order number
//If you trace by BL or PO, set ZipCode to either the shipper's or consignee's 5 digit zip code, otherwise use zeros or leave this parameter off
//Pro numbers must be numeric and 7 or 9 digits in length
//You may enter up to 10 Reference Numbers, RefNum1 thru RefNum10 


function buildSouthEasternFreightURL(type, refNum1, refNum2, refNum3, zip) {
	
		rUrl = "https://www.sefl.com/seflWebsite/servlet?action=Tracing_Trace_by_pro"
		rUrl += "&Type=" + type;

		if (refNum1!='') {
			rUrl += "&RefNum1=" + refNum1;
		}
		
		if (refNum2!='') {
			rUrl += "&RefNum2=" + refNum2;
		}
		
		if (refNum3!='') {
			rUrl += "&RefNum3=" + refNum3;
		}
		
		if ((type =="BL")||(type =="PO")) {
			
			if (zip == '') {zip = '00000'};
			rUrl += "&ZipCode=" + zip;
		}
		
		return (rUrl);
}




function SEFtrackPN() {
		
		refNum1 = $('txtSEF0').value;
		refNum2 = $('txtSEF1').value;
		refNum3 = $('txtSEF2').value;
				
		rURL = buildSouthEasternFreightURL('PN', refNum1, refNum2, refNum3, '')
		
		newPennTrack = window.open(rURL);
		
}

function SEFtrackIN() {
		
		refNum1 = $('txtSEFI0').value;
		refNum2 = $('txtSEFI1').value;
		refNum3 = $('txtSEFI2').value;
		
			
		rURL = buildSouthEasternFreightURL('IN', refNum1, refNum2, refNum3, '')
		
		newPennTrack = window.open(rURL);
		
}

function SEFtrackBOL() {
		
		refNum1 = $('txtSEFB0').value;
		refNum2 = $('txtSEFB1').value;
		refNum3 = $('txtSEFB2').value;
		zip = $('SEFzipB').value;
		rURL = buildSouthEasternFreightURL('BL', refNum1, refNum2, refNum3, zip)
		
		newPennTrack = window.open(rURL);
		
}


function SEFtrackPON() {
		
		refNum1 = $('txtSEFP0').value;
		refNum2 = $('txtSEFP1').value;
		refNum3 = $('txtSEFP2').value;
		zip = $('SEFzipP').value;
		rURL = buildSouthEasternFreightURL('PO', refNum1, refNum2, refNum3, zip)
		
		newPennTrack = window.open(rURL);
		
}



