function uloz_cookie()
	{ 
		var str; 
		var vyprs=new Date(); 
		vyprs.setDate(vyprs.getDate() - 365); 
		document.cookie="nastaveni=1; expires="+vyprs.toGMTString()+";"; 
		vyprs.setDate(365 + 365 + vyprs.getDate()); 
		document.cookie="nastaveni=1; expires="+vyprs.toGMTString()+";"; 
	} 

function openLink(URI){
win = window.open(URI,"secWin","");
win.focus;
}


function JustSoPicWindow(imageName,imageWidth,imageHeight,typ) 
{
	bgcolor="#FFFFFF";
	
	if (typ==1)
		imageName=imageName.substring(0,imageName.lastIndexOf("/"))+"-big"+imageName.substring(imageName.lastIndexOf("/"),imageName.length);
	else
		imageName=imageName.substring(0,(imageName.length-8))+"big.jpg";
		
	if ((typ==1) || (typ==''))
		typ="Klikněte pro zavření okna";
		
		
	//nove promenne
	var pimageWidth=imageWidth;
	var pimageHeight=imageHeight;
	var posuvnik='no';
	//********************
	
	var adj=10;
	var w = screen.width;
	var h = screen.height;
	
	var scrWidth;
	var scrHeight;
	var plus=0;
	
	//alert(w+","+h);
	//var byFactor=1;
	
	if (w<imageWidth) //obrazek je sirsi nez obrazovka
	{
		posuvnik='yes';
		srcWidth=w;
		plus=20;
	}
	else srcWidth=imageWidth+plus;
	
	if ((h-50-plus)<imageHeight) //obrazek je vyssi nez obrazovka
	{
		posuvnik='yes';
		srcHeight=h;
		plus=20;
	}
	else srcHeight=imageHeight+plus;
	
	srcWidth=srcWidth+plus;

	var posLeft=Math.round((w-srcWidth)/2);
	var posTop=Math.round((h-srcHeight)/2);

	/*posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);		
	scrWidth = parseInt(scrWidth); 
	scrHeight = parseInt(scrHeight);*/
	
	
	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
	newWindow = window.open("",null,"width="+srcWidth+",height="+srcHeight+",left="+posLeft+",top="+posTop+", scrollbars="+posuvnik);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+typ+'</title><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor='+bgcolor+' onBlur="self.close()" onClick="self.close()">');  
	newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0" align="center" height='+scrHeight+' ><tr><td>');
	newWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="'+typ+'" >'); 
	newWindow.document.write('</td></tr></table></body></html>');
	newWindow.document.close();
	newWindow.focus();
	}
}

function send_xmlhttprequest(obsluha, method, url, content, headers) {
  
    var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest : (window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false));
    if (!xmlhttp) {
        return false;
    }
    xmlhttp.open(method, url);
    xmlhttp.onreadystatechange = function() {
        obsluha(xmlhttp);
    };
    if (headers) {
        for (var key in headers) {
            xmlhttp.setRequestHeader(key, headers[key]);
        }
    }
    xmlhttp.send(content);
    return true;
}

function ZapocitejKlik(kampan,umisteni) {
    // odeslani pozadavku na aktualizaci dat
    if (!send_xmlhttprequest(ZapocitejObsluha, 'GET', 'odkazy-kliknuti.php?kampan=' + kampan + '&umisteni=' + umisteni)) {
        return false;
    }
    return true;
}

function ZapocitejObsluha(xmlhttp) {
    return true;
}

function ZapocitejKlikExterni(odkaz,umisteni) {
    // odeslani pozadavku na aktualizaci dat
    if (!send_xmlhttprequest(ZapocitejObsluha, 'GET', 'odkazy-kliknuti.php?odkaz=' + odkaz + '&umisteni=' + umisteni)) {
        return false;
    }
    return true;
}
