function changeAction(){
// Dropdown Menu
var formaction = document.getElementById("pick")[document.getElementById("pick").selectedIndex].value; // get the value from the drop down menu

// Radio Buttons
/*        for (var i=0; i < document.getElementById("csearch").pick.length; i++){
if (document.getElementById("csearch").pick[i].checked){
var formaction = document.getElementById("csearch").pick[i].value; 
}
}    */ // loop through the radio buttons and find the value of the one selected

if(formaction == "mage"){
document.getElementById("csearchname").name = 'q';
document.getElementById("csearch").action = '/catalogsearch/result/'; // magento root (in a subfolder)
}
if(formaction == "wp"){
document.getElementById("csearchname").name = 's';
document.getElementById("csearch").action = '/news/'; // wordpress root
}
}
