//#quote page
//#sets cookie from branchid in querystring (value of -1 to clear)
//#retrives branchid from querystring or cookie and replaces the dropdown with a hidden field

function overridebranchid(){
	$(document).ready(function(){
	var qid=$.query.get('branchid'); 
	if(qid!='')
		{
        	if(qid==-1)
			{$.cookie("branchid", null);}//clear the cookie
		else
			{
        		$.cookie("branchid", qid); 
			$("BranchID").val(qid);
			}
        	}
	else
		{
		var cookieval = $.cookie("branchid");
		if(cookieval!=null)
   			{$('[name=BranchID]').val(cookieval);}

		}


	});
}

//#home page
//#sets cookie from branchid in querystring (value of -1 to clear)

function writebranchidCookie(){
	$(document).ready(function(){
	var qid=$.query.get('branchid'); 
	if(qid!='')
		{
        	if(qid==-1)
			{$.cookie("branchid", null);}//clear the cookie
		else
			{$.cookie("branchid", qid);}
        	}
	});

}
