
 function selectSite( SiteID )
 {
    
    contentObj.innerHTML = "";

	// miroslav : 13.XII. 2007 ----
	if ( !st )
	{
		var st = "index.php";
	}
	// ----

    var url = st + '?m=24&i=' + SiteID;
    new Ajax.Request( url,
                     {
                       method: "post",
                       onSuccess: function( transport )
					   {
                            contentObj.innerHTML = transport.responseText;
						    var dragable1 = DragHandler.attach(document.getElementById('showup'));
	                        dragable1.dragBegin = begin;
						    dragable1.drag = drag;
						    dragable1.dragEnd = end;
                       }
                     }
                     );
    
 }


 function showWaitPicture()
 {
     contentObj.innerHTML = '<img src=\"img/loading.gif\">';
 }

		
 
 function  clearPortFolio( )
 {
     var ShowUpDiv =  document.getElementById( "showup" );
     if( ShowUpDiv )
     {
        ShowUpDiv.style.display = "none";
		ShowHideScreen2 ( "none" );
     }
 
 }

 function loadPortFolio( SiteID )
 {
        Position = SiteID;
           
       var ShowUpDiv =  document.getElementById( "showup" );
       
       if( ShowUpDiv )
       {
             ShowHideScreen2 ( "block" );

            var WindowTop    = (document.body || document.documentElement).scrollTop;
			var WindowBottom = (document.body || document.documentElement).scrollHeight;
			var WindowWidth  = (document.body || document.documentElement).scrollWidth;
			var WindowMiddle = WindowBottom / 2; 

			var Top = WindowTop + 130;
            var Left = ( WindowWidth / 2 ) - ( 528 / 2 );                 				


			ShowUpDiv.style.zIndex = 131561;
			ShowUpDiv.style.top = Top;
			ShowUpDiv.style.left = Left;
			ShowUpDiv.style.display = "inline";
			contentObj = document.getElementById('showup');

			if( contentObj )
			{
				selectSite( SiteID );    		
			}
       }           
}
 
 
 function fideInPic( TargetLink , LargeUrl)
 {
           
    Target = TargetLink.getElementsByTagName( 'img' )[0];
 
     Target.onmouseout = function()
	 { 
	    SetOpcity( Target, 0.2 );
	 }
	 
	 Target.onclick = function()
	 { 
                     ReloadImage( 'BigPictureImg', LargeUrl )
	 } 
	 
         SetOpcity( Target , 1 );	         
 
 }


function loadLargeImage( TargetID, NewSrc )
{
   var Target = document.getElementById(  TargetID  );	     

        Target.onloading = function()
	{
	    Target.innerHTML = '<img src="/img/loading.gif" width="321" height="195" border="0" vspace="0" hspace="0">';
	} 
        	
        Target.innerHTML = '<img src="'+ NewSrc +'" width="321" height="195" border="0" vspace="0" hspace="0">';
}

function ReloadImage(TargetID, NewSrc )
{
                          
               var Target = document.getElementById(  TargetID  );	     

               var img = new Image();
	         
	       Target.src = '/img/loading.gif';
	          

	       img.onload = function (evt){
	
	             var Target = document.getElementById(  TargetID  );	     
	                 Target.src    = img.src;
	                 Target.width  = img.width;
	                 Target.height = img.height;
	                 Target.width  = 313;
					 Target.height = 195;
	       }
	
               img.src = NewSrc;	                       
	
}



function ShowHideScreen2( Display )
{

     var HiddenFrame = document.getElementById( 'hideScreen' ) || document.createElement( 'iframe' );
	 
	 var hDiv        = document.getElementById( 'hideDiv' ) || document.createElement( 'div' );
	  
	 
	 var p = (document.body || document.documentElement).scrollHeight + 'px';

	 hDiv.id  = "hideDiv";
	 hDiv.style.backgroundColor = "gray";
	 hDiv.style.height = (document.body || document.documentElement).scrollHeight + 'px';
	 hDiv.style.width = (document.body || document.documentElement).scrollWidth + 'px';
	 hDiv.style.position = 'absolute';
	 hDiv.style.display   = Display;
	 hDiv.style.top   = "0px";
	 hDiv.style.zIndex = 6666;
	 SetOpcity( hDiv, 0.9);
	 
	 HiddenFrame.id = "hideScreen"; 
	 HiddenFrame.style.zIndex = 5555;
	 HiddenFrame.style.height = (document.body || document.documentElement).scrollHeight + 'px';
	 HiddenFrame.style.width = (document.body || document.documentElement).scrollWidth + 'px';
	 HiddenFrame.style.top   = "0px";
	 HiddenFrame.style.position = 'absolute';
	 HiddenFrame.src = "about:blank";
	 HiddenFrame.style.display   = Display;
	 SetOpcity( HiddenFrame, 0);
	 document.body.appendChild( HiddenFrame );
	 document.body.appendChild( hDiv );

}

										
