var detectNewtoOpen = false;
var detectAfterDel=false;

function showLoad(show,id){
	if(show){
		document.getElementById(id).style.display="inline";
	}else{
		document.getElementById(id).style.display="none";
	}
};

function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();
function sndReq(action) {
	if(document.getElementById('vehicle_type').value=='')
	  {
		document.getElementById('vehicle_type').style.borderColor='red';   
		return false;
	  }
	  if(document.getElementById('capacity').value=='' || document.getElementById('capacity').value=='0')
	  {
		//alert('aaaa');
		eval("document.getElementById('capacity').value = 'Please Enter Capacity'");
		eval("document.getElementById('capacity').style.color = 'red'");
		eval("document.getElementById('capacity').style.fontSize = '10px'");
		return false;
	  }
	showLoad(true,'loadingFleet');	
    http.open('post', action);
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http.onreadystatechange = handleResponse;
	http.send('updaccflag='+document.frmFleetInformation.updaccflag.value+'&AssetNo='+document.frmFleetInformation.AssetNo.value+'&vehicle_type='+document.frmFleetInformation.vehicle_type.value+'&model='+document.frmFleetInformation.model.value+'&capacity='+document.frmFleetInformation.capacity.value+'&noinfleet='+document.frmFleetInformation.noinfleet.value+'&carimage='+document.frmFleetInformation.carimage.value+'&save='+document.frmFleetInformation.save.value+'&color='+document.frmFleetInformation.color.value);
    
}
function handleResponse() {
    if(http.readyState == 4){
		document.getElementById('VendorFleetDelete').innerHTML = http.responseText;
    }
	
}
function vendorInsUpd(Path) {
	var val = Path +'?sid=' + Math.random();
	sndReq(val);
	return false;
}
var http1 = createRequestObject();
function sndReq1(action) {
	MM_showHideLayersDeleteFleetInformation('popdelete','','hide');
    http1.open('get', action);
    http1.onreadystatechange = handleResponse1;
    http1.send(null);
}
function handleResponse1() {
    if(http1.readyState == 4){
		document.getElementById('VendorFleetDelete').innerHTML = http1.responseText;
		// Create the tooltips only on document load
		// Create the tooltips only on document load
$(document).ready(function() 
{
   // Use the each() method to gain access to each elements attributes
   $('#content a[rel]').each(function()
   {
      $(this).qtip(
      {
         content: {
            // Set the text to an image HTML string with the correct src URL to the loading image you want to use
            text: '<img  src="../images/ajax-loader-light.gif" alt="Loading..." />',
            url: $(this).attr('rel') // Use the rel attribute of each element for the url to load
            
         },
         position: {
            corner: {
               target: 'bottomLeft', // Position the tooltip above the link
               tooltip: 'topRight'
            },
            adjust: {
               screen: true // Keep the tooltip on-screen at all times
            }

         },
         show: { 
            when: 'mouseover', 
            solo: false // Only show one tooltip at a time
         },
         hide: 'mouseout',
         style: {
            tip: false, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
            border: {
               width: 0,
               radius: 1
            },
            name: 'light', // Use the default light style
            width: 700 // Set the tooltip width
         }
      })
   });
});
		}
	
}

function vendorFleetdelete(Path,AssetNo,flagupd) {
	
	var val = Path+'?sid=' + Math.random()+ '&updaccflag='+flagupd+'&AssetNo='+AssetNo;
	sndReq1(val);
	return false;
}

var http2 = createRequestObject();
function sndReq2(action) {
    http2.open('get', action);
    http2.onreadystatechange = handleResponse2;
    http2.send(null);
}
function handleResponse2() {
    if(http2.readyState == 4){
		document.getElementById('ServiceAreas').innerHTML = http2.responseText;
		//vendorServiceSer('ajax/service_areas_add_search_mainbody.php');
    }
}
function vendorServiceSer(Path,DetfLoad,Serpost,idServiceRadRestSelHid) {
	//var idServiceRadRestSelHid=document.getElementById('idServiceRadRestSelHid').value;
	//alert(idServiceRadRestSelHid);
	var val = Path+'?sid=' + Math.random()+'&serpost='+Serpost+'&idServiceRadRest='+idServiceRadRestSelHid;
	//alert(val);
	if(DetfLoad=='0')
	{
	showLoad(true,'loadingAirportCode');
	}
	sndReq2(val);
	return false;
}



var http3 = createRequestObject();
function sndReq3(action) {
	/*if(document.getElementById('zipcode').value!='')
		{
		  if(document.getElementById('radius').value=='')
		  {
			eval("document.getElementById('radius').value = 'Please Choose Radius'");
		    eval("document.getElementById('radius').style.color = 'red'");
		    eval("document.getElementById('radius').style.fontSize = '10px'");
			return false;
		  }
		  else
		  {
			 document.getElementById('displayAlert').innerHTML="";   
		  }
		}*/
		if(document.getElementById('allnone').checked==true)
		{
			var alloneService="1";
		}
		else if(document.getElementById('allnone').checked==false)
		{
			var alloneService="0";
		}
		
    http3.open('post', action);
	http3.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http3.onreadystatechange = handleResponse3;
	http3.send('zipcode='+document.frmServiceNotification.zipcode.value+'&radius='+document.frmServiceNotification.radius.value+'&zipair='+document.frmServiceNotification.zipair.value+'&save='+document.frmServiceNotification.save.value+'&alloneservice='+alloneService);
}
function handleResponse3() {
    if(http3.readyState == 4){
		document.getElementById('ServiceAreas').innerHTML = http3.responseText;
		var idServiceRadRestSelHid=document.getElementById('idServiceRadRestSelHid').value;
		var flgDetectHid=document.getElementById('flgDetectHid').value;
	//alert(flgDetectHid);
	    if(flgDetectHid=='Zipcode')
		{
		    vendorServiceSer('ajax/service_areas_add_search_mainbody.php','0','','');
		}
		else if(flgdetect=="Airportcode")
		{
			vendorServiceSer('ajax/service_areas_add_search_mainbody.php','0','Serpost',idServiceRadRestSelHid);
		}
    }
}
function vendorServiceInsUpd(Path,flgdetect,BasePostAirPost) {
	//alert(val);
	if(flgdetect=="Zipcode")
	{
	var val = Path+'?sid=' + Math.random()+'&flgdetect='+flgdetect+'&basepostairpost='+BasePostAirPost; 	
	showLoad(true,'loadingZipCode');
	}
	else if(flgdetect=="Airportcode")
	{
	var idServiceRadRestSelHid=document.getElementById('idServiceRadRestSelHid').value;
	var val = Path+'?sid=' + Math.random()+'&flgdetect='+flgdetect+'&basepostairpost='+BasePostAirPost+'&serpost=Serpost'+'&idServiceRadRest='+idServiceRadRestSelHid; 	
	showLoad(true,'loadingAirportCode');
	}
	sndReq3(val);
	return false;
}

var http4 = createRequestObject();
function sndReq4(action) {
	//MM_showHideLayersDeletevendorServicearea('popdelete','','hide');
    http4.open('get', action);
    http4.onreadystatechange = handleResponse4;
    http4.send(null);
}
function handleResponse4() {
    if(http4.readyState == 4){
		document.getElementById('ServiceAreas').innerHTML = http4.responseText;
		if(detectAfterDel==true)
		{
			//alert('aaaa');
			var idServiceRadRestSelHid=document.getElementById('idServiceRadRestSelHid').value;
			//alert(idServiceRadRestSelHid);
			vendorServiceSer('ajax/service_areas_add_search_mainbody.php','0','Serpost',idServiceRadRestSelHid);
		}
    }
}
function vendorServiceDelete(Path,idServiceArea,flag,Cascade) {
	if(Cascade=='yes')
	{
		detectAfterDel=true;
		var val = Path+'?sid=' + Math.random()+'&idService='+idServiceArea+'&flag='+flag+'&cascade='+Cascade;
	}
	else
	{
		var idServiceRadRestSelHid=document.getElementById('idServiceRadRestSelHid').value;
		var val = Path+'?sid=' + Math.random()+'&idService='+idServiceArea+'&flag='+flag+'&cascade='+Cascade+'&serpost=Serpost'+'&idServiceRadRest='+idServiceRadRestSelHid;
	}
	sndReq4(val);
	return false;
}

var http5 = createRequestObject();
function sndReq5(action) {
    http5.open('get', action);
    http5.onreadystatechange = handleResponse5;
    http5.send(null);
}
function handleResponse5() {
    if(http5.readyState == 4){
		document.getElementById('ServiceAreas').innerHTML = http5.responseText;
    }
}
function vendorSerZip(Path,Postcode,Serpost,idServiceArea,Serpar) {
	var val = Path+'?sid=' + Math.random()+'&serpostcode='+Postcode+'&serpost='+Serpost+'&idServiceRadRest='+idServiceArea+'&serparam='+Serpar;
	//alert(val);
	sndReq5(val);
	return false;
}

var http6 = createRequestObject();
function sndReq6(action) {
    http6.open('get', action);
    http6.onreadystatechange = handleResponse6;
    http6.send(null);
}
function handleResponse6() {
    if(http6.readyState == 4){
		document.getElementById('CreateUser').innerHTML = http6.responseText;
    }
}
function vendorCreateAccountUser(Path) {
	var val = Path+'?sid=' + Math.random();
	sndReq6(val);
	return false;
}

var http7 = createRequestObject();
function sndReq7(action) {
    http7.open('post', action);
	http7.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http7.onreadystatechange = handleResponse7;
	if(document.frmUserMgmt.user_active.checked==true)
	{
		var user_active_val='1';
	}
	else
	{
		var user_active_val='0';  
	}
	var UserNameSub=document.frmUserMgmt.user_username.value;
	var EmailSub=document.frmUserMgmt.user_email.value;
	var NameSub=document.frmUserMgmt.user_name.value;
	var UserSubChkStrId=document.getElementById('UserSubChkStr').value;
	var EmailSubChkStrId=document.getElementById('EmailSubChkStr').value;
	var SubcontEmailstr=document.getElementById('subcontEmailstr').value;
	var UserSubChkStrSplit=UserSubChkStrId.split(',');
	var EmailSubChkStrSplit=EmailSubChkStrId.split(',');
	/*if(EmailSub=='' && UserNameSub=='' && NameSub=='')
	{
		eval("document.getElementById('user_email').style.borderColor = 'red'");	
		eval("document.getElementById('user_email').value = 'Email Can not be Blank!'");
		eval("document.getElementById('user_email').style.fontSize = '10px'");	
		eval("document.getElementById('user_email').style.color = 'red'");
		
		eval("document.getElementById('user_username').value = 'User Name Can not be Blank!'");
		 eval("document.getElementById('user_username').style.borderColor = 'red'");
		 eval("document.getElementById('user_username').style.color = 'red'");
		 eval("document.getElementById('user_username').style.fontSize = '10px'");	
		 
		 eval("document.getElementById('user_name').value = 'Name Can not be Blank!'");
		 eval("document.getElementById('user_name').style.borderColor = 'red'");
		 eval("document.getElementById('user_name').style.color = 'red'");
		 eval("document.getElementById('user_name').style.fontSize = '10px'");	
		 return false;
	}*/
	if(EmailSub=='' || EmailSub=='Email Can not be Blank!')
	{
		 eval("document.getElementById('user_email').style.borderColor = 'red'");	
		 eval("document.getElementById('user_email').value = 'Email Can not be Blank!'");
		 eval("document.getElementById('user_email').style.fontSize = '10px'");	
		 eval("document.getElementById('user_email').style.color = 'red'");
		 return false;
	}
	else
	{
		 eval("document.getElementById('user_email').style.borderColor = ''");	
		 eval("document.getElementById('user_email').style.fontSize = '12px'");	
		 eval("document.getElementById('user_email').style.color = ''");
		
	}
	if(EmailSub!='')
	{
		var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
	    var txtDisplayEmail = 'Invalid Email';
		if(re.test(EmailSub)==false) 
		{
			//alert('aaaa');
			eval("document.getElementById('user_email').style.borderColor = 'red'");
			eval("document.getElementById('user_email').value = '" + txtDisplayEmail + "'");
			eval("document.getElementById('user_email').style.color = 'red'");
			eval("document.getElementById('user_email').style.fontSize = '10px'");
			return false;
		}
		else
		{
			for(var j=0;j<EmailSubChkStrId.length;j++)
			{
				if(EmailSubChkStrSplit[j]==EmailSub || EmailSub=='Email Already Exists!')
				{
					 eval("document.getElementById('user_email').style.borderColor = 'red'");	
					 eval("document.getElementById('user_email').value = 'Email Already Exists!'");
					 eval("document.getElementById('user_email').style.fontSize = '10px'");	
					 eval("document.getElementById('user_email').style.color = 'red'");
					 return false;
				}
			}
			/*var SubcontEmailstrSpl=SubcontEmailstr.split(',');
			for(var i=0;i<SubcontEmailstrSpl.length;i++)
			{
				if(SubcontEmailstrSpl[i]==EmailSub || EmailSub=='Email Already Exists!')
				{
					 eval("document.getElementById('user_email').style.borderColor = 'red'");	
					 eval("document.getElementById('user_email').value = 'Email Already Exists!'");
					 eval("document.getElementById('user_email').style.fontSize = '10px'");	
					 eval("document.getElementById('user_email').style.color = 'red'");
					 return false;
				}
			}*/
		}
	}
	
	if(UserNameSub=='' || UserNameSub=='User Name Can not be Blank!')
	{
		 eval("document.getElementById('user_username').value = 'User Name Can not be Blank!'");
		 eval("document.getElementById('user_username').style.borderColor = 'red'");
		 eval("document.getElementById('user_username').style.color = 'red'");
		 eval("document.getElementById('user_username').style.fontSize = '10px'");	
		 return false;
	}
	else
	{
		
		eval("document.getElementById('user_username').style.borderColor = ''");
		eval("document.getElementById('user_username').style.color = ''");
		eval("document.getElementById('user_username').style.fontSize = '12px'");   
		
	}
	if(UserNameSub!='')
	{
		for(var i=0;i<UserSubChkStrId.length;i++)
		{
			if(UserSubChkStrSplit[i]==UserNameSub || UserNameSub=='User Name Already Exists!')
			{
				//alert('aaaa');
				 eval("document.getElementById('user_username').style.borderColor = 'red'");	
				 eval("document.getElementById('user_username').value = 'User Name Already Exists!'");
				 eval("document.getElementById('user_username').style.fontSize = '10px'");
				 eval("document.getElementById('user_username').style.color = 'red'");
				 return false;
			}
		}
		
	}
	
	if(NameSub=='' || NameSub=='Name Can not be Blank!')
	{
		 eval("document.getElementById('user_name').value = 'Name Can not be Blank!'");
		 eval("document.getElementById('user_name').style.borderColor = 'red'");
		 eval("document.getElementById('user_name').style.color = 'red'");
		 eval("document.getElementById('user_name').style.fontSize = '10px'");	
		 return false;
	}
	else
	{
		/*eval("document.getElementById('user_username').value = 'User Name Can not be Blank!'");
		 eval("document.getElementById('user_username').style.borderColor = ''");
		 eval("document.getElementById('user_username').style.color = ''");
		 eval("document.getElementById('user_username').style.fontSize = '12px'");
		 eval("document.getElementById('user_email').style.borderColor = ''");	
		 eval("document.getElementById('user_email').value = 'Email Can not be Blank!'");
		 eval("document.getElementById('user_email').style.fontSize = '12px'");	
		 eval("document.getElementById('user_email').style.color = ''");*/
		 
		 //eval("document.getElementById('user_name').value = 'Name Can not be Blank!'");
		 eval("document.getElementById('user_name').style.borderColor = ''");
		 eval("document.getElementById('user_name').style.color = ''");
		 eval("document.getElementById('user_name').style.fontSize = '12px'");	
	}
	
	
	
	
	showLoad(true,'loadingUserCreate');
	http7.send('user_email='+document.frmUserMgmt.user_email.value+'&user_username='+document.frmUserMgmt.user_username.value+'&user_name='+document.frmUserMgmt.user_name.value+'&user_type12='+document.frmUserMgmt.user_type12.value+'&user_active='+user_active_val);
}
function handleResponse7() {
    if(http7.readyState == 4){
		document.getElementById('CreateUser').innerHTML = http7.responseText;
    }
}
function vendorUserInsUpd(Path,flgdetect) {
	var val = Path+'?sid=' + Math.random()+'&flgdetect='+flgdetect;
	sndReq7(val);
	return false;
}

var http8 = createRequestObject();
function sndReq8(action) {
	MM_showHideLayersDeletevendorUser('popdelete','','hide');
    http8.open('get', action);
    http8.onreadystatechange = handleResponse8;
    http8.send(null);
}
function handleResponse8() {
    if(http8.readyState == 4){
		document.getElementById('CreateUser').innerHTML = http8.responseText;
    }
}
function vendorUserDelete(Path,UserId,Flag) {
	var val = Path+'?sid=' + Math.random()+'&userid='+UserId+'&delflag='+Flag;
	showLoad(true,'loadingDeleteUser');
	sndReq8(val);
	return false;
}

var http9 = createRequestObject();
function sndReq9(action) {
    http9.open('get', action);
    http9.onreadystatechange = handleResponse9;
    http9.send(null);
}
function handleResponse9() {
    if(http9.readyState == 4){
		document.getElementById('BidNewrides').innerHTML = http9.responseText;
		var CountForTooltip=document.getElementById('CountNoForTooltip').value;
		//alert(CountForTooltip);
		for(var CntForTooltip=1;CntForTooltip<=CountForTooltip;CntForTooltip++)
		{
			//alert(CntForTooltip);
			var idTooltip="#ToLabel"+CntForTooltip;
			//alert(idTooltip);
			$(idTooltip).qtip({
		 content: {
		   text:'We are sorry but Quick Bid is not available for this ride because you do not have a vehicle listed in Your Fleet that matches the type requested for this ride. You may still click on the ride details to use the regular bid functionality. Please update the information in Your Fleet under the Account menu if you do have a vehicle of the requested type.'
		  },
		  show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
		  position: {
			corner: {
			 target: 'upperRight',
			  tooltip: 'bottomRight'
					}
		   },
		   style: { 
			border: {
			 width: 2,
			  radius: 5
			},
			padding: 10, 
			textAlign: 'left',
			name: 'cream',
			tip: true
		   }
		});
			
		}
		var idTooltip="#ToLabelQuery";
		//alert(idTooltip);
		$(idTooltip).qtip({
		content: {
		text:"The optional bid floor let's you set the minimum price you would be willing to accept for this ride. If another vendor bids lower than you, the SecuredBid&trade; system will automatically lower your bid in small decrements to keep you competitive.  You may revise your bid-floor lower at any time after placing the initial bid."
		},
		show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
		position: {
		corner: {
		target: 'upperRight',
		tooltip: 'bottomRight'
		}
		},
		style: { 
		border: {
		width: 2,
		radius: 5
		},
		padding: 10, 
		textAlign: 'left',
		name: 'cream',
		tip: true
		}
		});
		
    }
}
function vendorBidnewrides(Path,ExpandStat) {
	var val = Path+'?sid=' + Math.random()+'&expandstatus='+ExpandStat;
	sndReq9(val);
	return false;
}

var http10 = createRequestObject();
function sndReq10(action) {
	//alert(action);
	var newsplitedStr=action.split('&');
	var newsplitedNo=newsplitedStr[4].split('=');
	var newbidfloorCnt=newsplitedNo[1];
	var newbidvalueCnt='bid_2'+newbidfloorCnt;
	var chkValidChkBid=document.getElementById('bid_2'+newbidfloorCnt).value;
	var chkValidChkFloor=document.getElementById('floor_2'+newbidfloorCnt).value;
	if(parseFloat(chkValidChkFloor)>parseFloat(chkValidChkBid))
	{
		//alert('aaaa');
		eval("document.getElementById('floor_2" + newbidfloorCnt + "').value = 'Floor must be lower'");
		eval("document.getElementById('floor_2" + newbidfloorCnt + "').style.color = 'red'");
		eval("document.getElementById('floor_2" + newbidfloorCnt + "').style.fontSize = '10px'");
		return false;
		
	}
	else
	{
		if(chkValidChkBid!='' && chkValidChkBid!='0')
		{
	      showLoad(true,'loadingBid');
		}
	}
    http10.open('post', action);
	http10.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http10.onreadystatechange = handleResponse10;
	http10.send('bid_2'+newbidfloorCnt+'='+document.getElementById('bid_2'+newbidfloorCnt).value+'&floor_2'+newbidfloorCnt+'='+document.getElementById('floor_2'+newbidfloorCnt).value);
}
function handleResponse10() {
    if(http10.readyState == 4){
		document.getElementById('BidNewrides').innerHTML = http10.responseText;
		//alert('aaaa');
		var detectNewtoOpen=true;
		if(detectNewtoOpen==true)
		{
			var chkStatSizeOpen=document.getElementById('chkStatSizeOpen').value;
			var chkStatSizeAccepted=document.getElementById('chkStatSizeAccepted').value;
			//alert(chkStatSizeNew);
			vendorAcceptedbids('ajax/vendor_ride_summary_accepted.php','','',chkStatSizeOpen);
			vendorOpenbids('ajax/vendor_ride_openbid_summary.php','','',chkStatSizeAccepted);
			var CountForTooltip=document.getElementById('CountNoForTooltip').value;
			//alert(CountForTooltip);
			for(var CntForTooltip=1;CntForTooltip<=CountForTooltip;CntForTooltip++)
			{
				//alert(CntForTooltip);
				var idTooltip="#ToLabel"+CntForTooltip;
				//alert(idTooltip);
				$(idTooltip).qtip({
				content: {
				text:'We are sorry but Quick Bid is not available for this ride because you do not have a vehicle listed in Your Fleet that matches the type requested for this ride. You may still click on the ride details to use the regular bid functionality. Please update the information in Your Fleet under the Account menu if you do have a vehicle of the requested type.'
				},
				show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
				position: {
				corner: {
				target: 'upperRight',
				tooltip: 'bottomRight'
				}
				},
				style: { 
				border: {
				width: 2,
				radius: 5
				},
				padding: 10, 
				textAlign: 'left',
				name: 'cream',
				tip: true
				}
				});
				
			}
			var idTooltip="#ToLabelQuery";
			//alert(idTooltip);
			$(idTooltip).qtip({
			content: {
			text:"The optional bid floor let's you set the minimum price you would be willing to accept for this ride. If another vendor bids lower than you, the SecuredBid&trade; system will automatically lower your bid in small decrements to keep you competitive.  You may revise your bid-floor lower at any time after placing the initial bid."
			},
			show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
			position: {
			corner: {
			target: 'upperRight',
			tooltip: 'bottomRight'
			}
			},
			style: { 
			border: {
			width: 2,
			radius: 5
			},
			padding: 10, 
			textAlign: 'left',
			name: 'cream',
			tip: true
			}
			});
			
		}
		detectNewtoOpen=false;
    }
}
function vendorBidInsUpd(Path,flgdetect,TxnNo,BidNo,Cntnew8,Page,Serflag,sortField,sortKey) {
	var chkStatSizeNew=document.getElementById('chkStatSizeNew').value;
	var val = Path+'?sid=' + Math.random()+'&flgdetect='+flgdetect+'&txnno='+TxnNo+'&bidno='+BidNo+'&Cnt='+Cntnew8+'&expandstatus='+chkStatSizeNew+'&p='+Page+'&serflag='+Serflag+'&sortfield='+sortField+'&sortkey='+sortKey; 
	//showLoad(true,'loadingBid');
	//alert(val);
	sndReq10(val);
	return false;
}


var http11 = createRequestObject();
function sndReq11(action) {
    http11.open('get', action);
    http11.onreadystatechange = handleResponse11;
    http11.send(null);
}
function handleResponse11() {
    if(http11.readyState == 4){
		document.getElementById('BidNewrides').innerHTML = http11.responseText;
		var CountForTooltip=document.getElementById('CountNoForTooltip').value;
		//alert(CountForTooltip);
		for(var CntForTooltip=1;CntForTooltip<=CountForTooltip;CntForTooltip++)
		{
			//alert(CntForTooltip);
			var idTooltip="#ToLabel"+CntForTooltip;
			//alert(idTooltip);
			$(idTooltip).qtip({
		 content: {
		   text:'We are sorry but Quick Bid is not available for this ride because you do not have a vehicle listed in Your Fleet that matches the type requested for this ride. You may still click on the ride details to use the regular bid functionality. Please update the information in Your Fleet under the Account menu if you do have a vehicle of the requested type.'
		  },
		  show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
		  position: {
			corner: {
			 target: 'upperRight',
			  tooltip: 'bottomRight'
					}
		   },
		   style: { 
			border: {
			 width: 2,
			  radius: 5
			},
			padding: 10, 
			textAlign: 'left',
			name: 'cream',
			tip: true
		   }
		});
			
		}
		var idTooltip="#ToLabelQuery";
		//alert(idTooltip);
		$(idTooltip).qtip({
		content: {
		text:"The optional bid floor let's you set the minimum price you would be willing to accept for this ride. If another vendor bids lower than you, the SecuredBid&trade; system will automatically lower your bid in small decrements to keep you competitive.  You may revise your bid-floor lower at any time after placing the initial bid."
		},
		show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
		position: {
		corner: {
		target: 'upperRight',
		tooltip: 'bottomRight'
		}
		},
		style: { 
		border: {
		width: 2,
		radius: 5
		},
		padding: 10, 
		textAlign: 'left',
		name: 'cream',
		tip: true
		}
		});
    }
}
function newRidesSearch(Path,Field,SortKey,Serflag,serParam,zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,Page) {
	var chkStatSize=document.getElementById('chkStatSizeNew').value;
	//alert(chkStatSize);
	var val = Path+'?sid=' + Math.random()+'&sortfield='+Field+'&sortkey='+SortKey+'&serflag='+Serflag+'&serparam='+serParam+'&zipcodeser='+zipcodeSer+'&dateser='+dateSer+'&airportcodeser='+airportcodeSer+'&pointtopointser='+pointtopointSer+'&hourlyser='+hourlySer+'&cityser='+citySer+'&timeser'+timeSer+'&p='+Page+'&expandstatus='+chkStatSize;
	sndReq11(val);
	return false;
}
function vendorOpenbids(Path,statChg,Username,ExpandStat) {
	var val = Path+'?sid=' + Math.random()+'&onchguser='+statChg+'&userchg='+Username+'&expandstatus='+ExpandStat;
	//alert('');
	//showLoad(true,'loadingBidEdit');	
	sndReq12(val);
	return false;
}
var http12 = createRequestObject();
function sndReq12(action) {
    http12.open('get', action);
    http12.onreadystatechange = handleResponse12;
    http12.send(null);
}
function handleResponse12() {
    if(http12.readyState == 4){
		document.getElementById('BidOpenrides').innerHTML = http12.responseText;
		var cntDisableOpen=document.getElementById('cntDisableOpen').value;
			//alert(CountForTooltip);
			for(var CntForTooltip=1;CntForTooltip<=cntDisableOpen;CntForTooltip++)
			{
				//alert(CntForTooltip);
				var idTooltip="#ToLabel2"+CntForTooltip;
				//alert(idTooltip);
				$(idTooltip).qtip({
				content: {
				text:'We are sorry but Quick Bid is not available for this ride because you do not have a vehicle listed in Your Fleet that matches the type requested for this ride. You may still click on the ride details to use the regular bid functionality. Please update the information in Your Fleet under the Account menu if you do have a vehicle of the requested type.'
				},
				show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
				position: {
				corner: {
				target: 'upperRight',
				tooltip: 'bottomRight'
				}
				},
				style: { 
				border: {
				width: 2,
				radius: 5
				},
				padding: 10, 
				textAlign: 'left',
				name: 'cream',
				tip: true
				}
				});
				
			}
			var idTooltip="#ToLabelOpenQuery";
			//alert(idTooltip);
			$(idTooltip).qtip({
			content: {
			text:"The optional bid floor let's you set the minimum price you would be willing to accept for this ride. If another vendor bids lower than you, the SecuredBid&trade; system will automatically lower your bid in small decrements to keep you competitive.  You may revise your bid-floor lower at any time after placing the initial bid."
			},
			show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
			position: {
			corner: {
			target: 'upperRight',
			tooltip: 'bottomRight'
			}
			},
			style: { 
			border: {
			width: 2,
			radius: 5
			},
			padding: 10, 
			textAlign: 'left',
			name: 'cream',
			tip: true
			}
			});
    }
}


var http14 = createRequestObject();
function sndReq14(action) {
	var splitedStr=action.split('&');
	var splitedNo=splitedStr[4].split('=');
	var bidfloorCnt=splitedNo[1];
	var bidvalueCnt='bid2'+bidfloorCnt;
	var chkValidUpdChkBid=document.getElementById('bid2'+bidfloorCnt).value;
	var chkValidUpdChkFloor=document.getElementById('floor2'+bidfloorCnt).value;
	
	if(parseFloat(document.getElementById('floor2'+bidfloorCnt).value)>parseFloat(document.getElementById('bid2'+bidfloorCnt).value))
	{
		//alert('aaaa');
		eval("document.getElementById('floor2" + bidfloorCnt + "').value = 'Floor must be lower'");
		eval("document.getElementById('floor2" + bidfloorCnt + "').style.color = 'red'");
		eval("document.getElementById('floor2" + bidfloorCnt + "').style.fontSize = '10px'");
		return false;
		
	}
	var recentBid=document.getElementById('recentBid'+bidfloorCnt).value;
	//alert(parseFloat(recentBid));
	if(parseFloat(recentBid)!='')
	{
		if(parseFloat(chkValidUpdChkBid)>parseFloat(recentBid))
		{
			/*alert(parseFloat(recentBid));
			alert(parseFloat(chkValidUpdChkBid));*/
			eval("document.getElementById('bid2" + bidfloorCnt + "').value = 'Must Be Lower than Existing Bid'");
			eval("document.getElementById('bid2" + bidfloorCnt + "').style.color = 'red'");
			eval("document.getElementById('bid2" + bidfloorCnt + "').style.fontSize = '10px'");
			return false;
		}
		
	}
	
	if(parseFloat(chkValidUpdChkBid)<=parseFloat(recentBid) && parseFloat(chkValidUpdChkFloor)<parseFloat(chkValidUpdChkBid) && chkValidUpdChkBid!='' && chkValidUpdChkBid!='0')
	{
		showLoad(true,'loadingBidEdit');
	}
    http14.open('post', action);
	http14.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http14.onreadystatechange = handleResponse14;
	http14.send('bid2'+bidfloorCnt+'='+document.getElementById('bid2'+bidfloorCnt).value+'&floor2'+bidfloorCnt+'='+document.getElementById('floor2'+bidfloorCnt).value);
}
function handleResponse14() {
    if(http14.readyState == 4){
		document.getElementById('BidOpenrides').innerHTML = http14.responseText;
		vendorAcceptedbids('ajax/vendor_ride_summary_accepted.php','','','0');
		//vendorOpenbids('ajax/vendor_ride_openbid_summary.php','','','0');
		/*vendorAcceptedbids('http://localhost/ridebid/vendor/ajax/vendor_ride_summary_accepted.php','','','0');
		vendorOpenbids('http://localhost/ridebid/vendor/ajax/vendor_ride_openbid_summary.php','','','0');*/
		var cntDisableOpen=document.getElementById('cntDisableOpen').value;
			//alert(CountForTooltip);
			for(var CntForTooltip=1;CntForTooltip<=cntDisableOpen;CntForTooltip++)
			{
				//alert(CntForTooltip);
				var idTooltip="#ToLabel2"+CntForTooltip;
				//alert(idTooltip);
				$(idTooltip).qtip({
				content: {
				text:'We are sorry but Quick Bid is not available for this ride because you do not have a vehicle listed in Your Fleet that matches the type requested for this ride. You may still click on the ride details to use the regular bid functionality. Please update the information in Your Fleet under the Account menu if you do have a vehicle of the requested type.'
				},
				show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
				position: {
				corner: {
				target: 'upperRight',
				tooltip: 'bottomRight'
				}
				},
				style: { 
				border: {
				width: 2,
				radius: 5
				},
				padding: 10, 
				textAlign: 'left',
				name: 'cream',
				tip: true
				}
				});
				
			}
			var idTooltip="#ToLabelOpenQuery";
			//alert(idTooltip);
			$(idTooltip).qtip({
			content: {
			text:"The optional bid floor let's you set the minimum price you would be willing to accept for this ride. If another vendor bids lower than you, the SecuredBid&trade; system will automatically lower your bid in small decrements to keep you competitive.  You may revise your bid-floor lower at any time after placing the initial bid."
			},
			show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
			position: {
			corner: {
			target: 'upperRight',
			tooltip: 'bottomRight'
			}
			},
			style: { 
			border: {
			width: 2,
			radius: 5
			},
			padding: 10, 
			textAlign: 'left',
			name: 'cream',
			tip: true
			}
			});
    }
}
function vendorBidUpd(Path,flgdetect,TxnNo,BidNo,Cnt,Page,Serflag,sortField,sortKey) {
	var chkStatSizeOpen=document.getElementById('chkStatSizeOpen').value;
	var val = Path+'?sid=' + Math.random()+'&flgdetect='+flgdetect+'&txnno='+TxnNo+'&bidno='+BidNo+'&Cnt='+Cnt+'&expandstatus='+chkStatSizeOpen+'&p='+Page+'&serflag='+Serflag+'&sortfield='+sortField+'&sortkey='+sortKey;
	//showLoad(true,'loadingBidEdit');
	//alert(val);
	
	sndReq14(val);
	return false;
}

var http15 = createRequestObject();
function sndReq15(action) {
    http15.open('get', action);
    http15.onreadystatechange = handleResponse15;
    http15.send(null);
}
function handleResponse15() {
    if(http15.readyState == 4){
		document.getElementById('BidOpenrides').innerHTML = http15.responseText;
		var cntDisableOpen=document.getElementById('cntDisableOpen').value;
			//alert(CountForTooltip);
			for(var CntForTooltip=1;CntForTooltip<=cntDisableOpen;CntForTooltip++)
			{
				//alert(CntForTooltip);
				var idTooltip="#ToLabel2"+CntForTooltip;
				//alert(idTooltip);
				$(idTooltip).qtip({
				content: {
				text:'We are sorry but Quick Bid is not available for this ride because you do not have a vehicle listed in Your Fleet that matches the type requested for this ride. You may still click on the ride details to use the regular bid functionality. Please update the information in Your Fleet under the Account menu if you do have a vehicle of the requested type.'
				},
				show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
				position: {
				corner: {
				target: 'upperRight',
				tooltip: 'bottomRight'
				}
				},
				style: { 
				border: {
				width: 2,
				radius: 5
				},
				padding: 10, 
				textAlign: 'left',
				name: 'cream',
				tip: true
				}
				});
				
			}
			var idTooltip="#ToLabelOpenQuery";
			//alert(idTooltip);
			$(idTooltip).qtip({
			content: {
			text:"The optional bid floor let's you set the minimum price you would be willing to accept for this ride. If another vendor bids lower than you, the SecuredBid&trade; system will automatically lower your bid in small decrements to keep you competitive.  You may revise your bid-floor lower at any time after placing the initial bid."
			},
			show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
			position: {
			corner: {
			target: 'upperRight',
			tooltip: 'bottomRight'
			}
			},
			style: { 
			border: {
			width: 2,
			radius: 5
			},
			padding: 10, 
			textAlign: 'left',
			name: 'cream',
			tip: true
			}
			});
    }
}
function openRidesSearch(Path,Field,SortKey,Serflag,serParam,zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,Page) {
	var chkStatSizeOpen=document.getElementById('chkStatSizeOpen').value;
	var val = Path+'?sid=' + Math.random()+'&sortfield='+Field+'&sortkey='+SortKey+'&serflag='+Serflag+'&serparam='+serParam+'&zipcodeser='+zipcodeSer+'&dateser='+dateSer+'&airportcodeser='+airportcodeSer+'&pointtopointser='+pointtopointSer+'&hourlyser='+hourlySer+'&cityser='+citySer+'&timeser'+timeSer+'&p='+Page+'&expandstatus='+chkStatSizeOpen;
	sndReq15(val);
	return false;
}

var http16 = createRequestObject();
function sndReq16(action) {
    http16.open('get', action);
    http16.onreadystatechange = handleResponse16;
    http16.send(null);
}
function handleResponse16() {
    if(http16.readyState == 4){
		document.getElementById('BidAcceptedrides').innerHTML = http16.responseText;
    }
}
function vendorAcceptedbids(Path,statChg,Username,ExpandStat) {
	var val = Path+'?sid=' + Math.random()+'&onchguser='+statChg+'&userchg='+Username+'&expandstatus='+ExpandStat;
	sndReq16(val);
	return false;
}

var http17 = createRequestObject();
function sndReq17(action) {
    http17.open('get', action);
    http17.onreadystatechange = handleResponse17;
    http17.send(null);
}
function handleResponse17() {
    if(http17.readyState == 4){
		document.getElementById('BidAcceptedrides').innerHTML = http17.responseText;
    }
}
function acceptedRidesSearch(Path,Field,SortKey,Serflag,serParam,confirmationSer,lastnameSer,Page) {
	var chkStatSizeAccepted=document.getElementById('chkStatSizeAccepted').value;
	var val = Path+'?sid=' + Math.random()+'&sortfield='+Field+'&sortkey='+SortKey+'&serflag='+Serflag+'&serparam='+serParam+'&confirmationser='+confirmationSer+'&lastnameser='+lastnameSer+'&p='+Page+'&expandstatus='+chkStatSizeAccepted;
	sndReq17(val);
	return false;
}

var http18 = createRequestObject();
function sndReq18(action) {
    http18.open('get', action);
    http18.onreadystatechange = handleResponse18;
    http18.send(null);
}
function handleResponse18() {
    if(http18.readyState == 4){
		document.getElementById('BidPastrides').innerHTML = http18.responseText;
		$("#datefrom").datepicker();
		$("#dateto").datepicker();
    }
}
function vendorPastbids(Path,statChg,Username,ExpandStat) {
	var val = Path+'?sid=' + Math.random()+'&onchguser='+statChg+'&userchg='+Username+'&expandstatus='+ExpandStat;
	sndReq18(val);
	return false;
}

var http19 = createRequestObject();
function sndReq19(action) {
    http19.open('get', action);
    http19.onreadystatechange = handleResponse19;
    http19.send(null);
}
function handleResponse19() {
    if(http19.readyState == 4){
		document.getElementById('BidPastrides').innerHTML = http19.responseText;
		$("#datefrom").datepicker();
		$("#dateto").datepicker();
    }
}
function pastRidesSearch(Path,Field,SortKey,Serflag,serParam,confirmationSer,lastnameSer,Page,dateFrom,dateTo) {
	var chkStatSizePast=document.getElementById('chkStatSizePast').value;
	var val = Path+'?sid=' + Math.random()+'&sortfield='+Field+'&sortkey='+SortKey+'&serflag='+Serflag+'&serparam='+serParam+'&confirmationser='+confirmationSer+'&lastnameser='+lastnameSer+'&p='+Page+'&datefrom='+dateFrom+'&dateto='+dateTo+'&expandstatus='+chkStatSizePast;
	sndReq19(val);
	return false;
}
var http20 = createRequestObject();
function sndReq20(action) {
    http20.open('get', action);
    http20.onreadystatechange = handleResponse20;
    http20.send(null);
}
function handleResponse20() {
    if(http20.readyState == 4){
		document.getElementById('BidNewrides').innerHTML = http20.responseText;
		var CountForTooltip=document.getElementById('CountNoForTooltip').value;
		//alert(CountForTooltip);
		for(var CntForTooltip=1;CntForTooltip<=CountForTooltip;CntForTooltip++)
		{
			//alert(CntForTooltip);
			var idTooltip="#ToLabel"+CntForTooltip;
			//alert(idTooltip);
			$(idTooltip).qtip({
		 content: {
		   text:'We are sorry but Quick Bid is not available for this ride because you do not have a vehicle listed in Your Fleet that matches the type requested for this ride. You may still click on the ride details to use the regular bid functionality. Please update the information in Your Fleet under the Account menu if you do have a vehicle of the requested type.'
		  },
		  show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
		  position: {
			corner: {
			 target: 'upperRight',
			  tooltip: 'bottomRight'
					}
		   },
		   style: { 
			border: {
			 width: 2,
			  radius: 5
			},
			padding: 10, 
			textAlign: 'left',
			name: 'cream',
			tip: true
		   }
		});
			
		}
		var idTooltip="#ToLabelQuery";
		//alert(idTooltip);
		$(idTooltip).qtip({
		content: {
		text:"The optional bid floor let's you set the minimum price you would be willing to accept for this ride. If another vendor bids lower than you, the SecuredBid&trade; system will automatically lower your bid in small decrements to keep you competitive.  You may revise your bid-floor lower at any time after placing the initial bid."
		},
		show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
		position: {
		corner: {
		target: 'upperRight',
		tooltip: 'bottomRight'
		}
		},
		style: { 
		border: {
		width: 2,
		radius: 5
		},
		padding: 10, 
		textAlign: 'left',
		name: 'cream',
		tip: true
		}
		});
    }
}
function vendorSernewrides(Path,serFlag,zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,Page,Serflag,sortField,sortKey,vendorVehicleSer,Stat) {
	var chkStatSize=document.getElementById('chkStatSizeNew').value;
	//alert(chkStatSize);
	var val = Path+'?sid=' + Math.random()+'&serparam='+serFlag+'&zipcodeser='+zipcodeSer+'&dateser='+dateSer+'&airportcodeser='+airportcodeSer+'&pointtopointser='+pointtopointSer+'&hourlyser='+hourlySer+'&cityser='+citySer+'&timeser='+timeSer+'&p='+Page+'&serflag='+Serflag+'&sortfield='+sortField+'&sortkey='+sortKey+'&vendor_vehicle_ser='+vendorVehicleSer+'&expandstatus='+chkStatSize;
	sndReq20(val);
	return false;
}



var http21 = createRequestObject();
function sndReq21(action) {
    http21.open('get', action);
    http21.onreadystatechange = handleResponse21;
    http21.send(null);
}
function handleResponse21() {
    if(http21.readyState == 4){
		document.getElementById('BidSearchrides').innerHTML = http21.responseText;
		$("#date").datepicker();
    }
}
function vendorSearch(Path,statChg,Username,ExpandStat) {
	var val = Path+'?sid=' + Math.random()+'&onchguser='+statChg+'&userchg='+Username+'&expandstatus='+ExpandStat;
	sndReq21(val);
	return false;
}

var http22 = createRequestObject();
function sndReq22(action) {
    http22.open('get', action);
    http22.onreadystatechange = handleResponse22;
    http22.send(null);
}
function handleResponse22() {
    if(http22.readyState == 4){
		document.getElementById('BidOpenrides').innerHTML = http22.responseText;
		var cntDisableOpen=document.getElementById('cntDisableOpen').value;
			//alert(CountForTooltip);
			for(var CntForTooltip=1;CntForTooltip<=cntDisableOpen;CntForTooltip++)
			{
				//alert(CntForTooltip);
				var idTooltip="#ToLabel2"+CntForTooltip;
				//alert(idTooltip);
				$(idTooltip).qtip({
				content: {
				text:'We are sorry but Quick Bid is not available for this ride because you do not have a vehicle listed in Your Fleet that matches the type requested for this ride. You may still click on the ride details to use the regular bid functionality. Please update the information in Your Fleet under the Account menu if you do have a vehicle of the requested type.'
				},
				show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
				position: {
				corner: {
				target: 'upperRight',
				tooltip: 'bottomRight'
				}
				},
				style: { 
				border: {
				width: 2,
				radius: 5
				},
				padding: 10, 
				textAlign: 'left',
				name: 'cream',
				tip: true
				}
				});
				
			}
			var idTooltip="#ToLabelOpenQuery";
			//alert(idTooltip);
			$(idTooltip).qtip({
			content: {
			text:"The optional bid floor let's you set the minimum price you would be willing to accept for this ride. If another vendor bids lower than you, the SecuredBid&trade; system will automatically lower your bid in small decrements to keep you competitive.  You may revise your bid-floor lower at any time after placing the initial bid."
			},
			show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
			position: {
			corner: {
			target: 'upperRight',
			tooltip: 'bottomRight'
			}
			},
			style: { 
			border: {
			width: 2,
			radius: 5
			},
			padding: 10, 
			textAlign: 'left',
			name: 'cream',
			tip: true
			}
			});
    }
}
function vendorSeropenrides(Path,serFlag,zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,Page,Serflag,sortField,sortKey,vendorVehicleSer,Stat) {
	var chkStatSizeOpen=document.getElementById('chkStatSizeOpen').value;
	var val = Path+'?sid=' + Math.random()+'&serparam='+serFlag+'&zipcodeser='+zipcodeSer+'&dateser='+dateSer+'&airportcodeser='+airportcodeSer+'&pointtopointser='+pointtopointSer+'&hourlyser='+hourlySer+'&cityser='+citySer+'&timeser='+timeSer+'&p='+Page+'&serflag='+Serflag+'&sortfield='+sortField+'&sortkey='+sortKey+'&vendor_vehicle_ser='+vendorVehicleSer+'&expandstatus='+chkStatSizeOpen;
	sndReq22(val);
	return false;
}

var http23 = createRequestObject();
function sndReq23(action) {
    http23.open('get', action);
    http23.onreadystatechange = handleResponse23;
    http23.send(null);
}
function handleResponse23() {
    if(http23.readyState == 4){
		document.getElementById('BidSearchrides').innerHTML = http23.responseText;
		$("#date").datepicker();
    }
}
function vendorSersearch(Path,serFlag,zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,confirmationSer,lastnameSer,newridesChk,openridesChk,acceptedChk,pastChk,vendorVehicleSer) {
	var val = Path+'?sid=' + Math.random()+'&serparam='+serFlag+'&zipcodeser='+zipcodeSer+'&dateser='+dateSer+'&airportcodeser='+airportcodeSer+'&pointtopointser='+pointtopointSer+'&hourlyser='+hourlySer+'&cityser='+citySer+'&timeser='+timeSer+'&confirmationser='+confirmationSer+'&lastnameser='+lastnameSer+'&newridesChk='+newridesChk+'&openridesChk='+openridesChk+'&acceptedChk='+acceptedChk+'&pastChk='+pastChk+'&vendor_vehicle_ser='+vendorVehicleSer;
	//showLoad(true,'loadingSearchNewOpenRide');	
	sndReq23(val);
	return false;
}

var http24 = createRequestObject();
function sndReq24(action) {
    http24.open('get', action);
    http24.onreadystatechange = handleResponse24;
    http24.send(null);
}
function handleResponse24() {
    if(http24.readyState == 4){
		document.getElementById('BidAcceptedrides').innerHTML = http24.responseText;
    }
}
function vendorSeraccepted(Path,serFlag,confirmationSer,lastnameSer,Page,Serflag,sortField,sortKey,Stat) {
	var chkStatSizeAccepted=document.getElementById('chkStatSizeAccepted').value;
	var val = Path+'?sid=' + Math.random()+'&serparam='+serFlag+'&confirmationser='+confirmationSer+'&lastnameser='+lastnameSer+'&p='+Page+'&serflag='+Serflag+'&sortfield='+sortField+'&sortkey='+sortKey+'&expandstatus='+chkStatSizeAccepted;
	sndReq24(val);
	return false;
}

var http25 = createRequestObject();
function sndReq25(action) {
    http25.open('get', action);
    http25.onreadystatechange = handleResponse25;
    http25.send(null);
}
function handleResponse25() {
    if(http25.readyState == 4){
		document.getElementById('BidPastrides').innerHTML = http25.responseText;
		$("#datefrom").datepicker();
		$("#dateto").datepicker();
    }
}
function vendorSerpast(Path,serFlag,confirmationSer,lastnameSer,Page,dateFrom,dateTo,Serflag,sortField,sortKey) {
	var chkStatSizePast=document.getElementById('chkStatSizePast').value;
	var val = Path+'?sid=' + Math.random()+'&serparam='+serFlag+'&confirmationser='+confirmationSer+'&lastnameser='+lastnameSer+'&p='+Page+'&datefrom='+dateFrom+'&dateto='+dateTo+'&serflag='+Serflag+'&sortfield='+sortField+'&sortkey='+sortKey+'&expandstatus='+chkStatSizePast;
	//alert(val);
	sndReq25(val);
	return false;
}

var http26 = createRequestObject();
function sndReq26(action) {
    http26.open('get', action);
    http26.onreadystatechange = handleResponse26;
    http26.send(null);
}
function handleResponse26() {
    if(http26.readyState == 4){
		document.getElementById('BidPastrides').innerHTML = http26.responseText;
		$("#datefrom").datepicker();
		$("#dateto").datepicker();
    }
}
function vendorSerpastInner(Path,serFlag,dateFrom,dateTo) {
	var chkStatSizePast=document.getElementById('chkStatSizePast').value;
	if(chkStatSizePast=="1")
	{
		chkStatSizePast="0";
	}
	else
	{
		chkStatSizePast=chkStatSizePast;
	}
	var val = Path+'?sid=' + Math.random()+'&serparam='+serFlag+'&datefrom='+dateFrom+'&dateto='+dateTo+'&expandstatus='+chkStatSizePast;
	//alert(val);
	showLoad(true,'loadingPastRideSearch');
	sndReq26(val);
	return false;
}


var http27 = createRequestObject();
function sndReq27(action) {
    http27.open('get', action);
    http27.onreadystatechange = handleResponse27;
    http27.send(null);
}
function handleResponse27() {
    if(http27.readyState == 4){
		var chkStatSizeNew=document.getElementById('chkStatSizeNew').value;
		document.getElementById('BidOpenrides').innerHTML = http27.responseText;
		vendorBidnewrides('ajax/vendor_ride_summary_newbid.php',chkStatSizeNew);
		var cntDisableOpen=document.getElementById('cntDisableOpen').value;
			//alert(CountForTooltip);
			for(var CntForTooltip=1;CntForTooltip<=cntDisableOpen;CntForTooltip++)
			{
				//alert(CntForTooltip);
				var idTooltip="#ToLabel2"+CntForTooltip;
				//alert(idTooltip);
				$(idTooltip).qtip({
				content: {
				text:'We are sorry but Quick Bid is not available for this ride because you do not have a vehicle listed in Your Fleet that matches the type requested for this ride. You may still click on the ride details to use the regular bid functionality. Please update the information in Your Fleet under the Account menu if you do have a vehicle of the requested type.'
				},
				show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
				position: {
				corner: {
				target: 'upperRight',
				tooltip: 'bottomRight'
				}
				},
				style: { 
				border: {
				width: 2,
				radius: 5
				},
				padding: 10, 
				textAlign: 'left',
				name: 'cream',
				tip: true
				}
				});
				
			}
			var idTooltip="#ToLabelQuery";
			//alert(idTooltip);
			$(idTooltip).qtip({
			content: {
			text:"The optional bid floor let's you set the minimum price you would be willing to accept for this ride. If another vendor bids lower than you, the SecuredBid&trade; system will automatically lower your bid in small decrements to keep you competitive.  You may revise your bid-floor lower at any time after placing the initial bid."
			},
			show: { 
				when: 'mouseover', 
				solo: false // Only show one tooltip at a time
				},
				hide: {
                    when: 'mouseout',
                    effect: { type: 'fade', length: 0 },
                    fixed: true
                },
			position: {
			corner: {
			target: 'upperRight',
			tooltip: 'bottomRight'
			}
			},
			style: { 
			border: {
			width: 2,
			radius: 5
			},
			padding: 10, 
			textAlign: 'left',
			name: 'cream',
			tip: true
			}
			});
    }
	
}

function vendorOpenbiddelete(Path,BidNo,flagDel,Page) {
	var chkStatSizeOpen=document.getElementById('chkStatSizeOpen').value;
	var val = Path+'?sid=' + Math.random()+ '&opendelflag='+flagDel+'&delbidno='+BidNo+'&p='+Page+'&expandstatus='+chkStatSizeOpen;
	showLoad(true,'loadingDeleteOpenBids');
	sndReq27(val);
	return false;
}

var http28 = createRequestObject();
function sndReq28(action) {
    http28.open('get', action);
    http28.onreadystatechange = handleResponse28;
    http28.send(null);
}
function handleResponse28() {
    if(http28.readyState == 4){
		document.getElementById('AutorefExpand').innerHTML = http28.responseText;
    }
	
}

function vendorRefexpand(Path) {
	var val = Path+'?sid=' + Math.random();
	sndReq29(val);
	return false;
}

var http29 = createRequestObject();
function sndReq29(action) {
    http29.open('get', action);
    http29.onreadystatechange = handleResponse29;
    http29.send(null);
}
function handleResponse29() {
    if(http29.readyState == 4){
		document.getElementById('AutorefExpand').innerHTML = http29.responseText;
    }
	
}

function vendorOpenDet(Path,TxnNo) {
	var val = Path+'?sid=' + Math.random()+'&TxnNo='+TxnNo;
	sndReq30(val);
	return false;
}

var http30 = createRequestObject();
function sndReq30(action) {
    http30.open('get', action);
    http30.onreadystatechange = handleResponse30;
    http30.send(null);
}
function handleResponse30() {
    if(http30.readyState == 4){
		document.getElementById('VendorrideDet').innerHTML = http30.responseText;
    }
	
}

function vendorOpenDetSer(Path,SortFlg,SortType,SerFlag,TxnNo) {
	var val = Path+'?sid=' + Math.random()+'&sortflag='+SortFlg+'&sorttype='+SortType+'&serflag='+SerFlag+'&TxnNo='+TxnNo;
	sndReq31(val);
	return false;
}

var http31 = createRequestObject();
function sndReq31(action) {
    http31.open('get', action);
    http31.onreadystatechange = handleResponse31;
    http31.send(null);
}
function handleResponse31() {
    if(http31.readyState == 4){
		document.getElementById('VendorrideDet').innerHTML = http31.responseText;
    }
	
}


function vendorServiceAddNoti(Path,NotificStr,Addnotific,AirportPostal,CheckallCnt,Serpost,idServiceRadRest,baseSelection) {
	if(document.getElementById('check1'+CheckallCnt).checked==true)
	{
		var checkUpd="1";
	}
	else
	{
		var checkUpd="0";
	}
	var val = Path+'?sid=' + Math.random()+'&notificstr='+NotificStr+'&addnotific='+Addnotific+'&airpostal='+AirportPostal+'&chkupdnot='+checkUpd+'&serpost='+Serpost+'&idServiceRadRest='+idServiceRadRest+'&baseselection='+baseSelection;
	showLoad(true,'loadingNotify');
	sndReq32(val);
	return false;
}
var http32 = createRequestObject();
function sndReq32(action) {
    http32.open('get', action);
    http32.onreadystatechange = handleResponse32;
    http32.send(null);
}
function handleResponse32() {
    if(http32.readyState == 4){
		document.getElementById('ServiceAreas').innerHTML = http32.responseText;
		//vendorServiceSer('ajax/service_areas_add_search_mainbody.php','1');
    }
	
}


var http33 = createRequestObject();
function sndReq33(action) {
    http33.open('get', action);
    http33.onreadystatechange = handleResponse33;
    http33.send(null);
}
function handleResponse33() {
    if(http33.readyState == 4){
		document.getElementById('ServiceAreas').innerHTML = http33.responseText;
		//vendorServiceSer('ajax/service_areas_add_search_mainbody.php');
    }
}
function vendorPastbidsClr(Path,statChg,Username,ExpandStat,Clr) {
	var val = Path+'?sid=' + Math.random()+'&onchguser='+statChg+'&userchg='+Username+'&expandstatus='+ExpandStat+'&clear='+Clr;
	sndReq33(val);
	return false;
}

function vendorServiceAddNoti1(Path,NotificStr,Addnotific,AirportPostal,CheckallCnt,Serpost,idServiceRadRest,baseSelection) {
	if(document.getElementById('check1'+CheckallCnt).checked==true)
	{
		var checkUpd="1";
	}
	else
	{
		var checkUpd="0";
	}
	var val = Path+'?sid=' + Math.random()+'&notificstr='+NotificStr+'&addnotific='+Addnotific+'&airpostal='+AirportPostal+'&chkupdnot='+checkUpd+'&serpost='+Serpost+'&idServiceRadRest='+idServiceRadRest+'&baseselection='+baseSelection;
	showLoad(true,'loadingNotify');
	sndReq34(val);
	return false;
}
var http34 = createRequestObject();
function sndReq34(action) {
    http34.open('get', action);
    http34.onreadystatechange = handleResponse34;
    http34.send(null);
}
function handleResponse34() {
    if(http34.readyState == 4){
		document.getElementById('ServiceAreas').innerHTML = http34.responseText;
		vendorServiceSer('ajax/service_areas_add_search_mainbody.php','1');
    }
	
}

function vendorServiceCheckAll(Path,basePostal,checkAll,Addnotific,idServiceRadRest) {
	if(document.getElementById('allnone').checked==true)
	{
		var checkAllUpd="1";
	}
	else
	{
		var checkAllUpd="0";
	}
	var val = Path+'?sid=' + Math.random()+'&basepostal='+basePostal+'&checkall='+checkAll+'&addnotific='+Addnotific+'&checkallupd='+checkAllUpd+'&airpostal='+idServiceRadRest;
	//alert(val);
	showLoad(true,'loadingNotify');
	sndReq35(val);
	return false;
}
var http35 = createRequestObject();
function sndReq35(action) {
    http35.open('get', action);
    http35.onreadystatechange = handleResponse35;
    http35.send(null);
}
function handleResponse35() {
    if(http35.readyState == 4){
		document.getElementById('ServiceAreas').innerHTML = http35.responseText;
		//vendorServiceSer('ajax/service_areas_add_search_mainbody.php','1');
    }
	
}


function autoRefresh(Path,refFlag,userstatChg,Username) {
	if(refFlag==1)
	{
		var refreshFlag="1";
	}
	else if(refFlag==0)
	{
		var refreshFlag="0";
	}
	
	else if(refFlag==true)
	{
		var refreshFlag="1";
		//var showtime =setInterval("test('test_autoref.php','autoref')",5000);  
	}
	else
	{
		var refreshFlag="0";
	}
	var val = Path+'?sid=' + Math.random()+'&refreshflag='+refreshFlag+'&onchguser='+userstatChg+'&userchg='+Username;
	showLoad(true,'loadingAutoRefresh');
	sndReq29(val);
	return false;
}
function autoRefreshJen(serPath,newPath,openPath,acceptedPath,pastPath,refexpPath,refFlag,userstatChg,Username4,autoDuration)
{
	//alert(document.getElementById('autorefresh_5').checked);
	if(refFlag==true)
	{
		
		var reflag="1";
		//setInterval("test('test_autoref.php','autoref')",5000);
		var Username5=document.getElementById('userChgstat').value;
		
		
		showtime = setInterval("change('"+serPath+"','"+newPath+"','"+openPath+"','"+acceptedPath+"','"+pastPath+"','"+refexpPath+"','"+reflag+"','"+userstatChg+"','"+Username5+"')", autoDuration);
	}
	else
	{
		
		var Username5=document.getElementById('userChgstat').value;
		var reFlag="0";
		clearInterval(showtime);
		autoRefresh(refexpPath,reFlag,userstatChg,Username5);
	}
}
function vendorUserActive(Path,UserId,ChgToActive,Cnt,Role) {
	var chkusrActiveStat=document.getElementById('active'+Cnt).checked;
	if(chkusrActiveStat==true)
	{
		var chkusrActive='1';
	}
	else if(chkusrActiveStat==false)
	{
		var chkusrActive='0';
	}
	var val = Path +'?sid=' + Math.random()+'&subuserid='+UserId+'&chgtoactive='+ChgToActive+'&chkusractive='+chkusrActive+'&userRole='+Role; 
	showLoad(true,'loadingUserActive');
	sndReq33(val);
	return false;
}
var http33 = createRequestObject();
function sndReq33(action) {
    http33.open('get', action);
    http33.onreadystatechange = handleResponse33;
    http33.send(null);
}
function handleResponse33() {
    if(http33.readyState == 4){
		document.getElementById('CreateUser').innerHTML = http33.responseText;
    }
	
}

var http34 = createRequestObject();
function sndReq34(action) {
    http34.open('get', action);
    http34.onreadystatechange = handleResponse34;
    http34.send(null);
}
function handleResponse34() {
    if(http34.readyState == 4){
		document.getElementById('CancelVendorRide').innerHTML = http34.responseText;
		document.location.href='index.php';
    }
}
function cancelVendorRide(Path,TxnNo,cancelRide) {
	//var chkStatSizeAccepted=document.getElementById('chkStatSizeAccepted').value;
	var val = Path+'?sid=' + Math.random()+'&TxnNo='+TxnNo+'&cancelride='+cancelRide;
	//alert(val);
	sndReq34(val);
	return false;
}

function change(serPath,newPath,openPath,acceptedPath,pastPath,reexpandPath,reFlag,userstatChg,Username)
{
	//alert(Username);
	var Username6=document.getElementById('userChgstat').value;
	var chkStatSizeNew=document.getElementById('chkStatSizeNew').value;
	var chkStatSizeOpen=document.getElementById('chkStatSizeOpen').value;
	var chkStatSizeAccepted=document.getElementById('chkStatSizeAccepted').value;
	var chkStatSizePast=document.getElementById('chkStatSizePast').value;
	var chkStatSizeSearch=document.getElementById('chkStatSizeSearch').value;
	
	vendorSearch(serPath,userstatChg,Username6,chkStatSizeSearch);
	//alert(newPath);
	autoRefresh(reexpandPath,reFlag,userstatChg,Username6);
	vendorBidnewrides(newPath,chkStatSizeNew);
	vendorOpenbids(openPath,userstatChg,Username6,chkStatSizeOpen);
	vendorAcceptedbids(acceptedPath,userstatChg,Username6,chkStatSizeAccepted);
	//vendorPastbids(pastPath,userstatChg,Username6,chkStatSizePast);
}


function vendorMainbody(searchPath,newridesPath,openbidsPath) {
	var newridesChk="";
	var openridesChk="";
	var zipcodeSer=document.getElementById('zipcode').value;
	var dateSer=document.getElementById('date').value;
	var airportcodeSer=document.getElementById('airportcode').value;
	var vendorVehicleSer=document.getElementById('vendor_vehicle_ser').value;
	var pointtopointSer="";
	var hourlySer="";
	var citySer=document.getElementById('city').value;
	var timeSer=document.getElementById('time').value;
	
	if(document.getElementById('pointtopoint').checked==true)
	{
	  pointtopointSer="P"; 	  
	}
	if(document.getElementById('hourly').checked==true)
	{
	  hourlySer="H";	
	}
	if(document.getElementById('newrides').checked==true)
	{
	  newridesChk="1";	  
	}
	if(document.getElementById('openrides').checked==true)
	{
	  openridesChk="2";	  
	}
	
	showLoad(true,'loadingSearchNewOpenRide');
	  vendorSersearch(searchPath,'Search',zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,'','',newridesChk,openridesChk,'','',vendorVehicleSer);
	  if(document.getElementById('newrides').checked==true)
	  {
	    vendorSernewrides(newridesPath,'Search',zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,'','','','',vendorVehicleSer,'');
	  }
	if(document.getElementById('openrides').checked==true)
	{
	  vendorSeropenrides(openbidsPath,'Search',zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,'','','','',vendorVehicleSer,'');
	}
	return false;
}

function vendorMainbodyLasttwo(searchPath,acceptedridesPath,pastbidsPath) {
	
	var acceptedChk="";
	var pastChk="";
	var confirmationSer=document.getElementById('confirmation').value;
	var lastnameSer=document.getElementById('lastname').value;
	

	if(document.getElementById('acceptedrides').checked==true)
	{
	  acceptedChk="4";	  
	}
	if(document.getElementById('pastrides').checked==true)
	{
	  pastChk="5";	  
	}
	showLoad(true,'loadingSearchAccPastRide');
	  vendorSersearch(searchPath,'Search','','','','','','','',confirmationSer,lastnameSer,'','',acceptedChk,pastChk,'');
	  if(document.getElementById('acceptedrides').checked==true)
	  {
		vendorSeraccepted(acceptedridesPath,'Search',confirmationSer,lastnameSer,'','','','','');
	  }
	if(document.getElementById('pastrides').checked==true)
	{
	  vendorSerpast(pastbidsPath,'Search',confirmationSer,lastnameSer,'','','','','','');
	}
	return false;
}


function pagginationSummary(Path,detectBlock,Page,searchPath,Serflag,sortField,sortKey,Stat) {
	if(detectBlock=="newride")
	{
		var newridesChk="";
		var openridesChk="";
		var zipcodeSer=document.getElementById('zipcode').value;
		var dateSer=document.getElementById('date').value;
		var airportcodeSer=document.getElementById('airportcode').value;
		var pointtopointSer="";
		var hourlySer="";
		var citySer=document.getElementById('city').value;
		var timeSer=document.getElementById('time').value;
		
		if(document.getElementById('pointtopoint').checked==true)
		{
		  pointtopointSer="P"; 	  
		}
		if(document.getElementById('hourly').checked==true)
		{
		  hourlySer="H";	
		}
		if(document.getElementById('newrides').checked==true)
		{
		  newridesChk="1";	  
		}
		if(document.getElementById('openrides').checked==true)
		{
		  openridesChk="2";	  
		}
		//alert(zipcodeSer+','+dateSer+','+','+airportcodeSer+','+pointtopointSer+','+hourlySer+','+citySer+','+timeSer);
		if(zipcodeSer!='' && dateSer!='' && airportcodeSer!='' && pointtopointSer!='' && hourlySer!='' && citySer!='' && timeSer!='' && dateSer!='MM/DD/YYYY' && timeSer!='HH:MM:SS')
		{
		  vendorSersearch(searchPath,'Search',zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,'','',newridesChk,openridesChk,'','',''); 
		}
		  vendorSernewrides(Path,'Search',zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,Page,Serflag,sortField,sortKey,'','');
	}
	else if(detectBlock=="openride")
	{
		var newridesChk="";
		var openridesChk="";
		var zipcodeSer=document.getElementById('zipcode').value;
		var dateSer=document.getElementById('date').value;
		var airportcodeSer=document.getElementById('airportcode').value;
		var pointtopointSer="";
		var hourlySer="";
		var citySer=document.getElementById('city').value;
		var timeSer=document.getElementById('time').value;
		
		if(document.getElementById('pointtopoint').checked==true)
		{
		  pointtopointSer="P"; 	  
		}
		if(document.getElementById('hourly').checked==true)
		{
		  hourlySer="H";	
		}
		if(document.getElementById('newrides').checked==true)
		{
		  newridesChk="1";	  
		}
		if(document.getElementById('openrides').checked==true)
		{
		  openridesChk="2";	  
		}
		if(zipcodeSer!='' && dateSer!='' && airportcodeSer!='' && pointtopointSer!='' && hourlySer!='' && citySer!='' && timeSer!='' && dateSer!='MM/DD/YYYY' && timeSer!='HH:MM:SS')
		{
		  vendorSersearch(searchPath,'Search',zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,'','',newridesChk,openridesChk,'','','',''); 
		}
		  vendorSeropenrides(Path,'Search',zipcodeSer,dateSer,airportcodeSer,pointtopointSer,hourlySer,citySer,timeSer,Page,Serflag,sortField,sortKey,'',Stat);
	}
	else if(detectBlock=="acceptedride")
	{
		var acceptedChk="";
		var pastChk="";
		var confirmationSer=document.getElementById('confirmation').value;
		var lastnameSer=document.getElementById('lastname').value;
	
		if(document.getElementById('acceptedrides').checked==true)
		{
		  acceptedChk="4";	  
		}
		if(document.getElementById('pastrides').checked==true)
		{
		  pastChk="5";	  
		}
		if(confirmationSer!='' && lastnameSer!='' && acceptedChk!='' && pastChk!='')
		{
		  vendorSersearch(searchPath,'Search','','','','','','','',confirmationSer,lastnameSer,'','',acceptedChk,pastChk,'');
		}
		
		vendorSeraccepted(Path,'Search',confirmationSer,lastnameSer,Page,Serflag,sortField,sortKey);
	}
	else if(detectBlock=="pastride")
	{
		var acceptedChk="";
		var pastChk="";
		var confirmationSer=document.getElementById('confirmation').value;
		var lastnameSer=document.getElementById('lastname').value;
		var dateFrom=document.getElementById('datefrom').value;
	    var dateTo=document.getElementById('dateto').value;
	
		if(document.getElementById('acceptedrides').checked==true)
		{
		  acceptedChk="4";	  
		}
		if(document.getElementById('pastrides').checked==true)
		{
		  pastChk="5";	  
		}
		if(confirmationSer!='' && lastnameSer!='' && acceptedChk!='' && pastChk!='')
		{
		  vendorSersearch(searchPath,'Search','','','','','','','',confirmationSer,lastnameSer,'','',acceptedChk,pastChk,'');
		}
		
		vendorSerpast(Path,'Search',confirmationSer,lastnameSer,Page,dateFrom,dateTo,Serflag,sortField,sortKey);
	}
	
	return false;
}


function vendorPastSerLasttwo(Path,serFlag)
{
	var dateFrom=document.getElementById('datefrom').value;
	var dateTo=document.getElementById('dateto').value;
	if(dateFrom!='' && dateFrom!='MM/DD/YYYY' && dateTo!='' && dateTo!='MM/DD/YYYY')
		{
			vendorSerpastInner(Path,serFlag,dateFrom,dateTo);
		}
	
}


function allChangeByUser(serPath,openPath,acceptedPath,pastPath,reexpandPath,reFlag,statChg,Username)
{
	var chkStatSizeOpen=document.getElementById('chkStatSizeOpen').value;
	var chkStatSizeAccepted=document.getElementById('chkStatSizeAccepted').value;
	//var chkStatSizePast=document.getElementById('chkStatSizePast').value;
	//alert('aaaa');
	showLoad(true,'loadingOpenBids');	
	showLoad(true,'loadingAcceptedBids');	
	//vendorSearch(serPath,statChg,Username,'0');
	vendorOpenbids(openPath,statChg,Username,chkStatSizeOpen);
	vendorAcceptedbids(acceptedPath,statChg,Username,chkStatSizeAccepted);
	//vendorPastbids(pastPath,statChg,Username,'0');
	autoRefresh(reexpandPath,reFlag,statChg,Username);
	
}

function uploadfleetImage(uploadPath,userId,fileName)
{
	//alert(fileName);
	document.frmFleetInformation.submit();
	
}

function openWindow(url) {
  window.open(url,'popupWindow','resizable=no,scrollbars=yes,toolbar=no,status=no,height=650,width=720');
}
function CollapseExpand(Cid,Stat,PathNew,PathOpen,PathAccepted,PathPast,PathSer,statChg,Username)
{
	if(Cid=='openbids_hider')
	{
		if(Stat==2)
		{
			 vendorOpenbids(PathOpen,statChg,Username,Stat);
			 vendorBidnewrides(PathNew,'1');
			 vendorAcceptedbids(PathAccepted,statChg,Username,'1');
			 vendorPastbids(PathPast,statChg,Username,'1');
		 //document.getElementById(Cid).style.display='none';
		
		}
		else
		{
		  vendorOpenbids(PathOpen,statChg,Username,Stat);
		  //document.getElementById(Cid).style.display='none';
		  
		}
	}
	else if(Cid=='bidnew_hider')
	{
		if(Stat==2)
		{
			 vendorBidnewrides(PathNew,Stat);
		     vendorOpenbids(PathOpen,statChg,Username,'1');
			 vendorAcceptedbids(PathAccepted,statChg,Username,'1');
			 vendorPastbids(PathPast,statChg,Username,'1');
		
		}
		else
		{
		    vendorBidnewrides(PathNew,Stat);
		  //document.getElementById(Cid).style.display='none';
		  
		}
	}
	else if(Cid=='accepted_hider')
	{
		if(Stat==2)
		{
			 vendorAcceptedbids(PathAccepted,statChg,Username,Stat);
			 vendorBidnewrides(PathNew,'1');
			 vendorOpenbids(PathOpen,statChg,Username,'1');
			 vendorPastbids(PathPast,statChg,Username,'1');
		     //vendorOpenbids(PathOpen,statChg,Username,'1');
		
		}
		else
		{
		    vendorAcceptedbids(PathAccepted,statChg,Username,Stat);
		  //document.getElementById(Cid).style.display='none';
		  
		}
	}
	else if(Cid=='pastrides_hider')
	{
		if(Stat==2)
		{
			 vendorPastbids(PathPast,statChg,Username,Stat);
			 vendorBidnewrides(PathNew,'1');
			 vendorOpenbids(PathOpen,statChg,Username,'1');
			 vendorAcceptedbids(PathAccepted,statChg,Username,'1');
		     //vendorOpenbids(PathOpen,statChg,Username,'1');
		
		}
		else
		{
		    vendorPastbids(PathPast,statChg,Username,Stat);
		  //document.getElementById(Cid).style.display='none';
		  
		}
	}
	else if(Cid=='search_hider')
	{
		if(Stat==0)
		{
			 vendorSearch(PathSer,statChg,Username,Stat);
		     //vendorOpenbids(PathOpen,statChg,Username,'1');
		
		}
		else
		{
		    vendorSearch(PathSer,statChg,Username,Stat);
		  //document.getElementById(Cid).style.display='none';
		  
		}
	}
	else if(Cid=='expand_all')
	{
		if(Stat==0)
		{
			 vendorBidnewrides(PathNew,Stat);
		     vendorOpenbids(PathOpen,statChg,Username,Stat);
			 vendorAcceptedbids(PathAccepted,statChg,Username,Stat);
			 vendorPastbids(PathPast,statChg,Username,'1');
		     //vendorOpenbids(PathOpen,statChg,Username,'1');
		
		}
		else
		{
		    vendorBidnewrides(PathNew,'0');
		    vendorOpenbids(PathOpen,statChg,Username,'0');
			vendorAcceptedbids(PathAccepted,statChg,Username,'0');
			vendorPastbids(PathPast,statChg,Username,'1');
		  //document.getElementById(Cid).style.display='none';
		  
		}
	}
}

function vendorNewOpenInsBid(PathNewbid,PathOpenbid,BidInsert,TxnNo,BidNo,CntId,Page,Serflag,sortField,sortKey)
{
	if(BidInsert=='BidInsert' && BidNo=='')
	{
		//var chkStatSizeNew=document.getElementById('chkStatSizeNew').value;
		//alert('aaaa');
		vendorBidInsUpd(PathNewbid,BidInsert,TxnNo,'',CntId,Page,Serflag,sortField,sortKey);
		detectNewtoOpen=true;
		//alert(detectNewtoOpen);
		//vendorOpenbids(PathOpenbid,'','','0');
		//alert('bbbb');
	}
	else if(BidInsert=='BidInsert' && BidNo!='')
	{
		//var chkStatSizeOpen=document.getElementById('chkStatSizeOpen').value;
		vendorBidUpd(PathOpenbid,BidInsert,TxnNo,BidNo,CntId,Page,Serflag,sortField,sortKey);
		//vendorBidnewrides(PathNewbid,'0');
	}
}

function vendorOpendelNewbidShow(PathNewbid,PathOpenbid,BidNo,opendelflag,PageNo)
{
	vendorOpenbiddelete(PathOpenbid,BidNo,opendelflag,PageNo);
	//vendorBidnewrides(PathNewbid,'0');
}
function expandOrClose(arrow_id, list_num, list_name)  {
	var a = document.getElementById(arrow_id);
	if(a.name=='d') { 
		a.src='arrowRight.gif';
		a.name='r';
		hideSearchTypes(list_num,list_name);
	}
	else {
		a.src='arrowDown.gif';
		a.name='d';
		showSearchTypes(list_num,list_name);
	}
	return false;
}
function hideSearchTypes (i,j) { 
	var theDiv = document.getElementById(j).getElementsByTagName('li');
	for(var d = 1; d < theDiv.length; d++) {
		var theID = 'res-'+i+'-'+d;
		Effect.DropOut(theID);
	}
}	
function showSearchTypes (i,j) { 
	var theDiv = document.getElementById(j).getElementsByTagName('li');
	for(var d = 1; d < theDiv.length; d++) {
		var theID = 'res-'+i+'-'+d;
		
		Effect.Appear(theID);
	}
}

function trapEnter(e,Path,Zipcode)
{
	var unicode=e.charCode? e.charCode : e.keyCode;
	//alert('enter');
	if(unicode=='13')
	{
		vendorServiceInsUpd(Path,Zipcode);
		return false;
	}
	else
	{
		if (unicode!=8 && unicode!=13 && unicode != 118 && unicode != 46 && unicode != 9 && unicode!=39 && unicode!=37 && unicode!=38 && unicode!=40)
		{ //if the key isn't the backspace key (which we should allow)
			if (unicode<48 || unicode>57  ) //if not a number
			return false; //disable key press
			else if (unicode==45)
			return false;
			else 
			return true;
		}
	}
}

function trapEnterAirport(e,Path,Zipcode)
{
	var unicode=e.charCode? e.charCode : e.keyCode;
	//alert('enter');
	if(unicode=='13')
	{
		vendorServiceInsUpd(Path,Zipcode);
		return false;
	}
}

function trapName(id,fileList)
{
	var imgPathName=document.getElementById(id).value;
	var dispImageName="";
	//alert(imgPathName);
	//var imgPathNameRev=strrev( imgPathName )
	var imgFilenameSplit=imgPathName.split('\\');
	var getCount=0;
	for(var i=0;i<imgPathName.length;i++)
	{
		if(imgPathName.charAt(i)=="\\")
		{
			getCount++;
		}
	}
	if(imgFilenameSplit[getCount].length>24)
	{
	  dispImageName=imgFilenameSplit[getCount].substring(0,24);
	  dispImageName=dispImageName+'...';
	}
	else
	{
	  dispImageName=imgFilenameSplit[getCount];	
	}
	document.getElementById(fileList).innerHTML = dispImageName;
}

function _doFleetInfo()
{
	//alert('aaaa');
	if(document.getElementById('vehicle_type').value=='')
	  {
		document.getElementById('vehicle_type').style.borderColor='red';   
		return false;
	  }
	  if(document.getElementById('capacity').value=='' || document.getElementById('capacity').value=='Please Enter Capacity' || document.getElementById('capacity').value=='0')
	  {
		eval("document.getElementById('capacity').value = 'Please Enter Capacity'");
		eval("document.getElementById('capacity').style.color = 'red'");
		eval("document.getElementById('capacity').style.fontSize = '10px'");
		return false;
	  }
	  
	  return true;
}

/*VendorReviewDisplay*/
var http00000 = createRequestObject();
function sndReq00000(action) {
    http00000.open('get', action);
    http00000.onreadystatechange = handleResponse00000;
	http00000.send(null);
  
}
function handleResponse00000() {
    if(http00000.readyState == 4){
		document.getElementById('ajaxVendorReviewSummaryBody').innerHTML = http00000.responseText;
    }
	
}
function vendorReviewDisplay(VendorNo,TxnNo,orderBy,orderType) {
	var val = 'ajax/review_summary_mainbody.php?sid=' + Math.random() + '&DisplayVendor=DisplayVendor&VendorNo='+VendorNo+'&TxnNo='+TxnNo+'&orderBy='+orderBy+'&orderType='+orderType; 
	sndReq00000(val);
	return false;
}
/*==================*/
/*function testMultifile(a)
{
	alert('aaaa'+document.getElementById( 'carimage' ));
  var multi_selector = new MultiSelector( document.getElementById('files_list_fleet'), 1 );
  multi_selector.addElement( document.getElementById('carimage') );
}*/
