/**************************************************
 * select-menu.js
 **************************************************
 * select menu functionality
 * for bluemarblecreative.net
 **************************************************/

  var curr_selected = 0;
  var curr_state = 0;

  // open hidden layer
  function mtoggle(id) {
   if(curr_state) { // that means a menu is open
    if(curr_selected&&curr_selected!=id) { // that means a menu other than the one clicked is open and we need to close it, but still open the clicked one
     var theObj = document.getElementById(curr_selected+'-dd');
     theObj.className = 'close';
     theObj = document.getElementById(id+'-dd-'+container);
     theObj.className = 'open';
	 curr_selected = id;
     curr_state = 1;
	} else { // that means the current menu was open and needs to be closed
     var theObj = document.getElementById(id+'-dd-'+container);
     theObj.className = 'close';
     curr_state = 0;
	 curr_selected = id;
	}
   } else { // no menu was already open
    var theObj = document.getElementById(id+'-dd-'+container);
    theObj.className = 'open';
    curr_state = 1;
	curr_selected = id;
   }
  }
	 
function setFilter(type,target) {
	window.location = '/portfolio/'+type+'/'+target+'/';
}

function closeFilter() { 
 if(curr_selected&&curr_state) mtoggle(curr_selected);
};

