//Определение браузера
opera = (window.opera)? true : false;	
dom = (document.getElementById)? true : false;
ie4 = (document.all && !dom)? true : false;
nn4 = (document.layers)? true : false;



//вызов блокнота
 function notepad(id) 
 {
  if(id=='0')  { win_notepad=window.open('/user/notepad/','notepad','scrollbars=1,resizable=1,width=600, height=500,toolbar=0');
  }
  else{
     win_notepad=window.open('/user/notepad/?product_id='+id,'notepad','scrollbars=1,resizable=1,width=600, height=500,toolbar=0');
  }	 
 
  win_notepad.window.focus();
 }

//вызов корзины
 function basket(id) 
 {
  if(id=='0')  { window.location.href='/user/basket/';
  }
  else{
     window.location.href='/user/basket/?add='+id;
  }	 
 
  win.window.focus();
 }

 
//описание характеристики 
 function hint(id)
 {
  win_hint=window.open('/catalog/hint/'+id+'/','hint','scrollbars=1,resizable=1,width=400, height=300,toolbar=0');
  win_hint.window.focus();
 } 

//описание характеристики 
 function info(id)
 {
  win_hint=window.open('/info/win/'+id+'.html','infopopup','scrollbars=1,resizable=1,width=600, height=500,toolbar=0');
  win_hint.window.focus();
 } 


 
function main(url)
{
  window.opener.location.href=url;
  window.opener.focus(); 
}

function basket_var(id) 
{
 sel='b_var'+id;
 element = document.getElementById(sel);
 
 for (i=0; i < element.length; i++) 
 {
   if (element.options[i].selected == true)
   { 
    select_id=element.options[i].value;
   } 
 }
   window.location.href='/user/basket/?add='+select_id; 
  
}

function act_submit(i_id,id) {
if(dom){
	def=document.getElementById(i_id);
	subm=document.getElementById(id);
	if(def.value.length>=0)
     subm.disabled=false; 
	else
     subm.disabled=true; 
	} 
	 
}


function email (login, serv)
{
 	var serv = new Array;
	if(serv=="") serv="silicon-s.ru";
	eml = login +  "@" + serv;
	return eml;
}


function mylo (login, serv)
{
 document.write (email(login, serv));
}

function namylo (login, serv, subj)
{
eml = "mailto:" + email(login, serv);
re= /\s/;
while(subj.search(re)>0)
subj=subj.replace(re, "%20");

if (subj != "") eml += "?subject=" + subj;
window.location.href = eml;
}


function zoomImg(id,w,h) 
{
 win_h=h+30;
 win_w=w;
 win=window.open('/info/img.php?id='+id,'img','scrollbars=0,resizable=1,width='+win_w+', height='+win_h+',toolbar=0');
 win.window.focus();
}

function go_search(id) 
{
 var q;
 var url;
 q = document.getElementById(id).value;
 url='/search/index.php?str=1&q='+q;
 window.location=url;
 win=top.location.href=url;
// win.window.focus();
}
