document.write( '<div id = "loading"><img style = "float: left; margin-top: 2px;" src = "/Graphics/Common_Graphics/primary_loader.gif" ></div>' );   
    
addLoadEvent( function() 
{
    document.getElementById( "loading" ).style.display = "none";
});

$( document ).ready( function()
{
    
    create_main_Menu( "#slide_main_Menu", 100, 15, 150, .8 );
    
    round_Corners( 'main_Menu_BLOCK', 8, 8 );
    
    round_Corners( 'check_domain_Panel', 8, 8 );
    
    round_Corners( 'payment_Panel', 8, 8 );
                                                 
    round_Corners( 'FAQ_Content', 8, 8, 8, 8 );
    
    round_Corners( 'Footer', 0, 0, 12, 12 );
    
    round_Corners( 'OHPF_Holder', 10, 10, 10, 10 );
   
    round_Corners( 'attached_file_Div', 0, 0, 20, 20 );
    
    round_Corners( 'PP_subpages_Holder', 10, 10, 10, 10 );
       
    round_Corners( 'PSP_message_Holder', 10, 10, 10, 10 );
    
    round_Corners( 'SQ_Holder', 0, 0, 10, 10 );
    
    jQuery( '#FAQ_slider_Holder' ).accordion();
    
    $( document ).pngFix(); 
    
    window.attachEvent( "onload", IE_Focus ); 
    
    set_site_Height();
    
    $( function()
    {
        
        $("[title]").mbTooltip({ 
      
            opacity : .90,      
            wait: 10,           
            cssClass:"default", 
            timePerWord:70,      
            hasArrow:false,            
            hasShadow:true,
            imgPath:"images/",
            ancor:"mouse", 
            shadowColor:"black", 
            mb_fade: 200
    
        });
  
    });
    
    $( "#contact_Accent_D" ).submit( function()
    {
    
        var str = $( this ).serialize();

        $.ajax( { type: "POST", url: "web_support.php?action=send_new_request", data: str, success: function( msg )
        {
            
            $( "#data_error_Panel" ).ajaxComplete( function( event, request, settings )
            {

                if( msg == 'OK' )
                {
        
                     result = '<div style = "color: #000;" >Вашето съобщение беше изпратено успешно! <br /><br /> Your message was sent successfully!</div>';
        
                }
                else
                {
        
                    result = msg;
                
                }

                $( this ).html( result );
                
                });

            }

        });

        return false;

    });

});

IE_Focus = function() 
{
    
    var fields = document.getElementsByTagName( "INPUT" );
    
    for( var i = 0; i < fields.length; i ++ ) 
    {
        
        fields[ i ].onfocus = function() 
        {
            
            this.className += " IE_Focus_Fix";
        
        }
        
        fields[ i ].onblur = function() 
        {
            
            this.className = this.className.replace( new RegExp( " IE_Focus_Fix\\b"), "" );
        
        }
    
    }

}

set_site_Height = function()
{
    
    var sb_height = document.getElementById( 'left_Sidebar' ).offsetHeight;
    
    if( document.getElementById( 'main_Content' ) )
    {
    
        var mc_height = document.getElementById( 'main_Content' ).offsetHeight;
        
        if( mc_height > sb_height )
        {
            
            document.getElementById( 'left_Sidebar' ).style.height = mc_height;
            
        }
        
        if( mc_height < sb_height )
        {
            
            document.getElementById( 'main_Content' ).style.height = sb_height; 
            
        }  
        
    }
    
    if( document.getElementById( 'main_Content_2' ) )
    {
    
        var mc_height_2 = document.getElementById( 'main_Content_2' ).offsetHeight;
        
        if( mc_height_2 > sb_height )
        {
            
            document.getElementById( 'left_Sidebar' ).style.height = mc_height_2;
            
        }
        
        if( mc_height_2 < sb_height )
        {
            
            document.getElementById( 'main_Content_2' ).style.height = sb_height; 
            
        }  
        
    }  
    
}

new_domain_Hint = function( content )
{
    
    var hint = content;
    
    document.getElementById( 'domain_hint' ).innerHTML = hint;

}

function check_boxes_Control( theElement ) 
{
    
    var theForm = theElement.form, z = 0;
    
    for( z = 0; z < theForm.length; z ++ )
    {
      
        if( theForm[z].type == 'checkbox' && theForm[z].name != 'checkall' )
        {
      
            theForm[z].checked = theElement.checked;
            
        }
     
    }
    
}

function addLoadEvent( func ) 
{
  
    var oldonload = window.onload;
  
    if( typeof window.onload != 'function' &&  document.readyState != "loaded" && document.readyState != "complete" ) 
    {
    
        window.onload = func;
  
    } 
    else 
    {
    
        window.onload = function() 
        {
      
            if( oldonload ) 
            {
        
                oldonload();
      
            }
      
            func();
    
        }
  
    }

}

function loadSubmit() 
{

    ProgressImage = document.getElementById( 'progress_image' );
    
    document.getElementById( 'progress' ).style.visibility = 'visible';

    setTimeout( 'ProgressImage.src = ProgressImage.src', 100 );

    return true;

}

function send_new_Request()
{
    
    document.getElementById( 'WDP_order_Link' ).style.visibility = 'hidden';
    
    document.getElementById( 'WDP_contact_Form' ).style.display = 'block';
    
    set_site_Height();   
    
}
