// *********************************************************************
// shop.js
// overall clientside functions
//
// (c) ITS-4-U
// *********************************************************************
var str_previousState = "";
var str_previousLayer = "";

function showhide(str_layer) {
	if(str_previousLayer == str_layer) {
		if(str_previousState == "block") changeDisplay(str_layer, "none");
		else changeDisplay(str_layer, "block");
	} else {
		if(str_previousLayer != "")	changeDisplay(str_previousLayer, "none");
		changeDisplay(str_layer, "block");
	}
	str_previousLayer = str_layer;
}

function changeDisplay(str_layer, str_display) {
	str_previousState = str_display;
	if (document.all) { 
		eval( "document.all." + str_layer + ".style.display = str_display");
		return;
	}
	if (document.layers) {
		document.layers[str_layer].display = str_display;
		return;
	}
	if (document.getElementById && !document.all) {
		document.getElementById(str_layer).style.display = str_display;
		return;
	}
}

function deleteArticle(int_id) {
	document.getElementById("quantity" + int_id).value = 0;
	document.getElementById("form1").submit();
}

function printNewWindow(str_url) {
	newWin = window.open(str_url,"webshop_print","width=700,height=475,status=no,toolbar=no,menubar=yes,scrollbars=1");
}

function ask() {
	return confirm("Weet u het zeker?");
}

function resizeContent() {
	var screenSize = getClientSize();
	document.getElementById("contentDiv").style.height = screenSize[1] - 150 + "px";
}

function resizeScreen() {
	window.moveTo 	(0,0);
	window.resizeTo (screen.availWidth, screen.availHeight);

//	for testing:
//	window.moveTo  ((screen.availWidth - 1024)/2 ,(screen.availHeight - 735)/2);
//	window.resizeTo(1024, 735);
}

function getClientSize() {
	var x = 0, y = 0;
	
	if(typeof(window.innerWidth) == 'number') {
		x = window.innerWidth;
		y = window.innerHeight;
	} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	} else if(document.body && ( document.body.clientWidth || document.body.clientHeight)) {
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	return Array(x, y);
}



