function show_object_tags()
{
   objs_num = document.getElementsByTagName('object').length
   for (i=0;objs_num>i;i++)
    document.getElementsByTagName('object')[i].style.visibility = 'visible';
}

function hide_object_tags()
{
  // if (navigator.appVersion.toLowerCase().indexOf("win")==-1 && navigator.appVersion.toLowerCase().indexOf("mac")==-1) {
       objs = document.getElementsByTagName('object');
       objs_num = objs.length;
       for (i=0;objs_num>i;i++)
       {
             objs[i].style.visibility = 'hidden';
       }
  // }
}

function __getBrowserSize()
{
  	var bodyWidth = document.documentElement.clientWidth;
  	var bodyHeight = document.documentElement.clientHeight;
  	
	//var bodyWidth, bodyHeight; 
	if (self.innerHeight){ // all except Explorer 
	 
      bodyWidth = self.innerWidth; 
	   bodyHeight = self.innerHeight; 
	}  else if (document.documentElement && document.documentElement.clientHeight) {
	   // Explorer 6 Strict Mode 		 
	   bodyWidth = document.documentElement.clientWidth; 
	   bodyHeight = document.documentElement.clientHeight; 
	} else if (document.body) {// other Explorers 		 
	   bodyWidth = document.body.clientWidth; 
	   bodyHeight = document.body.clientHeight; 
	} 
	return [bodyWidth,bodyHeight];		
		
}

function showProjectSwf(path,width,height,photoTitle,description)
{
   var wrapper = document.getElementById("full_size_image_wrapper");
   var common_div = document.getElementById("full_size_image");
   var content = document.getElementById("full_size_image_content");
   var title = document.getElementById("full_size_image_title");
   
   var div_height = height + 40;
   var div_width = width;
   
   content.style.display = "block";
   document.getElementById("full_size_image_loading").innerHTML = '<b>Дождитесь загрузки ролика...</b>';
   setTimeout("document.getElementById('full_size_image_loading').innerHTML = '&nbsp;'",6000);
   common_div.style.width = div_width + "px";
   common_div.style.height = div_height + "px";
   
   var topOffset = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
   var brSize = this.__getBrowserSize();
   var bodyHeight = brSize[1];
   var bodyWidth = brSize[0];
   
   var tmpHeight = div_height;
   var commonTop = (Math.ceil((Math.abs(bodyHeight - tmpHeight)) / 2) +  topOffset);
   
   common_div.style.top = 30 + 'px';
   common_div.style.left = 30 + "px";
   
   wrapper.style.width = getDocumentWidth() + "px";
   //wrapper.style.height = Math.max((bodyHeight+topOffset),(div_height+commonTop+topOffset)) + "px";
   //wrapper.style.height = outerHeight + "px";
   wrapper.style.height = getDocumentHeight() + "px";


      title.innerHTML = "<b>"+photoTitle+"</b>";
      content.innerHTML = "<object id='flash' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+width+"' height='"+height+"'>       <param name='movie' value='"+path+"' />        <!--[if !IE]>-->        <object type='application/x-shockwave-flash' data='"+path+"' width='"+width+"' height='"+height+"'>        <!--<![endif]-->          <p>У вас не установлен flash-плагин, необходимый для проигрывания ролика.<br>Вы можете <a href='http://get.adobe.com/flashplayer/' target='_blank'>получить flash-плагин для вашего браузера на сайте Adobe.com</a></p>     	   <!--[if !IE]>-->        </object>        <!--<![endif]-->      </object>";

      content.innerHTML += "<p>"+description+"</p>";
      wrapper.style.display = "block";      
      common_div.style.display = "block";      


}

   //Размер документа по вертикали  
   function getDocumentHeight()  
   {  
        return document.body.scrollHeight;//(document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;  
    }  
   
    //Размер документа по горизонтали  
    function getDocumentWidth()  
   {  
      return (document.body.scrollWidth > document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;  
   }  
	
function showFullSizeImage(path,width,height,photoTitle,description)
{
   var wrapper = document.getElementById("full_size_image_wrapper");
   var common_div = document.getElementById("full_size_image");
   var content = document.getElementById("full_size_image_content");
   var title = document.getElementById("full_size_image_title");
   
   var div_height = height + 40;
   var div_width = width;
   
   
   common_div.style.width = div_width + "px";
   //common_div.style.height = div_height + "px";
   
   var topOffset = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
   var brSize = this.__getBrowserSize();
   var bodyHeight = brSize[1];
   var bodyWidth = brSize[0];
   
   var tmpHeight = div_height;
   var commonTop = (Math.ceil((Math.abs(bodyHeight - tmpHeight)) / 2) +  topOffset);
   
   common_div.style.top = ((bodyHeight/2) - (div_height/2)) + 'px';
   common_div.style.left = ((bodyWidth/2) - (div_width/2)) + 'px';
   //common_div.style.top = 30 + 'px';
   //common_div.style.left = 30 + "px";
   
   wrapper.style.width = "100%";
   //wrapper.style.height = Math.max((bodyHeight+topOffset),(div_height+commonTop+topOffset)) + "px";
   //wrapper.style.height = outerHeight + "px";
   wrapper.style.height = "100%";
   
   wrapper.style.width = bodyWidth;
   wrapper.style.height = bodyHeight;

   
   if (navigator.appName != "Opera" && navigator.appName != "opera")
   {
      title.innerHTML = "<b>"+photoTitle+"</b>";
      content.innerHTML = "<a class='link' onclick='document.getElementById(\"full_size_image\").style.display = \"none\";document.getElementById(\"full_size_image_wrapper\").style.display = \"none\"'><img width='"+width+"' height='"+height+"' alt='"+photoTitle+"' title='"+photoTitle+"' src='"+path+"' onload=\"document.getElementById('full_size_image_loading').style.display = 'none';document.getElementById('full_size_image_content').style.display = 'block'\"></a>";
      content.innerHTML += "<p style='width:" + width + "px'>"+description+"</p>";
      wrapper.style.display = "block";      
      common_div.style.display = "block";      
   }
   else if (navigator.appName == "Opera" || navigator.appName == "opera")
   {
      title.innerHTML = "<b>"+photoTitle+"</b>";
      content.innerHTML = "<a class='link' onclick='document.getElementById(\"full_size_image\").style.display = \"none\";document.getElementById(\"full_size_image_wrapper\").style.display = \"none\";show_object_tags();'><img width='"+width+"' height='"+height+"' alt='"+photoTitle+"' title='"+photoTitle+"' src='"+path+"'></a>";
      content.innerHTML += "<p style='width:" + width + "px'>"+description+"</p>";
      wrapper.style.display = "block";
      common_div.style.display = "block";            
      document.getElementById('full_size_image_loading').style.display = "none";
      content.style.display = "block";      
   }

}



