﻿// JavaScript Document

 $(document).ready(function() {

	populateElement('#url', 'adresa Vašich stránek');	
	populateElement('#name', 'zadejte Vaše jméno');	
	populateElement('#email', 'Vaše emailová adresa');
	populateElement('#question', 'Váš dotaz');
	
	$("#tabs > ul").tabs();
	$("#side-menu").accordion({
			header: "h4"
		});
	$("#url-box").focus();
	
	$("#te-box img").hover(
      function () {
		$(this).attr("src", "img/i-small.png");
      }, 
      function () {
		$(this).attr("src", "img/i-small.gif");
      }
    );

	$("#te div").hover(
      function () {
		$(this).children("img").attr("src", "img/i-small.png");
      }, 
      function () {
		$(this).children("img").attr("src", "img/i-small.gif");
		$("#te-details").html("Máme nejvíce kontrolních bodů pro monitoring serverů v ČR");		
		$("#arrow img").css("padding-left", "618px");
      }
    );

	$("#te1").hover(
      function () {
        $("#te-details").html("<strong>DialTelecom</strong> &raquo; Praha, Křižíkova ulice &raquo; rychlost připojení: 1Gbit/s, resp. 100Mbit/s");
		$("#arrow img").css("padding-left", "40px");
      }, function () {}
    );
	$("#te2").hover(
      function () {
        $("#te-details").html("<strong>GTS Novera</strong> &raquo; Praha, Želivského ulice &raquo; rychlost připojení: 1Gbit/s, resp. 100Mbit/s");
		$("#arrow img").css("padding-left", "80px");
      }, function () {}
    );
	$("#te3").hover(
      function () {
        $("#te-details").html("<strong>Ignum</strong> &raquo; Praha, Želivského ulice &raquo; rychlost připojení: 1Gbit/s, resp. 100Mbit/s");
		$("#arrow img").css("padding-left", "120px");
      }, function () {}
    );
	$("#te4").hover(
      function () {
        $("#te-details").html("<strong>Sitel</strong> &raquo; Praha, U Elektrárny &raquo; rychlost připojení: 1Gbit/s, resp. 100Mbit/s");
		$("#arrow img").css("padding-left", "160px");
      }, function () {}
    );
	$("#te5").hover(
      function () {
        $("#te-details").html("<strong>Superhosting</strong> &raquo; Praha, Tiskařská ulice &raquo; rychlost připojení: 1Gbit/s, resp. 100Mbit/s");
		$("#arrow img").css("padding-left", "200px");
      }, function () {}
    );
	$("#te6").hover(
      function () {
        $("#te-details").html("<strong>Freebone</strong> &raquo; Praha, Tiskařská ulice &raquo; rychlost připojení: 10Mbit/s");
		$("#arrow img").css("padding-left", "240px");
      }, function () {}
    );
	$("#te7").hover(
      function () {
        $("#te-details").html("<strong>Master Internet</strong> &raquo; Praha, Tiskařská ulice &raquo; rychlost připojení: 10Mbit/s");
		$("#arrow img").css("padding-left", "280px");
      }, function () {}
    );
	$("#te8").hover(
      function () {
        $("#te-details").html("<strong>Pe3ny.net</strong> &raquo; Praha, Zvoníčkova ulice &raquo; rychlost připojení: 10Mbit/s");
		$("#arrow img").css("padding-left", "320px");
      }, function () {}
    );
	$("#te9").hover(
      function () {
        $("#te-details").html("<strong>Airwaynet</strong> &raquo; Praha, Hládkov &raquo; rychlost připojení: ADSL, WiFi, kabel");
		$("#arrow img").css("padding-left", "360px");
      }, function () {}
    );
	$("#te10").hover(
      function () {
        $("#te-details").html("<strong>K+K cable</strong> &raquo; Tábor, Trocnovská ulice &raquo; rychlost připojení: ADSL, WiFi, kabel");
		$("#arrow img").css("padding-left", "400px");
      }, function () {}
    );
	$("#te11").hover(
      function () {
        $("#te-details").html("<strong>Nextra</strong> &raquo; Praha, Senovážná ulice &raquo; rychlost připojení: ADSL, WiFi, kabel");
		$("#arrow img").css("padding-left", "440px");
      }, function () {}
    );
	$("#te12").hover(
      function () {
        $("#te-details").html("<strong>O2</strong> &raquo; Praha, U Měsťanského pivovaru &raquo; rychlost připojení: ADSL, WiFi, kabel");
		$("#arrow img").css("padding-left", "480px");
      }, function () {}
    );
	$("#te13").hover(
      function () {
        $("#te-details").html("<strong>Acenet</strong> &raquo; Budapešť, Maďarsko");
		$("#arrow img").css("padding-left", "520px");
      }, function () {}
    );
	$("#te14").hover(
      function () {
        $("#te-details").html("<strong>Vnet</strong> &raquo; Bratislava, Slovensko");
		$("#arrow img").css("padding-left", "560px");
      }, function () {}
    );

	$('#callInit').click(function(event) { 
		event.preventDefault();
		$("#foot4").hide();
		$("#call").show();		
	})
	$('#callHide').click(function(event) { 
		event.preventDefault();
		$("#foot4").show();
		$("#call").hide();		
	})

});	

 // Search box text
  function populateElement(selector, defvalue) {
    if($.trim($(selector).val()) == "") {
        $(selector).val(defvalue);
    }
  
    $(selector).focus(function() {
        if($(selector).val() == defvalue) {
			if(selector == "#url") {
				$(selector).val("http://");
			} else {
				$(selector).val("");
			}
        }
    });
    
    $(selector).blur(function() {
		if(selector == "#url") {
			if($.trim($(selector).val()) == "http://") {
    	        $(selector).val(defvalue);
	        }
		} else {
			if($.trim($(selector).val()) == "") {
    	        $(selector).val(defvalue);
	        }
		}
    });
 }
