
function openPopup(x, y, adress, name) {
	
	var newopenPopup = window.open(adress, name, 'width=' + x + ', height=' + y + 'resizable=no, scrollbars=yes, menubar=no, location=no, status=no, screenX=1, screenY=1');
	newopenPopup.focus();
}

function openPopup1(x, y, adress, name) {
	
	var newopenPopup = window.open(adress, name, 'width=' + x + ', height=' + y + 'resizable=no, scrollbars=no, menubar=no, location=no, status=no, screenX=1, screenY=1');
	newopenPopup.focus();
}

function openPopup2(x, y, adress, name) {
	
	var newopenPopup = window.open(adress, name, 'width=' + x + ', height=' + y + 'resizable=yes, scrollbars=no, menubar=no, location=no, status=no, screenX=1, screenY=1');
	newopenPopup.focus();
}


function getBrowser()
{
	var browserName = navigator.appName; 
	if (browserName == "Netscape")
		return "mozilla";
	else 
	if (browserName == "Microsoft Internet Explorer")
		return "ie";
	else
		return "other";
}

function closePage(page)
{
	win=window.opener;
	win.document.location.href = page;
	window.close();
	win.focus();
}

function doFormFocus(obj) {
	if (obj.value == obj.defaultValue) 
		obj.value = '';
}

function doFormBlur(obj) {
	if (obj.value == '') obj.value = obj.defaultValue;
}


// shopping kart
function checkAll(form, kartCnt)
{
	for (i = 0; i < kartCnt; i++) {
		var x = document.getElementById('id' + i);
		x.checked = form.selall.checked;
	}
}


function doTotalPrice(form, kartCnt)
{
	var total = 0;
	
	for (i = 0; i < kartCnt; i++) {
		var price = eval('form.price' + i);
		var qty = eval('form.qty' + i);
		var totalPrice = eval('form.total_price' + i);
		alert(price.value);
		totalPrice.value = parseInt(qty.value) * parseInt(price.value);
		total += parseInt(qty.value) * parseInt(price.value);
	}
	
	form.total.value = total;
}


var cnt = 0;
var refreshKartElements = new Array();
refreshKartElements[cnt] = new Array();
refreshKartElements[cnt]['element'] = 'kartinfo';
refreshKartElements[cnt]['url'] = 'kart.php?op=x';

