var ua = navigator.userAgent.toLowerCase();
var isOpera = (ua.indexOf('opera')  > -1);
var isIE = (!isOpera && ua.indexOf('msie') > -1);

function getDocumentHeight() {
  return Math.max(document.compatMode != 'CSS1Compat' ? document.body.scrollHeight : document.documentElement.scrollHeight, getViewportHeight());
}

function getViewportHeight() {
  return ((document.compatMode || isIE) && !isOpera) ? (document.compatMode == 'CSS1Compat') ? document.documentElement.clientHeight : document.body.clientHeight : (document.parentWindow || document.defaultView).innerHeight;
}

function shadow_view(image){

 var ins;
 var t;
 t = document.getElementById('shadowz').style.height;

 ins = "<div align='center'><table width='800' height='600' cellspacing='0' cellpadding='0' border='0' align='center'>"+
 "<tr>"+
 "<td valign='top'><a name=\"shadow_img\"><img src='/tovar/norm/"+ image +"' style='border:5;border-style:solid;border-color:#000000;Cursor:Pointer' title='Закрыть изображение' onclick='javascript:shadow_view2();'></a></td>"+
 "</tr>"+
 "</table></div>";

 document.getElementById('shadow_fly2').style.display = "";
 document.getElementById('shadow_fly2').innerHTML = ins;

 window.location = "#shadow_img";
}

function shadow_view2(){ document.getElementById('shadow_fly').style.display = "none";
 document.getElementById('shadow_fly2').style.display = "none";
 document.getElementById('shadow_fly2').innerHTML = "";}

function shadow_bin(){
 var kaka = getDocumentHeight();
 kaka = kaka/2;

 document.getElementById('shadow_bin').style.top = kaka;
 document.getElementById('shadow_bin').style.display = "";
 window.location = "#shadow_bin";
}

function shadow_bin_close(){
 document.getElementById('shadow_bin').style.display = "none";
 document.getElementById('coll').value = 1;
}

 function shadow_calc(){  var rub;
  var dollar;
  var euro;

  var ed;
  var prim;

  ed =     document.getElementById('coll').value;
  rub =    document.getElementById('pr').value;
  dollar = document.getElementById('pd').value;

  dollar = Math.round(dollar*100)/100;

  euro =   document.getElementById('pe').value;
  euro = Math.round(euro*100)/100;

  prim = ed * rub;
  prim2 = Math.round(dollar * ed * 100)/100;
  prim3 = Math.round(euro * ed * 100)/100;

  if(ed <= 100){
   document.getElementById('pp').innerHTML = '<font style="font-size:12px;">Цена: '+ prim +' руб.<br> Цена: '+prim2+ ' $<br> Цена: '+prim3+' &euro;</font>';
  }

  else{   document.getElementById('pp').innerHTML = 'Тебе нахуя столько товара?';  }
 }

  function ff(){
  var z,k; k = 15;
  z = document.getElementById('uf').value.length;
  if(z < k){}
  else{document.getElementById('faqf').submit();}

 }