var settings_color="#9f9f9f";

function textcolor(id,color)
{
document.getElementById(id).style.color=color;
}

function load_intro(use_1,use_2,use_3,use_4,use_5,admin,color1,color2,color3,color4,color5,mouseclick)
{
if (use_1 != "on"){$('#intro_button_1').hide();	}
if (use_2 != "on"){$('#intro_button_2').hide();	}
if (use_3 != "on"){$('#intro_button_3').hide();	}
if (use_4 != "on"){$('#intro_button_4').hide();	}
if (use_5 != "on"){$('#intro_button_5').hide();	}
if (admin != "1"){$('#intro_button_6').hide();	}

nulstil_intro(color1,color2,color3,color4,color5)


if (use_1 == "on"){show_intro_1(color1,color2,color3,color4,color5,mouseclick);}
else if (use_2 == "on"){show_intro_2(color1,color2,color3,color4,color5,mouseclick);	}
else if (use_3 == "on"){show_intro_3(color1,color2,color3,color4,color5,mouseclick);		}
else if (use_4 == "on"){show_intro_4(color1,color2,color3,color4,color5,mouseclick);		}
else if (use_5 == "on"){show_intro_5(color1,color2,color3,color4,color5,mouseclick);		}
}


function show_welcome_box(id)
{

var str = "id="+id;
$.ajax({
data: str,
type: "POST", 
url: "/infusions/intro_panel/vis_tekst.php", 
cache: false,
dataType: "html",
 success: function(data){
$('#intro_box').fadeOut("slow");
$("div#intro_box").html(data);
$('#intro_box').fadeIn("slow");
	   }
}); 

}

function show_intro_1(color1,color2,color3,color4,color5,mouseclick)
{
document.getElementById("button_fane1").style.background=mouseclick;	
document.getElementById("button_fane2").style.background=color2;	
document.getElementById("button_fane3").style.background=color3;	
document.getElementById("button_fane4").style.background=color4;	
document.getElementById("button_fane5").style.background=color5;	
document.getElementById("button_fane6").style.background=settings_color;	
show_welcome_box(1);
}

function show_intro_2(color1,color2,color3,color4,color5,mouseclick)
{
document.getElementById("button_fane1").style.background=color1;	
document.getElementById("button_fane2").style.background=mouseclick;	
document.getElementById("button_fane3").style.background=color3;	
document.getElementById("button_fane4").style.background=color4;	
document.getElementById("button_fane5").style.background=color5;	
document.getElementById("button_fane6").style.background=settings_color;	
show_welcome_box(2);
}


function show_intro_3(color1,color2,color3,color4,color5,mouseclick)
{
document.getElementById("button_fane1").style.background=color1;	
document.getElementById("button_fane2").style.background=color2;	
document.getElementById("button_fane3").style.background=mouseclick;	
document.getElementById("button_fane4").style.background=color4;	
document.getElementById("button_fane5").style.background=color5;	
document.getElementById("button_fane6").style.background=settings_color;	
show_welcome_box(3);
}


function show_intro_4(color1,color2,color3,color4,color5,mouseclick)
{
document.getElementById("button_fane1").style.background=color1;	
document.getElementById("button_fane2").style.background=color2;	
document.getElementById("button_fane3").style.background=color3;	
document.getElementById("button_fane4").style.background=mouseclick;	
document.getElementById("button_fane5").style.background=color5;	
document.getElementById("button_fane6").style.background=settings_color;	
show_welcome_box(4);
}

function show_intro_5(color1,color2,color3,color4,color5,mouseclick)
{
document.getElementById("button_fane1").style.background=color1;	
document.getElementById("button_fane2").style.background=color2;	
document.getElementById("button_fane3").style.background=color3;	
document.getElementById("button_fane4").style.background=color4;	
document.getElementById("button_fane5").style.background=mouseclick;	
document.getElementById("button_fane6").style.background=settings_color;	
show_welcome_box(5);
}


 
 function admin(color1,color2,color3,color4,color5,mouseclick)
 { 
document.getElementById("button_fane1").style.background=color1;	
document.getElementById("button_fane2").style.background=color2;	
document.getElementById("button_fane3").style.background=color3;	
document.getElementById("button_fane4").style.background=color4;	
document.getElementById("button_fane5").style.background=color5;	
document.getElementById("button_fane6").style.background=mouseclick;	

 $.ajax({
 type: "POST", 
 url: "/infusions/intro_panel/admin.php", 
cache: false,
dataType: "html",
scriptCharset: "utf-8",
 success: function(data){
  $('#intro_box').hide();
    $("div#intro_box").html(data);
  $('#intro_box').fadeIn("slow");
 	  }
}); 
 }
 
 function gem()
{
var str = $("form").serialize();
$.ajax({
data: str,
type: "POST", 
scriptCharset: "utf-8",
cache: false,
dataType: "html",
url: "/infusions/intro_panel/gem.php", 
 success: function(data){
$('#intro_box').hide();
  $("div#intro_box").html(data);
  $('#intro_box').fadeIn("slow");
  }
});
} 

function nulstil_intro(color1,color2,color3,color4,color5)
{
document.getElementById("button_fane1").style.background=color1;
document.getElementById("b2i_id1").style.background=color1;
document.getElementById("b3i_id1").style.background=color1;
document.getElementById("b4ai_id1").style.background=color1;
document.getElementById("b4i_id1").style.background=color1;
document.getElementById("b2i_id1a").style.background=color1;
document.getElementById("b3i_id1a").style.background=color1;
document.getElementById("b4ai_id1a").style.background=color1;
document.getElementById("b4i_id1a").style.background=color1;


document.getElementById("button_fane2").style.background=color2;
document.getElementById("b2i_id2").style.background=color2;
document.getElementById("b3i_id2").style.background=color2;
document.getElementById("b4ai_id2").style.background=color2;
document.getElementById("b4i_id2").style.background=color2;
document.getElementById("b2i_id2a").style.background=color2;
document.getElementById("b3i_id2a").style.background=color2;
document.getElementById("b4ai_id2a").style.background=color2;
document.getElementById("b4i_id2a").style.background=color2;

document.getElementById("button_fane3").style.background=color3;
document.getElementById("b2i_id3").style.background=color3;
document.getElementById("b3i_id3").style.background=color3;
document.getElementById("b4ai_id3").style.background=color3;
document.getElementById("b4i_id3").style.background=color3;
document.getElementById("b2i_id3a").style.background=color3;
document.getElementById("b3i_id3a").style.background=color3;
document.getElementById("b4ai_id3a").style.background=color3;
document.getElementById("b4i_id3a").style.background=color3;

document.getElementById("button_fane4").style.background=color4;
document.getElementById("b2i_id4").style.background=color4;
document.getElementById("b3i_id4").style.background=color4;
document.getElementById("b4ai_id4").style.background=color4;
document.getElementById("b4i_id4").style.background=color4;
document.getElementById("b2i_id4a").style.background=color4;
document.getElementById("b3i_id4a").style.background=color4;
document.getElementById("b4ai_id4a").style.background=color4;
document.getElementById("b4i_id4a").style.background=color4;

document.getElementById("button_fane5").style.background=color5;
document.getElementById("b2i_id5").style.background=color5;
document.getElementById("b3i_id5").style.background=color5;
document.getElementById("b4ai_id5").style.background=color5;
document.getElementById("b4i_id5").style.background=color5;
document.getElementById("b2i_id5a").style.background=color5;
document.getElementById("b3i_id5a").style.background=color5;
document.getElementById("b4ai_id5a").style.background=color5;
document.getElementById("b4i_id5a").style.background=color5;

document.getElementById("button_fane6").style.background=settings_color;
document.getElementById("b2i_id6").style.background=settings_color;
document.getElementById("b3i_id6").style.background=settings_color;
document.getElementById("b4ai_id6").style.background=settings_color;
document.getElementById("b4i_id6").style.background=settings_color;
document.getElementById("b2i_id6a").style.background=settings_color;
document.getElementById("b3i_id6a").style.background=settings_color;
document.getElementById("b4ai_id6a").style.background=settings_color;
document.getElementById("b4i_id6a").style.background=settings_color;	
}

