function cntChange() {
	var o = document.getElementById('id_cnt');
	var str = document.location.href;
	if (str.match(/(first\.php)/) || str.match(/(wizard\.php)/)) {
		strRedir = document.location.protocol+'//'+document.location.hostname+((document.location.port && document.location.port != '')? ':'+document.location.port : '' )+document.location.pathname.replace(/(first|wizard)\.php/, "")+'first.php?restart=1&id_cnt='+o.options[o.selectedIndex].value;
		document.location = strRedir;
		return false;
	} else {
		if (document.location.href.indexOf("?") != -1) {
			strRedir = document.location.href.replace(/(\?|&)id_cnt=[0-9]+/, '')+'?id_cnt='+o.options[o.selectedIndex].value;
		} else {
			strRedir = document.location.href.replace(/(\?|&)id_cnt=[0-9]+/, '')+'?id_cnt='+o.options[o.selectedIndex].value;
		}
		document.location = strRedir;
		return false;
	}
}

function openPrinter(url) {
	window.open(url, 'preview', "resizable=yes,scrollbars=no,location=no,width=190,height=190");
}

function openPrint(url) {
	window.open(url, 'beginPrint', "resizable=no,scrollbars=no,location=no,width=700,height=250,top=200,left=200");
}

function openHelpWindow(id_fea) {
	window.open('helpfeatures.php#'+id_fea, 'helpfeatures', "resizable=no,scrollbars=yes,location=no,width=700,height=600");
}

function submitForm() {
	var ckOption = 0;
	var els = document.forms['finishWizard'].elements;
	for (var i=0; i<els.length; i++) {
		if ((els[i].type == 'checkbox') && (els[i].checked == true)) {
			ckOption++;
		} 
	}
	if (ckOption>1) {
		document.forms.finishWizard.submit();
		return true;
	} else {
		alert(invalidSelection);
		return false;
	}
}

function submitSpecResultsForm() {
	var ckOption = 0;
	var els = document.forms['finishWizard'].elements;
	for (var i=0; i<els.length; i++) {
		if ((els[i].type == 'checkbox') && (els[i].checked == true)) {
			ckOption++;
		} 
	}
	if (ckOption>1) {
		document.forms['finishWizard'].submit();
		return true;
	} else {
		alert(strInvalidproductstocompare);
		return false;
	}
}

function OpenProductPage(idprod, link, place, idses){
	window.open("red_product.php?idprod=" + idprod + "&place=" + place + "&idses=" + idses + "&link=" + link, '', '');
	return false;
}

function changeBg(el, color, opacity) {
	Element.setOpacity(el, opacity);
	el.style.backgroundColor = color;
}
function bookmark(title, url) {
	title = 'WizAdvisor - Virtueller berater';
	url =  'http://www.wizadvisor.com';
	if(window.external && typeof window.external.addFavorite != 'undefined') {
		window.external.AddFavorite( url, title);
	} else if(window.sidebar) {
		window.sidebar.addPanel(title, url, '');
	} else if(window.opera && window.print) {
		alert('Use CTRL+D to Bookmark');
	}
}
function confirmDel(url) {
	result = window.confirm('Bist du sicher?');
	if(result) {
		location.href = url;
	}
}
var bookmarksOpen = false;
function showBookmarks() {
	if(bookmarksOpen) {
		closeBookmarks();
		return;
	}
	document.getElementById('bookmark').style.display = 'block';
	bookmarksOpen = true;
}
function closeBookmarks() {
	document.getElementById('bookmark').style.display = 'none';
	bookmarksOpen = false;
}