var blank = new Image();
 blank.src = '/img/blank.gif';
 
 $(document).ready(function() {
   var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
   if (badBrowser) {
     // get all pngs on page
     $('img[src$=.png]').each(function() {
       if (!this.complete) {
         this.onload = function() { fixPng(this) };
       } else {
         fixPng(this);
       }
     });
   }
 });
 
 function fixPng(png) {
   // get src
   var src = png.src;
   // set width and height
   if (!png.style.width) { png.style.width = $(png).width(); }
   if (!png.style.height) { png.style.height = $(png).height(); }
   // replace by blank image
   png.onload = function() { };
   png.src = blank.src;
   // set filter (display original image)
   png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
 }

function flash(w,h,path){
//path='/img/i/'+path;
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+w+'" height="'+h+'"><PARAM NAME="allowScriptAccess" value="sameDomain"><PARAM NAME="movie" value="'+path+'"><PARAM NAME="wmode" VALUE="transparent"><param name="quality" value="high"><embed src="'+path+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed></object>');
}

function flashx(w,h,path,url){
path='/img/i/'+path;
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+w+'" height="'+h+'"><PARAM NAME="allowScriptAccess" value="sameDomain"><PARAM NAME="movie" value="'+path+'"><PARAM NAME="wmode" VALUE="transparent"><param name="flashVars" value="link1='+url+'"><param name="quality" value="high"><embed src="'+path+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" flashVars="link1='+url+'" width="'+w+'" height="'+h+'"></embed></object>');
}

function flashto(w,h,path,url,id){
$('#'+id).html('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+w+'" height="'+h+'"><PARAM NAME="allowFullScreen" value="true"><PARAM NAME="allowScriptAccess" value="sameDomain"><PARAM NAME="movie" value="'+path+'"><PARAM NAME="wmode" VALUE="transparent"><param name="flashVars" value="link1='+url+'"><param name="quality" value="high"><embed src="'+path+'" wmode="transparent" allowFullScreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" flashVars="link1='+url+'" width="'+w+'" height="'+h+'"></embed></object>');
}



$(document).ready(function() {

// выбор всех элементов
$('div[rel=hideon]').each(function(){
	$(this).addClass("hidedn"); $(this).click(function(){hide(this)})
	$(this).next().css('display','none');$(this).next().attr('class','hideinner');	
	})
$('div[rel=hideoff]').each(function(){
	$(this).addClass("hideup"); $(this).click(function(){hide(this)})
	$(this).next().attr('class','hideinner');	
	})
})


function hide(elm,par){
	e=$(elm).next();
	if(e.css("display")=='none'){ $(e).animate({height: 'toggle'}, "slow"); $(elm).attr("class",'hideup');$(elm).attr("title",'Свернуть');}
	else { $(e).animate({height: 'toggle'}, "slow"); $(elm).attr("class",'hidedn');$(elm).attr("title",'Раскрыть');}
}


function hidex(elm){
	e=$(elm).parent();
	$(e).animate({height: 'toggle'}, "slow"); $(elm).parent().prev().attr("class",'hidedn'); $(elm).parent().prev().attr("title",'Раскрыть');
	}




