//-- Коректировка отображения картинок в формате PNG --//
function fixPNG(object,source){
  if(/MSIE (5|6).+Win/.test(navigator.userAgent)){
    if(source){
      object.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+source+"',sizingMethod='scale')";
    }else{
      if(object.tagName=='IMG'){
        if(/\.png$/.test(source=object.src)){
          object.src="/images/1x1.gif"; fixPNG(object,source);
          with(object.runtimeStyle){
            width=object.width+'px'; height=object.height+'px';
          }
        };
      }else{
        source=object.currentStyle.backgroundImage;
        if((source)&&(source=source.match(/url\("(.+\.png)"\)/i))){
          object.runtimeStyle.backgroundImage="none"; fixPNG(object,source[1]);
        };
      };
    };
  };
};

function start(){
  flash('weather','/weather_6.swf','#39497C');
  flash('flash','/flash/flash.swf','#39497C');
  flash('player','/flash/player.swf','#CDD7DE');
  flash('clocks','/flash/clock_1.swf');
};

function flash($target,$source,$color){
  if(($target=document.getElementById($target))&&(document.createElement)){
    var $flash=document.createElement('EMBED'); var $place=$target.parentNode;
    if($flash.setAttribute){
      $flash.setAttribute('src',$source);
      $flash.setAttribute('bgcolor',$color);
      $flash.setAttribute('wmode','transparent');
      $flash.setAttribute('width',$target.getAttribute('width'));
      $flash.setAttribute('height',$target.getAttribute('height'));
      $flash.setAttribute('id',$target.getAttribute('id'));
      $flash.setAttribute('name',$target.getAttribute('id'));
      $flash.setAttribute('quality','high');
      $flash.setAttribute('allowScriptAccess','sameDomain');
      $flash.setAttribute('type','application/x-shockwave-flash');
      $flash.setAttribute('pluginspage','http://www.macromedia.com/go/getflashplayer');
      $flash.style.zIndex=0;
    };
    if(($place.innerHTML)&&($flash.outerHTML)){
      $place.innerHTML=$flash.outerHTML;
    }else{
      if($place.replaceChild){
        $place.replaceChild($flash,$target);
      };
    };
  };
};

$(document).ready(function(){
//  $("div.products div.product").bind("click",function(){if($href=$(this).find("a")[0].href){window.location.href=$href;};});
  $("div.products div[class^='product']").bind("click",function(){$(this).find("a")[0].click();});
  $("div.products div[class^='product']").bind("mouseover",function(){$(this).css('borderColor','#ED6400');});
  $("div.products div[class^='product']").bind("mouseout",function(){$(this).css('borderColor','transparent');});
});

