function zoomImageWindow(id) {
	window.open('/StoreFront/products/zoom.do?ref='+id,'zoomWindow','toolbar=no,location=no,status=no,menubar=no,resizable=no,width=450,height=450');
}

function popUp(src, locale, session, anchor) {

	anchor = typeof(anchor) != 'undefined' ? anchor : "none";

	
	if(session.length == 0)
		session = '00000000000000000000000000000000';
	if(src == 'contact' && locale != 'es')
		win =
			window.open('/StoreFront/popup/view.do?locale='+locale+'&content=faq','popUp','width=750,height=630,menubar=false,resizable=false,scrollbars=yes');
	else if(src == 'shopBelgium')
		win =
			window.open('/StoreFront/popup/view.do?locale='+locale+'&content=shop','popUp','width=750,height=630,menubar=false,resizable=false,scrollbars=yes');
	else
		win =
			window.open('/php/popup.php?sessionId='+session+'&locale='+locale+'&src='+src+'#'+anchor,'popUp','width=750,height=630,menubar=false,resizable=false,scrollbars=yes');
	win.focus();
}

function warnAboutIslands() {
	len = document.deliveryAddressForm.country.length;
	chosen = "";

	for (i = 0; i < len; i++) {
		if (document.deliveryAddressForm.country[i].selected) {
			chosen = chosen + document.deliveryAddressForm.country[i].value;
		}
	}

	for(i = 0; i < islandDeliveriesWarning.length; i++) {
		if(islandDeliveriesWarning[i] == chosen) {
			document.getElementById("countryWarning").style.display = 'block';
		}
	}
}

function SmartWin(src, locale, session) {
	var option = ',width=750,height=600';

	if(src == 'devis') {
		option = ",fullscreen=yes";
	}

	var win =
		window.open('/php/smart.php?sessionId='+session+'&locale='+locale+'&src='+src,'smartWin','menubar=false,resizable=yes,scrollbars=yes'+option);
}

function turnTabOn(img) {
	img.src = img.src.replace('Off\.gif', '.gif');
}

function turnTabOff(img) {
	img.src = img.src.replace('\.gif', 'Off.gif');
}

function ImgBox(Page,Dim) {
	Newwindow=window.open(Page,"Index",Dim);
}

function ouvstrack(locale) {
	fenetre=window.open("http://www.barracuda.be/exploi/s-track/"+locale+"-s-track-visi.php","Singletrack", "width=600,height=400,left=20,top=20")
}

function toggleHelp() {
	if(document.getElementById('help').style.display == 'block')
		document.getElementById('help').style.display = 'none';
	else
		document.getElementById('help').style.display = 'block';
}

function showSubmit() {
		document.getElementById('submit').style.display = 'block';
}

function preloadImages(locale) { 
	var path = '/images/'+locale+'/tabs/',
		files = new Array(path+'head.gif',
			path+'upperBody.gif',
			path+'lowerBody.gif',
			path+'miscellaneous.gif',
			path+'groups.gif',
			path+'frames.gif',
			path+'peripherals.gif',
			path+'wheels.gif',
			path+'accessories.gif',
			path+'brands.gif'
			),
		images = new Array();
	var i = 0;

	for(i=0; i<files.length; i++) {
		images[i] = new Image;
		images[i].src = files[i];
	}
}

