

jQuery(document).ready(function() {

    jQuery('.qtip[title]').qtip(
        { 
            style: { 
                name: 'cream',
                textAlign: 'center',
                tip: true,
                      background: '#13171b',
                            border: {
                                 width: 0,
                                 radius: 3,
                                 color: '#13171b'
                            },
                color: 'white',
                fontSize: '85%',
                width: {
                    max: 500,
                }
            }, 
            position: {
                corner: {
                    target: 'topMiddle',
                    tooltip: 'bottomMiddle'
                }
            }
        }
    )
    
    Shadowbox.init({
        handleOversize: "drag",
        modal: false,
        animateFade: false,
        resizeDuration: 0.1
    });


});




function Form_FieldAndDesc_Alert(formField, formFieldDesc)
{
		formField.focus() ;
		formField.style.borderColor = "#990000" ;
		formField.style.borderWidth = "2px" ;
		formFieldDesc.className = "form_smalltext_red" ;
}

function Form_Field_Alert(formField)
{
		formField.focus() ;
		formField.style.borderColor = "#990000" ;
		formField.style.borderWidth = "2px" ;
}

function Form_FieldAndDesc_Reset(formField, formFieldDesc)
{
		formField.style.borderColor = "#777777" ;
		formField.style.borderWidth = "1px" ;
		formFieldDesc.className = "form_smalltext" ;
}

function Form_Field_Reset(formField)
{
		formField.style.borderColor = "#777777" ;
		formField.style.borderWidth = "1px" ;
}


function insert_BBcode(id,tag,val)
{
	var obj = document.getElementById(id);
	var start = "[" + tag + "]";
	var end = "[/" + tag + "]";
	var range;

	if(document.all)
	{
		range= document.selection.createRange();
		if(!val)
			val="";
		if(range.text)
		val = range.text;
		range.text = start + val + end;
		range.moveStart("character",-(end.length+val.length));
		range.moveEnd("character",-(end.length));
		range.select();
	}
	else
	{
		var s = obj.selectionStart;
		var e = obj.selectionEnd;
		var x;
		x = obj.value.substring(s,e);
		x = start + x + end;
		obj.value = obj.value.substring(0,s) + x + obj.value.substring(s+x.length-7,obj.value.length);
		obj.selectionStart = s+start.length;
		obj.selectionEnd = s+x.length-end.length;
	}
	obj.focus();
}

// LOGÓKÉPET ANIMÁLÓ FÜGGVÉNY

function slideSwitch() {
    var $active = $('.logo img.active');

    if ( $active.length == 0 ) $active = $('.logo img:last');

    var $next =  $active.next().length ? $active.next()
        : $('.logo img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 7500 );
});


