 
 
var lastImg = null;
function imgSwap(ev,imgName) {
if (imgName != 0) {
lastImg = ev.src;
ev.src = imgName;
}
else
{
ev.src = lastImg;
}
}
function checkFields(newForm) {
if (newForm.title.value == '') {
alert('Brak tytułu');
return ;
} else if (newForm.body.value == '') {
alert('Brak treści');
return ;
}
newForm.submit();
}
function fullsize(pI,title,desc) {
if(document.all){picId = "/_uTils/site/gallery.html?" + pI + "&title=" + encodeURIComponent(escape(title)) + "&desc=" + encodeURIComponent(escape(desc));}
else{picId = "/_uTils/site/gallery.html?" + pI + "&title=" + escape(title) + "&desc=" + escape(desc);}
//picId = encodeURI(picId);
Win = window.open(picId,'DispalyWindow','width=300, height=300, resizable=yes, scrollbars=auto menubar=no, location=no');
return;
}
function isN(v,f,n) {
if(v.length>0)if((v!=~~v)||(v<=0)){alert('Wymagana jest liczba całkowita dodatnia.');o=eval('document.'+f+"."+n);o.value="";}
}
function openInNewWindow(href){
return window.open(href, null, '');
}
function openWindow(url,top,left,width,height) {
var p = "";
if (top>-1) p=",top="+top;
if (left>-1) p=p+",left="+left;
if (width>-1) p=p+",width="+width;
if (height>-1) p=p+",height="+height;
window.open(url,'','toolbar=0,location=0,directories=0,status=0,menubar=0.scrollbars=0,resizable=0'+p);
}
function setCol(id) {
id.style.color = 'yellow';
}
function scol(what,how) {
if(how==1) {
what.style.background = "url(/palio/html.media?_Instance=cms_samorzad.pap.pl&_Option=Palio&_ID=41&_CheckSum=-1311510101) repeat-x";
what.style.border = "1px dotted #3b528d";
}
if(how==0) {
what.style.background = "url(/palio/html.media?_Instance=cms_samorzad.pap.pl&_Option=Palio&_ID=30&_CheckSum=-1246865973) repeat-x";
what.style.border = "1px solid #ebebeb";
}
}
function onSilverlightError(sender, args) {
var appSource = "";
if (sender != null && sender != 0) {
appSource = sender.getHost().Source;
}
var errorType = args.ErrorType;
var iErrorCode = args.ErrorCode;
if (errorType == "ImageError" || errorType == "MediaError") {
return;
}
var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n" ;
errMsg += "Code: "+ iErrorCode + " \n";
errMsg += "Category: " + errorType + " \n";
errMsg += "Message: " + args.ErrorMessage + " \n";
if (errorType == "ParserError") {
errMsg += "File: " + args.xamlFile + " \n";
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
else if (errorType == "RuntimeError") {
if (args.lineNumber != 0) {
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
errMsg += "MethodName: " + args.methodName + " \n";
}
throw new Error(errMsg);
}

 