$(function() {
    //////////////////////////////////////////////////////////////
    $('.link').stop().animate({
        backgroundPosition: "100%"
    },
    {
        duration: 1
    }).mouseover(function() {
        $(this).stop().animate({
            backgroundPosition: "90%"
        },
        {
            duration: 200
        });
    }).mouseout(function() {
        $(this).stop().animate({
            backgroundPosition: "100%"
        },
        {
            duration: 200
        });
    }); //////////////////////////////////////////////////////////////
    $('.ul_level_0 a').animate({
        backgroundPosition: "100%"
    },
    {
        duration: 1
    }).mouseover(function() {
        $(this).stop().animate({
            backgroundPosition: "0%"
        },
        {
            duration: 400
        });
    }).mouseout(function() {
        $(this).stop().animate({
            backgroundPosition: "100%"
        },
        {
            duration: 400
        });
    });
    $('.ul_level_0 a.selected').animate({
        backgroundPosition: "0%"
    },
    {
        duration: 1
    }).mouseover(function() {
        $(this).stop().animate({
            backgroundPosition: "0%"
        },
        {
            duration: 400
        });
    }).mouseout(function() {
        $(this).stop().animate({
            backgroundPosition: "0%"
        },
        {
            duration: 400
        });
    }); ///////////////////////////////////////////////////////////////
    $('.fader').stop().fadeTo(200, 0.7).mouseover(function() {
        $(this).stop().fadeTo(400, 1)
    }).mouseout(function() {
        $(this).stop().fadeTo(400, 0.7)
    }); ////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////
   //pngfix();
					
					
});

function pngfix(){
 if ($.browser.msie) {
	 	
        if (parseInt(jQuery.browser.version) < 7) {
            $.include(_location + 'includes/skins/default/css/ie6.css');
            $.include(_location + 'lib/js/jquery/plugins/DD_belatedPNG_0.0.7a.js', function() {

                setTimeout(function() {

                    DD_belatedPNG.fix('img,div,a');

                },
                1000);

            });
        } else {
            $.include(_location + 'includes/skins/default/css/ie7.css');
        }

    }	
}

$(function() {
    //////////////////////////////////////////////////////////////
    $('.link').stop().animate({
        backgroundPosition: "100%"
    },
    {
        duration: 1
    }).mouseover(function() {
        $(this).stop().animate({
            backgroundPosition: "90%"
        },
        {
            duration: 200
        });
    }).mouseout(function() {
        $(this).stop().animate({
            backgroundPosition: "100%"
        },
        {
            duration: 200
        });
    }); //////////////////////////////////////////////////////////////
    $('.ul_level_0 a').animate({
        backgroundPosition: "100%"
    },
    {
        duration: 1
    }).mouseover(function() {
        $(this).stop().animate({
            backgroundPosition: "0%"
        },
        {
            duration: 400
        });
    }).mouseout(function() {
        $(this).stop().animate({
            backgroundPosition: "100%"
        },
        {
            duration: 400
        });
    });
    $('.ul_level_0 a.selected').animate({
        backgroundPosition: "0%"
    },
    {
        duration: 1
    }).mouseover(function() {
        $(this).stop().animate({
            backgroundPosition: "0%"
        },
        {
            duration: 400
        });
    }).mouseout(function() {
        $(this).stop().animate({
            backgroundPosition: "0%"
        },
        {
            duration: 400
        });
    }); ///////////////////////////////////////////////////////////////
    $('.fader').stop().fadeTo(200, 0.7).mouseover(function() {
        $(this).stop().fadeTo(400, 1)
    }).mouseout(function() {
        $(this).stop().fadeTo(400, 0.7)
    }); ////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////
    if ($.browser.msie) {
        if (parseInt(jQuery.browser.version) < 7) {
            $.include(_location + 'includes/skins/default/css/ie6.css');
            $.include(_location + 'lib/js/jquery/plugins/DD_belatedPNG_0.0.7a.js', function() {

                setTimeout(function() {

                    DD_belatedPNG.fix('img,div,a');

                },
                1000);

            });
        } else {
			if (parseInt(jQuery.browser.version) < 8)
				{
					$.include(_location + 'includes/skins/default/css/ie7.css');
				}else
				{
					$.include(_location + 'includes/skins/default/css/ie8.css');
				}
        }

    }
});

function closepopup()
{
	
 $("#dialog").fadeOut("slow", function() {
 $("#dialog").jqmHide();	
									   });
}



function contact() {
    $('#dialog').jqm({
        ajax: _location + "includes/mod/contact/index.php",
        ajaxText: 'Loading',
        onLoad: function() {

            $("#form1").submit(function() {
                $("#errors").html("Loading.. Please Wait.");
                var str = $(this).serialize();
                $.ajax({
                    type: "POST",
                    url: _location + "includes/mod/contact/index.php",
                    data: str,
                    success: function(msg) {
                        if (msg.length > 0) {
                            $("#errors").html(msg);
                        }
                        else {
                            $("#dialog").html('<div class="success">Thank You for your message. We will get back to you shortly.</div>');
                            setTimeout(function() {
                                $("#dialog").fadeOut("slow", function() {

                                    $("#dialog").jqmHide();

                                });
                            },
                            5000);
                        }
                    }
                });
                return false;
            });

        }
    });
    $("#dialog").jqmShow();

}

function quote() {

    $('#dialog').jqm({
        ajax: _location + "includes/mod/quote/index.php",
        ajaxText: 'Loading',
        onLoad: function() {

            $("#form1").submit(function() {
                $("#errors").html("Loading.. Please Wait.");
                var str = $(this).serialize();
                $.ajax({
                    type: "POST",
                    url: _location + "includes/mod/quote/index.php",
                    data: str,
                    success: function(msg) {
                        if (msg.length > 0) {
                            $("#errors").html(msg);
                        }
                        else {
                            $("#dialog").html('<div class="success">Thank You for your message. We will get back to you shortly.</div>');
                            setTimeout(function() {
                                $("#dialog").fadeOut("slow", function() {
                                    $("#dialog").jqmHide();
                                });
                            },
                            5000);
                        }
                    }
                });
                return false;
            });
        }
    });
    $("#dialog").jqmShow();

}


function career() {
    $('#dialog').jqm({
        ajax: _location + "includes/mod/career/index.php",
        ajaxText: 'Loading',
        onLoad: function() {
		careersubmit();           
        }
    });
    $("#dialog").jqmShow();

}


function careersubmit(){
	
 $('#form1').ajaxForm({

                type:"POST",
				success: function(msg) {
                    if (msg.length > 327) {
						$("#dialog").html(msg);
						careersubmit();
						$(".jqmClose").click(function()
													 {
														closepopup();
													});
						
                    }
                    else {
                        $("#dialog").html('<div class="success">Thank You for your message. We will get back to you shortly.</div>');
                        setTimeout(function() {
                            $("#dialog").fadeOut("slow", function() {
                              $("#dialog").jqmHide();
                            });
                        },
                        5000);
                    }
                }
            });	
}

