﻿
function oznac()
{

	f = document.forms['aspnetForm'];
	e = f.elements;
	for(i = 0; i < e.length; i++)
	    if(e[i].type == "checkbox")
		if (e[i].name=="msgdel")
		     e[i].checked = !e[i].checked;

}

function oznacDel(par)
{   var bolOK=true;

    // mazat vse  - opravdu chce?
    if (par==4) 
        bolOK = alertDel(" všechny vzkazy v kategorii?");

    // mazani povoleno - maz    
    if (bolOK) 
    {
        f = document.forms['aspnetForm'];
        f.action.value=par;
        f.submit();
     }   

}



function alertDel(strWhat)
{ 
    var truthBeTold = window.confirm("Opravdu chceš vymazat " + strWhat );
    return truthBeTold //window.event.returnValue = truthBeTold;
    
//    if (truthBeTold == false ){
//       event.preventDefault() 
//       }

//    if (navigator.appVersion.indexOf("MSIE")!=-1){ 
//        alert('not ie');
//        if (truthBeTold == false ){
//       event.preventDefault() 
//       }
//    }
//    if (truthBeTold) {
//         window.alert("true");
//    } else  window.alert("false!");
}


function oknoSrc(url,xs,ys, srcOkno)
{
//		if (xs==0 or ys==0) {xs=400; var ys=300;}
	ukaz = window.open(url, srcOkno, 'scrollbars,resizable,status,menubar=0,width=' + xs + ',height=' + ys); 
	if(ukaz)
		ukaz.focus();
	else
		alert('Abys mohl využít službu, musíš povolit ve svém prohlížeči pop-up okna, která máš zákázána!')
}








//************************************************************************************************
function otuniv(id,url,kat,vyska ,idad,typ)
{
    var typsa='obszp'+id  ;
    //document.getElementById(typsa).innerHTML ='<div id=closewindow99><img src="../img/ic_sm.gif" border="0" title="Zavřít okno s detailem vzkazu"/>&nbsp;<a href="javascript:otunivz(' + id + ')">Skrýt</a></div><div><iframe src=' + url + ' width=100% height=' + vyska + ' MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER=0 HSPACE=0 VSPACE=0 scrolling=auto frameborder=0></iframe></div><div id="closewindow99"><img src="../img/ic_sm.gif" border="0" title="Zavřít okno s detailem vzkazu"/>&nbsp;<a href="javascript:otunivz(' + id + ')">Skrýt</a></div><br><br><br>';
    document.getElementById(typsa).innerHTML ='<div id=closewindow99><img src="../img/ic_sm.gif" border="0" title="Zavřít okno"/>&nbsp;<a href="javascript:otunivz(' + id + ',' + idad + ',' + typ + ')">Skrýt</a></div><div><iframe src=' + url + ' width=100% height=' + vyska + ' MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER=0 HSPACE=0 VSPACE=0 scrolling=auto frameborder=0></iframe></div><div id="closewindow99"><img src="../img/ic_sm.gif" border="0" title="Zavřít okno"/>&nbsp;<a href="javascript:otunivz(' + id + ',' + idad + ',' + typ + ')">Skrýt</a></div><br><br><br>';
    document.getElementById(typsa).style.display = 'inline'; 
}


function otunivz(id ,idad, typ )
{
    var typsa='obszp'+id   ; 
    document.getElementById(typsa).style.display = 'none';
    if (typ==2) 
        typ='O' 
    else
        typ='I';    
    
    //over, zda jde o zavirani prikladani fotek nebo videi k AD nebo ANSWER a proved reload pripojenych objektu
    if (idad>0)  {
        //iframe_prip_foto.location.replace('../inzeraty/ConnectedGraphics.aspx?typ=' + typ + '&id=' + idad');
        IFR.location.replace('../inzeraty/ConnectedGraphics.aspx?typ=' + typ +'&id=' + idad);
        
    }
    
}

//smajliky
/*
function a1(nazev) 
{
    document.forms[0].obs2$text.value=document.forms[0].obs2$text.value+'/a'+nazev+'/';
     document.forms[0].obs2$text.focus()
}
*/





function otmesshist(zpravaId )
{

if (  document.getElementById("messhist").style.display=='none') {
    // jeste nenactena historie
    if (document.getElementById('hist').value==0) {
        document.getElementById('messhist').innerHTML ='<div class=infos><iframe src=mess_hist.aspx?id=' + zpravaId + ' width=100% height=150 MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER=0 HSPACE=0 VSPACE=0 scrolling=auto frameborder=0></iframe></div><br/>';
        document.getElementById('hist').value=1;    
    }       
    
    document.getElementById("messhist").style.display = '';
    document.getElementById("spammess").style.display = 'none';
   }
else  {
    document.getElementById("messhist").style.display = 'none';
    }

}



function otmessspam(zpravaId )
{

if ( document.getElementById("spammess").style.display=='none') {
    // jeste nenactena historie
    if (document.getElementById('spam').value==0) {
        document.getElementById('spammess').innerHTML ='<div class=infos><iframe src=mess_hist.aspx?s=1&amp;id=' + zpravaId + ' width=100% height=20 MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER=0 HSPACE=0 VSPACE=0 scrolling=no frameborder=0></iframe></div><br/>';
        document.getElementById('spam').value=1;    
    }       
    
    document.getElementById("spammess").style.display = '';
    document.getElementById("messhist").style.display = 'none';
   }
else  {
    document.getElementById("spammess").style.display = 'none';
    }
}

