 <!--  
 
     function showOdp(elId){
       var el = document.getElementById(elId);
       if (el.style.display == "none"){
          var tab = document.getElementById("faqDiv").getElementsByTagName("p");
          for (i = 0; i < tab.length; i++){
             if (tab[i].style.display != "none"){
                tab[i].style.display = "none";
                break;
             }
          }
          el.style.display = 'block';
       }else {
          el.style.display = 'none';
       }
       
    }
 
    function showHome(){
         stop();
         window.location = global_path + "?page=Home&service=page";
    }
    
    function showMyAccount(){
          stop();
          window.location = global_path + "?page=MyAccHome&service=page";
    }
    
    function showPrice(button){
        var prices = $('#top10 div');
        if (prices.length > button.value){
        	$('#priceBrutto').html(prices.eq(button.value).html());
        }
     }
     
     function isCorrectNumber(s) {
        var tab = s.split("\n");
        for(z = 0; z < tab.length; z++){
           if (tab[z] == "") continue;
           var tab1 = tab[z].split("\r");
           for(j = 0; j < tab1.length; j++){
              if (tab1[j] == "") continue;
              if (!isCorrectTemplate(tab1[j])) return false;
           }
        }
        return true;
     }
     
     function isCorrectTemplate(s) {
        var result = true;
        
        // --- badam inne warunki tylko jezeli poprzedni byl ok
        if( result) {
            // --- sprawdzam, czy w ogole nie jest null lub pusty ciag znakow
            if( s == null || s == "")
                result = false;
        }

        // --- badam inne warunki tylko jezeli poprzedni byl ok
        // --- sprawdzam, czy sklada sie tylko z dozwolonych znakow
        if( result) {
            for(i = 0; i < s.length; ++i) {
                if( "0123456789*+".indexOf(s.charAt( i)) < 0) {
                    // --- niedozwolony znak!
                    result = false;
                    break;
                }
            }
        }
        
        // --- badam inne warunki tylko jezeli poprzedni byl ok
        if( result) {
            // --- sprawdzam, czy ma dlugosc mniejsza niz maksymalna
            if( s.length > 17) {
                result = false;
            }
        }
        
        if( result) {
            if( s.indexOf( "00") == 0) {
                if( s.length > 16) {
                    result = false;
                }
            } else 
            if( s.indexOf( "0") == 0) {
                if( s.length > 10) {
                    result = false;
                }
            } else 
            if( s.indexOf( "+") == 0) {
                if( s.length > 16) {
                    result = false;
                }
            } else 
                if( s.length > 9) {
                    result = false;
                }
        }
        
        // --- badam inne warunki tylko jezeli poprzedni byl ok
        if( result) {
            // --- sprawdzam, czy gwiazdka, jezeli w ogole jest, to jest na koncu
            if( s.indexOf("*") >= 0) {
                if( s.indexOf("*") < s.length - 1) {
                    result = false;
                }
            }
        }        
        
        // --- badam inne warunki tylko jezeli poprzedni byl ok
        if( result) {
            // --- plus moze byc tylko na poczatku
            if( s.indexOf("+") > 0) {
                result = false;
            }
        }        
        
        // --- jezeli nie ma gwiazdki, to musi miec przynajmniej 7 znakow
        if( result) {
            if( s.indexOf("*") < 0) {
                if( s.length < 9) {
                    result = false;
                }
            }
        }
        
        return result;
    }
     
     function checkFormBuyAndBindForContacts(){
        var number = document.getElementById("TextField").value;
        if (number == "" || !isCorrectNumber(number)){
            number = "";
        }
        var cd = document.getElementById("contactSelect");
        if (cd != null && cd.selectedIndex > 0) number = "OK";
        if (number == "") {
            createCustomAlert(global_badtemplate, false, global_badtemplateW, global_badtemplateH);
            return;
        } 
        var radiogroup = document.getElementById('top10').getElementsByTagName("input");
        var is = false;
        for(i = 0; i < radiogroup.length; i++){
           if (radiogroup[i].type == "radio" && radiogroup[i].checked){
              is = true;
              break;
           }
        }
        if (!is){
           createCustomAlert(global_chooseset, false, global_choosesetW, global_choosesetH);
           return;
        }
        doWait(document.getElementById("buyAndBindForContacts"));
        urchinTracker('0 regu&#x0142; Kup kolejny');
        document.getElementById("buyAndBindForContacts").submit();
     }
     function checkFormBindForContactsPremia(){
   		document.getElementById("premiaBuy").value = "true";
       	checkFormBuyAndBindForContacts();
        }
     
     function checkFormBindForContacts(){
        var number = document.getElementById("TextField").value;
        if (number == "" || !isCorrectNumber(number)){
            number = "";
        }
        var contactSelectElement = document.getElementById("contactSelect");
        if (contactSelectElement != null && contactSelectElement.selectedIndex > 0) {
			number = "OK";
		}
        if (number == "") {
            createCustomAlert(global_badtemplate, false, global_badtemplateW, global_badtemplateH);
            return;
        } 
        doWait(document.getElementById("bindForContacts"));
        urchinTracker('1 regu&#x0142;a Komu&#x015B;');
        document.getElementById("bindForContacts").submit();
     }
     
	 
	 function checkFormBuyAndBindRandomPremia(){
	    document.getElementById("premiaBuy").value = "true";
       	checkFormBuyAndBindRandom();
	 }
     
	 
     function checkFormBuyAndBindRandom(){
        var radiogroup = document.getElementById('top10').getElementsByTagName("input");
        var is = false;
        for(i = 0; i < radiogroup.length; i++){
           if (radiogroup[i].type == "radio" && radiogroup[i].checked){
              is = true;
              break;
           }
        }
        if (!is){
           createCustomAlert(global_chooseset, false, global_choosesetW, global_choosesetH);
           return;
        }
        doWait(document.getElementById("buyAndBindRandom"));
        urchinTracker('Losowo Losowo');
        document.getElementById("buyAndBindRandom").submit();
     }
     
     function checkForm3(b){
        var label = document.getElementById("TextField").value;
        var author = document.getElementById("TextField_0").value;
        var file = document.getElementById("Upload").value;
        
        if (label == "" || author == "" || file == "") {
           createCustomAlert(global_fillform, false, global_fillformW, global_fillformH);
           return;
        }
        doWait(b);
        document.getElementById("Form").submit();
     }
     
     function checkNewRuleForm(){
        var tab = document.getElementById('newRuleSets').getElementsByTagName("strong");
        if (tab == null || tab.length == 0){
           createCustomAlert(global_ruleset, false, global_rulesetW, global_rulesetH);
           return;
        }
        tab = document.getElementById('newRuleGroups').getElementsByTagName("strong");
        if (tab == null || tab.length == 0){
           createCustomAlert(global_rulecontact, false, global_rulecontactW, global_rulecontactH);
           return;
        }
        if (!document.getElementById('newActivWork').checked && !document.getElementById('newActivFree').checked){
           createCustomAlert(global_ruleactiv, false, global_ruleactivW, global_ruleactivH);
           return;
        }
        doWait(document.getElementById("newRule"));
        document.getElementById("newRule").submit();
     }
     
     function checkEditRuleForm(){
        var tab = document.getElementById('editRuleSets').getElementsByTagName("strong");
        if (tab == null || tab.length == 0){
           createCustomAlert(global_ruleset, false, global_rulesetW, global_rulesetH);
           return;
        }
        tab = document.getElementById('editRuleGroups').getElementsByTagName("strong");
        if (tab == null || tab.length == 0){
           createCustomAlert(global_rulecontact, false, global_rulecontactW, global_rulecontactH);
           return;
        }
        if (!document.getElementById('editActivWork').checked && !document.getElementById('editActivFree').checked){
           createCustomAlert(global_ruleactiv, false, global_ruleactivW, global_ruleactivH);
           return;
        }
        doWait(document.getElementById("editRule"));
        document.getElementById("editRule").submit();
     }
     
     function validateGroupName( field) {
            valid   = true;
            len     = field.length;
            if (len >= 100){
               createCustomAlert(global_toolong, false, global_toolongW, global_toolongH);      
               valid=false;
               return;
            }
            disallow = 'ĄąĆćĘęŁłŃńÓóŚśŹźŻż`~!@#$%^&()_=[]{};",.<>/?';                
            for( i = 0; i < len; ++i) {
                chr = field.charAt( i);
                if( disallow.indexOf( chr) >= 0) {
                    valid = false;
                    createCustomAlert(global_polish, false, global_polishW, global_polishH);
                    break;
                }
            }    
            return valid;
        }
     
     function checkSendClaim(){
    	 var msisdn = document.getElementById('claimMsisdn').value;
         var content = document.getElementById('claimContent').value;
         var name = document.getElementById('claimName').value;
         var email = document.getElementById('claimEmail').value;
         var key = document.getElementById('claimKeyVeri').value;
         if (msisdn == "" || content == "" || name == "" || email == ""){
            createCustomAlert(global_fillform, false, global_fillformW, global_fillformH);
            return false;
         }
         if (key != document.getElementById('answerh').value ){
            createCustomAlert("B&#x0142;&#x0119;dny kod weryfikacyjny", false, global_fillformW, global_fillformH);
            return false;
          }
         document.getElementById('newClaim').submit();
     }
     
     function checkNewContactForm(){
        var name = document.getElementById('newContactName').value;
        var template = document.getElementById('newContactTemplate').value;
        if (name == "" || template == "" ){
           createCustomAlert(global_fillform, false, global_fillformW, global_fillformH);
           return;
        }
        if (template.indexOf("Numer") >= 0 || !isCorrectNumber(template)){
           createCustomAlert(global_badtemplate, false, global_badtemplateW, global_badtemplateH);
           return;
        }
        if (validateGroupName(name)){
           document.getElementById('newContact').submit();
        }
     }
     
     function checkEditContactForm(){
        var name = document.getElementById('editName').value;
        var template = document.getElementById('editTemplate').value;
        if (name == "" || template == ""){
           createCustomAlert(global_fillform, false, global_fillformW, global_fillformH);
           return false;
        }
        if (!isCorrectNumber(template)){
           createCustomAlert(global_badtemplate, false, global_badtemplateW, global_badtemplateH);
           return false;
        }
        if (validateGroupName(name)){
           document.getElementById('editContact').submit();
        }
     }
     
     function isNumber(str, max){
        for (i = 0; i < str.length; i++){
           if (str.charAt(i) < '0' || str.charAt(i) > '9') {
              return false;
           }
        }
        return (parseFloat(str) > 0 && parseFloat(str) <= max);
     }
     
     function isCorrectDate(dat){
        var tab = dat.split("-");
        if (tab.length == 3 && tab[0].length == 2 && tab[1].length == 2 && tab[2].length == 4){
            return isNumber(tab[0], 31) && isNumber(tab[1], 12) && isNumber(tab[2], 9999);
        }
        return false;
     }
     
     function checkNewCalendar(){
        var datFrom = document.getElementById('calendar_newDateFrom').value;
        if (!isCorrectDate(datFrom)){
           createCustomAlert(global_dateformat + " [" + datFrom + "]", false, global_dateformatW, global_dateformatH);
           return;
        }
        var datTo = document.getElementById('calendar_newDateTo').value;
        if (!isCorrectDate(datTo)){
           createCustomAlert(global_dateformat + " [" + datTo + "]", false, global_dateformatW, global_dateformatH);
           return;
        }
        var sel = document.getElementById('newTimeFrom');
        var tFrom = parseFloat(sel.options[sel.selectedIndex].text);
        sel = document.getElementById('newTimeTo');
        var tTo = parseFloat(sel.options[sel.selectedIndex].text);
        if (tTo <= tFrom){
           createCustomAlert(global_hours, false, global_hoursW, global_hoursH);
           return;
        }
        document.getElementById('newCalendar').submit();
     }
     
     function checkEditCalendar(){
        var datFrom = document.getElementById('calendar_editDateFrom').value;
        if (!isCorrectDate(datFrom)){
           createCustomAlert(global_dateformat + " [" + datFrom + "]", false, global_dateformatW, global_dateformatH);
           return;
        }
        var datTo = document.getElementById('calendar_editDateTo').value;
        if (!isCorrectDate(datTo)){
           createCustomAlert(global_dateformat + " [" + datTo + "]", false, global_dateformatW, global_dateformatH);
           return;
        }
        var sel = document.getElementById('editTimeFrom');
        var tFrom = parseFloat(sel.options[sel.selectedIndex].text);
        sel = document.getElementById('editTimeTo');
        var tTo = parseFloat(sel.options[sel.selectedIndex].text);
        if (tTo <= tFrom){
           createCustomAlert(global_hours, false, global_hoursW, global_hoursH);
           return;
        }
        document.getElementById('editCalendar').submit();
     }
     //-->
     
     function urchinTracker(url){
    	 return 0;
     }
	 
	 
	 $(document).ready(function() {
		$('.callendar').datepicker({dateFormat: "dd-mm-yy"});
	 });
