function logout_control(item){
  if(confirm('You have '+item+' clips in your cart. Would you like to save cart for future review ?') == true){
    redirect_page('footage/bin/savecart.html');
    return false;
  }
  
  return true;
}

//////////////////////////////////////////////////////////////////////////////

function display_ext_search(){
  if(document.getElementById && document.getElementById('extsearch')){
    obj = document.getElementById('extsearch');
    obj.style.display = (obj.style.display == 'none') ? 'block' : 'none';
  }
  return false;
}

//////////////////////////////////////////////////////////////////////////////

function select_all(myForm, name){
  var selection = true;

  for (i = 0; i < myForm.elements.length; i++){
     if (myForm.elements[i].name==name){
       if(myForm.elements[i].checked == false)
         selection = myForm.elements[i].checked;
    }
  }

  for (i = 0; i < myForm.elements.length; i++){
    if (myForm.elements[i].name==name) myForm.elements[i].checked = !selection;
  }
  return false;
}

//////////////////////////////////////////////////////////////////////////////

function action_form(myForm, action){
  myForm.action.value = action;
  myForm.submit(); 
  return false;
}

//////////////////////////////////////////////////////////////////////////////

function jumpMenu(myForm, selObj) {
  myForm.action.value = 'change';
  myForm.id.value = selObj.options[selObj.selectedIndex].value;
  myForm.submit(); 
  return false;
}

//////////////////////////////////////////////////////////////////////////////

function redirect_page(url){
  if(url) window.location = 'http://'+location.host+'/'+url
  //alert('http://'+location.host+'/'+url);
}


//////////////////////////////////////////////////////////////////////////////

function checkout(id, path){
  obj = document.getElementById('accept'+id);
  
  if(obj.checked) document.location=path+'cart/checkout.html';
  else alert('Please, accept terms and conditions');
}

