<!--

var Xpos = 0;
var Ypos = 0;

var PicOrgWidth;
var PicOrgHeight;
var PicScaleWidth;
var PicScaleHeight;
var PicOrgScale;

function GetImgWidth() {
	var oImage = new Image();
	oImage.src = document.images.picture.src;
	PicOrgWidth = oImage.width;
	PicOrgHeight = oImage.height;
	
	PicOrgScale = 1;
	
	ResizeImg();
	
}

function ResizeImg() {
	if (PicOrgScale == 1) {
		if (PicOrgWidth > 650) {
			PicScaleWidth = 650 / PicOrgWidth;
			document.images.picture.width = 650;
			document.images.picture.height = PicOrgHeight * PicScaleWidth;
			
			if (document.images.picture.height > 590) {
				PicScaleHeight = 590 / PicOrgHeight;
				
				document.images.picture.width = PicOrgWidth * PicScaleHeight;
				document.images.picture.height = 590;
				
			}
			
		}
		
		PicOrgScale = 0;
		
		ResizeWindow();
		
	} else {
		document.images.picture.width = PicOrgWidth;
		document.images.picture.height = PicOrgHeight;
		
		PicOrgScale = 1;
		
		ResizeWindow();
		
	}
	
}


function ShowBigPicture(strProdCode) {
	var oPopUp = window.open("index.php?module=sklep&op=pic&pid="+strProdCode,'', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,fullscreen=no,width=700,height=650,top=20,left=20');

}

function Show3DPicture(strProdCode) {
	var oPopUp = window.open("index.php?module=sklep&op=pic&pid="+strProdCode,'', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,fullscreen=no,width=250,height=250,top=20,left=20');

}

function ShowURL(strURL, strWIDTH, strHEIGHT) {
	var oPopUp = window.open(strURL,'', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,fullscreen=no,width='+strWIDTH+',height='+strHEIGHT+'');
}

function ResizeWindow() {
	var picWidth = document.images.picture.width;
	var picHeight = document.images.picture.height;
	var scrNewWidth;
	var scrNewHeight;
	
	if (picWidth >= screen.width) {
		scrNewWidth = screen.width - 100;
		
	} else {
		scrNewWidth = picWidth + 25;
		
	}
	
	if (picHeight >= screen.height) {
		//scrNewWidth = screen.height - 100;
		scrNewHeight = screen.height - 100;
	} else {
		//scrNewHeight = picHeight + 55;
		scrNewHeight = picHeight + 55;
	}
	
	window.resizeTo(scrNewWidth,scrNewHeight);
	
}

function addBookmark(title,url) {
    if (window.sidebar) { 
	window.sidebar.addPanel(title, url,""); 
    } else if( document.all ) {
	window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ) {
	return true;
    }
}

function setCursor(id, name) {
   document.getElementById(id).style.cursor=name;
   return true;
}

function mouseXY(evt) {
	if (evt.pageX) Xpos = evt.pageX; //return evt.pageX;
	else if (evt.clientX)
		//return evt.clientX + (document.documentElement.scrollLeft ?
		Xpos = evt.clientX + (document.documentElement.scrollLeft ?
			document.documentElement.scrollLeft :
			document.body.scrollLeft);
	else Xpos = 0;//return null;

	if (evt.pageY) Ypos = evt.pageY; //return evt.pageY;
	else if (evt.clientY)
		//return evt.clientY + (document.documentElement.scrollTop ?
		Ypos = evt.clientY + (document.documentElement.scrollTop ?
		document.documentElement.scrollTop :
		document.body.scrollTop);
	else Ypos = 0; //return null;

}
	

function ShowHELP(id) {
	
	if (document.getElementById(id).style.display == "block") {
		document.getElementById(id).style.display = "none";
	} else {
		//document.getElementById(id).style.top = Ypos;
		//document.getElementById(id).style.left = Xpos;
		document.getElementById(id).style.display = "block";

	}
	//alert(Xpos+":"+Ypos);
}

function CheckCart() {

}

function dateToISO(date) {
	var year = date.getFullYear();
	var month = date.getMonth() + 1;
	var day = date.getDate();
	if (month < 10) month = "0" + month;
	if (day < 10) day = "0" + day;
	return year + "-" + month + "-" + day;
}

function rand(n) {
	return (Math.floor( Math.random() * n + 1 ));

}

function BrowserOpen(field, ptype) {
	my_field = field;
	
	if (!ptype) ptype = '';
	
	window.open("include/file_manager.php?type=bannery&fmode=1&ptype="+ptype+"&field="+field, "file_manager", "width=600,height=600,scrollbars=yes,resizable=yes");
	
}
-->
