/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Varien
 * @package     js
 * @copyright   Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
function toggleMenu(el, over)
{
    if (over) {
        Element.addClassName(el, 'over');
    }
    else {
        Element.removeClassName(el, 'over');
    }
}
function region_id(value_id){
if (value_id) {
	custom_id = value_id.split(",");
	var region = custom_id[1];
} else {
	var region = $('shipping:region_id').getValue();
	if (region ==""){var region = $('billing:region_id').getValue();}
	}
	//alert(region);
if (region == 145 || region == 163 || region == 171 || region == 157 || region == 170)
	{ 
	$('msinfo_shipping_method').show();
	} else 
	{
	$('msinfo_shipping_method').hide();
	}

		if (region == 145 || region == 163 || region == 171 || region == 157 || region == 170)
		{
		//alert("cashon");
	
		// Contra reembolso
		if ($('p_method_cashondelivery')){
		$('p_method_cashondelivery').disabled = true;
		$('p_method_cashondelivery').checked = false;
		$('p_method_cashondelivery').next('label').addClassName('nodisponible');
		}
		
		//alert("servired");
		// Pago con tarjeta
		$('p_method_servired_standard').disabled = true;
		$('p_method_servired_standard').checked = false;
		$('p_method_servired_standard').next('label').addClassName('nodisponible');
		
			if(total<=150){
					$('p_method_checkmo').disabled = false;
					$('p_method_checkmo').checked = true;
			} else if(total>=150) {
				//$('p_method_checkmo').disabled = true;
				//$('p_method_checkmo').checked = false;
				//$('p_method_checkmo').next('label').addClassName('nodisponible');
				
				if ($('p_method_cashondelivery')){
				$('p_method_cashondelivery').disabled = true;
				$('p_method_cashondelivery').checked = false;
				$('p_method_cashondelivery').next('label').addClassName('nodisponible');
				}
			//$('msinfo_shipping_method').hide();
			}
		} else {
			if ($('p_method_cashondelivery')){
			$('p_method_cashondelivery').disabled = false;
			$('p_method_cashondelivery').checked = false;
			$('p_method_cashondelivery').next('label').removeClassName('nodisponible');
			}
			
			//alert("servired");
			// Pago con tarjeta
			$('p_method_servired_standard').disabled = false;
			$('p_method_servired_standard').checked = false;
			$('p_method_servired_standard').next('label').removeClassName('nodisponible');
			}
}

function promoDisableTransferPayment(){
	/*var region = $('billing:region_id').getValue();
	if (region != 145 || region != 163 || region != 171 || region != 157 || region != 170)
	{
	alert(region);
	$('p_method_checkmo').disabled = true;
	$('p_method_checkmo').checked = false;
	$('p_method_checkmo').next('label').addClassName('nodisponible');
	
	$('p_method_cashondelivery').disabled = true;
	$('p_method_cashondelivery').checked = false;
	$('p_method_cashondelivery').next('label').addClassName('nodisponible');
	}*/
}
