function checkIt(evt) {
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        status = "This field accepts numbers only."
        return false
    }
    status = ""
    return true
}


var noticeLinks = 7;
function getSizeNoticeBox() {
	if($('notice') && $('scrollIt')) {
		var e = $('notice');
		var els = e.getElementsByTagName('li');
		if(els.length > noticeLinks) {
			e.style.height = '177px';
			$('scrollIt').style.height = '146px';
			var sb = new ScrollBox('scrollIt');
		}
	}
}
function hideNoticeBox() {
	var e = $('notice');
	e.style.visibility = 'hidden';
}
function showNoticeBox() {
	var e = $('notice');
	if(e.style.visibility == 'visible') {
		e.style.visibility = 'hidden';
	} else {
		e.style.visibility = 'visible';
	}
}

function switchPrices(num) {
	var e = $('prix_refinance');
	if(num == 1) {
		$('block2').style.display = 'none';
		e.style.backgroundPosition = 'top left';
		$('block1').style.display = 'block';
	} else {
		$('block1').style.display = 'none';
		e.style.backgroundPosition = 'left -552px';
		$('block2').style.display = 'block';
	}
}

function calculatePrice() {
	var qty = $('items').value;
	if (  qty == '' ) qty = 1;
	else {
		if ( parseInt($('items').value) < 1 ) {
			$('items').value = 1;
			qty = parseInt($('items').value);
		}
	}
	qty = parseInt(qty);
	var calcNum = parseFloat($('prix').innerHTML)*qty;
	$('total').innerHTML = calcNum.toFixed(2);
}

var newWhich;
function showHideDropDown(status, which, that) {
	newWhich = (which==0)?1:0;
	if(status == 1) {
                if($('dropDown'+which)){
		if($('dropDown'+which).style.display == 'block') {
			$('dropDown'+which).style.display = 'none';
			that.style.background = 'transparent url("/images/fiche_produit_v3/tablist_bg.gif") no-repeat';
                        if($('anchor'+newWhich)){
			$('anchor'+newWhich).style.background = 'transparent url("/images/fiche_produit_v3/tablist_bg.gif") no-repeat';
                        }
		} else {
			that.style.background = 'transparent url("/images/fiche_produit_v3/tablist_bgOpen.gif") no-repeat';
			$('dropDown'+which).style.display = 'block';
		}
                }
		
	}
	if(which == 1) {
                if($('dropDown'+0)){
		$('dropDown'+0).style.display = 'none';
                }
	} else {
                if($('dropDown'+1)){
		$('dropDown'+1).style.display = 'none';
                }
	}
}

function openVue(url,width,height) {
	window.open(url,'popup','toolbar=0,location=0,directories=0, statusbar=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height);
}

window.onload = function() {
	getSizeNoticeBox();
}
function popup(url, alias, width, height,resize ) {
	//return;
	window.open(url,alias,'toolbar=0,location=0,directories=0, statusbar=0,menubar=0,scrollbars=0,resizable='+resize+',width='+width+',height='+height);
}