function onloadWeb(){
	var i;
	var lista_imagenes = new Array();
	for(i in imagenes){ 
		lista_imagenes[i] = new Image(); 
		lista_imagenes[i].src = imagenes[i]; 
	}
}
function add_referenceFields(){
	/* Miramos el numero de campo */
	num = parseInt($("RefForm_Num").value);
	num = num + 1;
	$("RefForm_Num").value = num;
	/* Añadimos elementos */
	html  = "<div class=\"Prod_Divider\">Product "+num+"</div>";
	html += "<label for=\"RefForm_Customer_"+num+"\">Customer email:</label><input name=\"RefForm_Customer_"+num+"\" id=\"RefForm_Customer_"+num+"\" type=\"text\" />";
	html += "<label for=\"RefForm_Date_"+num+"\">Sale Date:</label><input name=\"RefForm_Date_"+num+"\" id=\"RefForm_Date_"+num+"\" type=\"text\" />";
	html += "<label for=\"RefForm_Prod_"+num+"\">Product:</label>";
	html += "<select id=\"RefForm_Prod_"+num+"\" name=\"RefForm_Prod_"+num+"\">";
	html += "	<option value=\"PB-06\">PearlBlue</option>";
	html += "	<option value=\"SbPB\">RS232 for PearlBlue</option>";
	html += "	<option value=\"uIB-07\">uIceBlue2</option>";
	html += "	<option value=\"BTIO-07\">BTswitch I/O</option>";
	html += "	<option value=\"SCBT-08\">BTswitch Source Code</option>";
	html += "	<option value=\"BTB-08\">BTswitch Box</option>";
	html += "</select>";
	$("RefForm_Button").insert({before: html});
}
function shirtSizeSex(){
	var form = $('ShirtSizeForm');
	var size = form.getInputs('radio','ShirtSize');
	var sex = form.getInputs('radio','ShirtSex');
	var product;
	for (var i=0; i < size.length; i++){
	   if (size[i].checked) product = "TrainGrid Shirt "+ size[i].value;
   	}
	for (var i=0; i < sex.length; i++){
	   if (sex[i].checked) product += " " + sex[i].value;
   	}
   	$("ShirtShop").value = product;
}
function shirtSizeSexForSDK(){
	var form = $('ShirtSizeFormSDK');
	var size = form.getInputs('radio','ShirtSize');
	var sex = form.getInputs('radio','ShirtSex');
	var product;
	for (var i=0; i < size.length; i++){
	   if (size[i].checked) product = "TrainGrid Developers Kit, Shirt type: "+ size[i].value;
   	}
	for (var i=0; i < sex.length; i++){
	   if (sex[i].checked) product += " " + sex[i].value;
   	}
   	$("ShirtShop").value = product;
}
function showScreenShot(element){
	if($('videoBlock')) $('videoBlock').remove();
	html = "<div id='videoBlock'><img src='./images/technology/"+element+"' alt='ScreenShot' onclick=\"$('videoBlock').remove()\" /></div>";
	$("WebBackGround").insert({before: html});
	window.scroll(0,0);
}
function phonesList(){
	list = "LG KS10, LG KT610, LG KT615, Nokia 5700 XpressMusic, Nokia 6110 Navigator, Nokia 6120 Classic, Nokia 6121 Classic, Nokia 6124 classic, Nokia 6290, Nokia E51, Nokia E63, Nokia E66, Nokia E71, Nokia E90 Communicator, Nokia N76, Nokia N81, Nokia N81 8GB, Nokia N82, Nokia N95, Nokia N95 8GB, Samsung SGH-G810, Samsung SGH-i400, Samsung SGH-i408, Samsung SGH-i450, Samsung SGH-i458, Samsung SGH-i520, Samsung SGH-i550, Samsung SGH-i550w, Samsung SGH-i560, Samsung SGH-i568, Nokia 5320 XpressMusic, Nokia 5630 XpressMusic, Nokia 5730 XpressMusic, Nokia 6210 Navigator, Nokia 6220 Classic, Nokia 6650 fold, Nokia 6710 Navigator, Nokia 6720 Classic, Nokia 6730 Classic, Nokia 6760 Slide, Nokia 6790 Surge, Nokia C5, Nokia E52, Nokia E55, Nokia E71x, Nokia E72, Nokia E75, Nokia E5, Nokia N78, Nokia N79, Nokia N85,Nokia N86 8MP, Nokia N96, Samsung GT-i8510 (INNOV8), Samsung GT-I7110, Samsung SGH-L870";
	alert(list);
}
var opt = 1;
var img = "";
function showInfoEffect(){
	if( $('HomeExampleIMG').getStyle('opacity') == "1" ){
		new Effect.Opacity('HomeExampleIMG', { from: 1, to: 0, duration: 1 });
		setTimeout("showInfoEffect()",1100);
	}else{
		$("HomeExampleIMG").src = img;
		new Effect.Opacity('HomeExampleIMG', { from: 0, to: 1, duration: 2 });
		setTimeout("showInfo()",7000);
	}
}
function showInfo(){
	switch(opt){
	 case 0:
	 	img = "./images/home/icons/sport.png";
	 	opt = 1;
	 break;
	 case 1:
		 img = "./images/home/icons/depen.png";
		 opt = 2;
	 break;
	 case 2:
		 img = "./images/home/icons/risk.png";
		 opt = 0;
	 break;
	}
	setTimeout("showInfoEffect()",5);
}
function termconditions(form){
	kids = form.descendants();
	var shirt = $('ShirtSizeFormSDK');
	var size = shirt.getInputs('radio','ShirtSize');
	var sex = shirt.getInputs('radio','ShirtSex');
	for (var i=0; i < size.length; i++) if (size[i].checked) SexValue = size[i].value;
	for (var i=0; i < sex.length; i++) if (sex[i].checked) SizeValue = sex[i].value;
	var info = kids[5].value+"||"+kids[6].value+"||"+kids[7].value+"||"+SizeValue+" "+SexValue;
	var options = "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=800, height=500, top=85, left=140";
	window.open("./php/termsconditions.php?info="+info,"Terms and Conditions",options);
	return false;
}
function sizedoesmatter(){
	var html;
	new Ajax.Request('./contents/sizedoesmatter.php',{method: 'post', onSuccess:function(res){
		if($('videoBlock')) $('videoBlock').remove();
		html = "<div id=\"videoBlock\" onclick=\"this.remove()\">" + res.responseText + "</div>";
		$("WebBackGround").insert({before: html});
		window.scroll(0,0);
	},onFailure: function(){},onCreate:function(){},onComplete:function(){}});
}

