function SendEMail( domain, mailbox )
{	var sLink = 'mailto:' ;
	sLink += mailbox ;
	sLink += '@' ;
	sLink += domain ;
	window.location = sLink ;	
	return false ;
}

function openWin(_width, _height, _img,_title,_id) 
{
//_width += 16

width = "width="+_width;
height = "height="+_height;

myWin= open("", "", width + ',' + height + ',resizable=yes,status=no,toolbar=no,menubar=no,scrollbars=0');
myWin.document.open();
myWin._img = _img;
myWin._title= _title;
myWin.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><HTML>");
myWin.document.write("<BODY TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 BGCOLOR=#FFFFFF>");
myWin.document.write("<TITLE>");
myWin.document.write(''+_title+'');
myWin.document.write("</TITLE>");
myWin.document.write("<script language=JavaScript> {");
myWin.document.write("document.write('<A HREF=# ONCLICK=window.close()><IMG SRC=' + _img + ' BORDER=0></A><br>')");
myWin.document.write("} </script>"); 
myWin.document.write("</BODY>");
myWin.document.write("</HTML>");
myWin.document.close();
}


function changeBannerType(){
  //Если баннер
  if (document.banner.type.value=='banner'){
    if(document.getElementById('target')) document.getElementById('target').style.display = '';
    if(document.getElementById('img')) document.getElementById('img').style.display = '';
    if(document.getElementById('link')) document.getElementById('link').style.display = '';
    if(document.getElementById('width')) document.getElementById('width').style.display = '';
    if(document.getElementById('height')) document.getElementById('height').style.display = '';
    if(document.getElementById('code')) document.getElementById('code').style.display = 'none';    
      }
  //Если флэша
  if (document.banner.type.value=='flash'){
    if(document.getElementById('target')) document.getElementById('target').style.display = 'none';
    if(document.getElementById('img')) document.getElementById('img').style.display = '';
    if(document.getElementById('link')) document.getElementById('link').style.display = 'none';
    if(document.getElementById('width')) document.getElementById('width').style.display = '';
    if(document.getElementById('height')) document.getElementById('height').style.display = '';
    if(document.getElementById('code')) document.getElementById('code').style.display = 'none'; 
    
  }
  //Если код
  if (document.banner.type.value=='code'){
    if(document.getElementById('target')) document.getElementById('target').style.display = 'none';
    if(document.getElementById('img')) document.getElementById('img').style.display = 'none';
    if(document.getElementById('link')) document.getElementById('link').style.display = 'none';
    if(document.getElementById('width')) document.getElementById('width').style.display = 'none';
    if(document.getElementById('height')) document.getElementById('height').style.display = 'none';
    if(document.getElementById('code')) document.getElementById('code').style.display = ''; 
    
  }
}


var last_price = 0;
var last_id = 0;
var configurator_id = '';



function CalcConfigurator(obj, id){
  document.getElementById('price_'+id).value=obj.value;
  document.getElementById('col_'+id).value=1;
  
  var price_total = 0;
  var configurator_id_arr = new Array();
  configurator_id_arr = configurator_id.split(",");
  for (i in configurator_id_arr){
    var ppp = 'price_'+configurator_id_arr[i];
    if (document.getElementById('price_'+configurator_id_arr[i]).value>0){
      price_total += parseFloat(document.getElementById('price_'+configurator_id_arr[i]).value) * parseFloat(document.getElementById('col_'+configurator_id_arr[i]).value)
    }
  }
  document.getElementById('price_total').value=price_total;
  
  
 // alert (document.getElementById('configurator_f').elements);
/* for (i in configurator_f.elements){
  document.write (i+"<br>")
 }*/
 

//  alert(id)
/*  document.getElementById('price_'+id).value=obj.value;
  document.getElementById('col_'+id).value=1;
  price_total = document.getElementById('price_total').value;
  if (!price_total){
    price_total = 0;
  }
  if (last_id==id || last_id==0){
//  alert (last_id)
    price_total = parseFloat(price_total) + parseFloat(obj.value) - last_price;  
    document.getElementById('price_total').value=price_total;
    last_price = obj.value;
    last_id=id;
  }else{
//  alert (last_id)  
    price_total = parseFloat(document.getElementById('price_total').value) + parseFloat(obj.value);
    document.getElementById('price_total').value=price_total;
    last_price = obj.value;
    last_id=id;
  }*/
 
}

function CalcConfiguratorCol(id){

  if (document.getElementById("price_"+id).value>0){
 document.getElementById('price_'+id).value=document.getElementById('confsel_'+id).value*document.getElementById('col_'+id).value;


  var price_total = 0;
  var configurator_id_arr = new Array();
  configurator_id_arr = configurator_id.split(",");
  for (i in configurator_id_arr){
    var ppp = 'price_'+configurator_id_arr[i];
    if (document.getElementById('price_'+configurator_id_arr[i]).value>0){
      price_total += parseFloat(document.getElementById('price_'+configurator_id_arr[i]).value)
    }
  }
  document.getElementById('price_total').value=price_total;


  }

}