
function getPositionTop(This){
	var el = This;
	var pT = 0;

	pT+=el.offsetTop;
	el=el.offsetParent;
	return pT*1;
}

function detectScreen() {
	windowWidth = document.width;
	windowWidth = document.body.offsetWidth;

	if (windowWidth > 1200)
	{
		document.getElementById('pLeft').style.display = 'block';
	//	document.getElementById('pRight').style.display = 'block';
		document.getElementById('pArea').className = 'pArea1200';
	}
	else {
		document.getElementById('pLeft').style.display = 'none';
	//	document.getElementById('pRight').style.display = 'none';
		document.getElementById('pArea').className = 'pArea1200u';
	}
	var wert = document.getElementById('aFooter2').offsetTop;
//	document.getElementById('mbru').style.marginTop = (wert-226) + "px";

	setTimeout('detectScreen()', 1000);
}

function search () {
	document.location.href = '/szukaj/index.html?qS=' + document.getElementById('sBox').value;
}

function popUp (url, width, height) {
	var nwindows = window.open(url,"popWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no' );

}

function viewPopup(element, width, height) {
	url = element.href;

	popUp (url, width, height);
	wer = element.href;
	if (wer.substr(0,1) == "j")
	{
	}
	else {
		element.href = 'javascript:popUp(\'' + url + '\', ' + width + ', ' + height + ');';
	}
}

function getProductRow (row, container) {
//	alert(container);
	document.getElementById(container).innerHTML = '<div style="height: 200px;"><div align="center" style="margin-top: 90px;"><div id="formWait"><p style="color: #000;"><img src="/i/refresh.gif" align="absmiddle"> Trwa pobieranie danych, proszę czekać ...</p></div></div></div>';
	advAJAX.get({
    url: "/productRow.php?row="+row,
    timeout : 5000,
    onTimeout : function() {  },
    retry: 2,
    retryDelay: 2000,
    onRetry : function() {  },
    onRetryDelay : function() {  },
    onSuccess : function(obj) { document.getElementById(container).innerHTML = unescape(obj.responseText); },
    onError : function(obj) { alert("Error: " + obj.status); }
});
}

function insertFlash (flashfile, container, link, text, photo, nowosci, ikonki, nazwa,query_str){

		var so = new SWFObject(flashfile +"?" +query_str, "tit{{$collection.col_id}}", "180", "190", "6", "#ffffff");
			so.addVariable("quality", "high");
			so.addParam("wmode", "transparent");
			so.addParam("txtLabels", nazwa);
			so.addParam("ikonki", ikonki);
			so.addParam("newIco", nowosci);
			so.addParam("photoUrl", photo);
			so.addParam("txtLabel2", text);
			
			so.addParam("clickUrl", link);
			so.write(container);
}