$(function(){
	initCufon();
});
function initCufon(){
	Cufon.replace('#header .bottom h2', { fontFamily: '"DIN-light"'});
	Cufon.replace('.drop .learn-box h2, #header .bottom h2 strong, #visual .column ul li a strong, .carusel-content li .text h3, .carusel-content li .text h2, .latest-news .title h2, .featured-box h2', { fontFamily: '"DIN-bold"'});
	Cufon.replace('.featured-box h3, .affiliates h3, .top-title h2', { fontFamily: '"DIN-bold"'});
Cufon.replace('#carusel3 .carusel-content li .holder .text h3, #carusel3 .carusel-content li .holder .text h2', { fontFamily: '"DIN-bold"'});
	Cufon.replace('#carusel3 .carusel-content li .holder .text h3 strong, #carusel3 .carusel-content li .holder .text h2 span', { fontFamily: '"DIN-bold"'});
	
	Cufon.replace('.banner .banner-steps ul li a strong', { fontFamily: '"DIN-bold"'});
	Cufon.replace('.banner #slides li .text-box h3 a', { fontFamily: '"DIN-bold"'});
}


$(document).ready(function(){

    // Slide effect
    var _parentSlide = 'div.form-events';
    var _linkSlide = 'a.open-close';
    var _slideBlock = 'div.slide';
    var _openClassS = 'active';
    var _durationSlide = 500;
    
    $(_parentSlide).each(function(){
		if (!$(this).is('.'+_openClassS)) {
			$(this).find(_slideBlock).css('display','none');
			$(".slider").hide();
		}
    });
    $(_linkSlide,_parentSlide).click(function(){
		if ($(this).parents(_parentSlide).is('.'+_openClassS)) {
			$(".slider").hide();
			$(this).parents(_parentSlide).removeClass(_openClassS);
			$(this).parents(_parentSlide).find(_slideBlock).slideUp(_durationSlide);
			
		} else {
			$(".slider").show();
			$(this).parents(_parentSlide).addClass(_openClassS);
			$(this).parents(_parentSlide).find(_slideBlock).slideDown(_durationSlide);
			
		}
		return false;
    });
    
});


function hideFormText() {
	var _inputs = document.getElementsByTagName('input');
	var _txt = document.getElementsByTagName('textarea');
	var _value = [];
	
	if (_inputs) {
		for(var i=0; i<_inputs.length; i++) {
			if (_inputs[i].type == 'text' || _inputs[i].type == 'password') {
				
				_inputs[i].index = i;
				_value[i] = _inputs[i].value;
				
				_inputs[i].onfocus = function(){
					if (this.value == _value[this.index])
						this.value = '';
				}
				_inputs[i].onblur = function(){
					if (this.value == '')
						this.value = _value[this.index];
				}
			}
		}
	}
	if (_txt) {
		for(var i=0; i<_txt.length; i++) {
			_txt[i].index = i;
			_value['txt'+i] = _txt[i].value;
			
			_txt[i].onfocus = function(){
				if (this.value == _value['txt'+this.index])
					this.value = '';
			}
			_txt[i].onblur = function(){
				if (this.value == '')
					this.value = _value['txt'+this.index];
			}
		}
	}
}
if (window.addEventListener)
	window.addEventListener("load", hideFormText, false);
else if (window.attachEvent)
	window.attachEvent("onload", hideFormText);

