// JavaScript Document
//want $ to work with other libs
jQuery.noConflict();
//function searchbox (){
	//$("#searchtxt").val(">");
//};

jQuery(document).ready(panels);

function panels(){
	jQuery("#panel1, #panel2, #panel3").equalizeCols(0);
};

jQuery(document).ready(existingbox);

function existingbox(){
	jQuery(".existingbox, .existingboxright").equalizeCols(0);
};

jQuery(document).ready(studybox);

function studybox(){
	jQuery(".studycontent").equalizeCols(0);
};

jQuery(document).ready(cols);

function cols(){
	jQuery(".innerinfo").equalizeCols(0);
};

$(document).ready(sidebar);

function sidebar(){
	jQuery("#sidebar1,#innercontainer").equalizeCols(500);
};

jQuery(document).ready(sidebar2);

function sidebar2(){
	jQuery("#innercontent, #sidebar2").equalizeCols(1);
};

function dropshadow(){
	jQuery("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(){

	jQuery('#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;
 });

};

//
jQuery(document).ready(redirectToStockistsSearch);
function redirectToStockistsSearch(){
  jQuery('#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");
	//}
     }
  );
}