window.onload = setScreenClass;
window.onresize = setScreenClass;

//  Following transition classes will be declared:
//  //
//  // classname   screenwidth
//  // ------------------------------------------
//  // pda_v   240px
//  // pda_h   320px
//  // ultralow   320px -  640px
//  // screen_lo   640px -  800px
//  // screen_med   800px - 1024px
//  // screen_hi 1024px - 1280px
//  // screen_wide > 1280px
//
  function setScreenClass(){
  var fmt = document.documentElement.clientWidth;
  var cls = (fmt<=240)?'pda_ver':(fmt>240&&fmt<=320)?'pda_hor':(fmt>320&&fmt<=640)?'screen_ultralow':(fmt>640&&fmt<=700)?'screen_low':(fmt>700&&fmt<=900)?'screen_med':(fmt>900&&fmt<=1100)?'screen_high':'screen_wide';
  fmt=fmt-21;
  var anchura;
  var anchuraprn;
  var anchuravideo;
  $(".imagefield-field_imageninnovacion").css("width",fmt);
  switch (cls){
        case "screen_wide":
          anchura = 20;
          anchuraprn = 100;
	  anchuravideo = 420;
          break;
        case "screen_high":
          anchura = 17;
          anchuraprn = 60;
	  anchuravideo = 290;
          break;
        case "screen_med":
          anchura = 15;
          anchuraprn = 50;
	  anchuravideo= 173;
          break;
        default:
          anchura = 11;
          anchuraprn = 40;
          break;
        }
//alert ("->"+anchura+fmt);
  $(".panel-pane h2").css("font-size",anchura);
  $(".prn").css("width",anchuraprn);
//.removeAttr("disabled")
$("#emvideo-youtube-flash-1").attr("width",anchuravideo);
$("#emvideo-youtube-flash-1").css("width",anchuravideo+"px");
$("#emvideo-youtube-flash-1").attr("style","width:"+anchuravideo+"px");
  };



