function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

function showText(id) {	
	if (document.getElementById('name'+id)) {
		document.getElementById('name'+id).style.display = 'block';
	}						
	if (document.getElementById('intro'+id)) {
		document.getElementById('intro'+id).style.display = 'block';
	}					
	if (document.getElementById('content'+id)) {
		document.getElementById('content'+id).style.display = 'block';
	}					
}

function hideText(id) {					
	if (document.getElementById('name'+id)) {
		document.getElementById('name'+id).style.display = 'none';
	}		
	if (document.getElementById('intro'+id)) {
		document.getElementById('intro'+id).style.display = 'none';
	}					
	if (document.getElementById('content'+id)) {
		document.getElementById('content'+id).style.display = 'none';
	}					
}

function toogleQBasket() {
	var myform = document.getElementById("add-to-cart");
	if (myform.style.display === 'none') {
		myform.style.display = 'block';
	} else {
		myform.style.display = 'none';
	}
}	

function toogleBox(box) {
	var b = document.getElementById(box);
	var s = document.getElementById('billing_on');
	
	if (b) {
		if (b.style.display == 'block') {
			if (s) { s.checked = true; }
			if (b) { b.style.display = 'none'; }
		} else {
			if (s) { s.checked = false; }
			if (b) { b.style.display = 'block'; }
		}
	}
}
function myConfirm(delUrl, txt) {
	if (confirm(txt)) {
		document.location = delUrl;
	}
}
function myPopup(windowName, URL, width, height, scrolling) {
	width = width || 500;
	height = height || 460;
	scrolling = scrolling || 0;
	
	var topX = (window.screen.width / 2) - ( width / 2);
	var topY = (window.screen.height / 2) - ( height / 2);
	
	window.open(URL, windowName, 'width=' + width + ',height=' + height +
 ',location=no,resizable=yes,scrollbars=' + scrolling + 
',screenX=' + topX + ',screenY=' + topY);
}

