// JavaScript Document
//want $ to work with other libs
$.noConflict();
//function searchbox (){
	//$("#searchtxt").val(">");
//};

$(document).ready(existingbox);

function existingbox(){
	$(".existingbox, .existingboxright").equalizeCols(0);
};

$(document).ready(infobox);

function infobox(){
	$(".infobox").equalizeCols(0);
};

$(document).ready(cols);

function cols(){
	$(".innerinfo").equalizeCols(0);
};

$(document).ready(sidebar);

function sidebar(){
	$("#sidebar1,#innercontent, #sidebar2").equalizeCols(500);
};

function dropshadow(){
	$("div.dropshadow").wrap("<div class='wrap1'><div class='wrap2'>" +
   	"<div class='wrap3'></div></div></div>");
};
//used by filter drop down 
$(document).ready(filterRedirect);
function filterRedirect(){

	$('#filter').change(function(){

		document.location.href=document.location.href.split('?')[0] + '?filter=' + encodeURIComponent($('#filter option:selected').val());
	 //have to do this to stop the post back which occurs
	 //return false;
 });

};

//
$(document).ready(redirectToStockistsSearch);
function redirectToStockistsSearch(){
  $('#stockistSearch').click(function(){
	//if($('#location option:selected').val()!='' && $('#location option:selected').val()!='Please select filter'){
  	  document.location.href = $('#searchFormRedirect').val() + "?location=" + encodeURIComponent($('#location option:selected').val());
	//}
	//else{
	//	alert("Please select location");
	//}
     }
  );
}