$(document).ready(function () {

    //Larger thumbnail preview

    $("ul.thumb-hover li a").hover(function() {
        $(this).parent().css({'z-index' : '1000'});
    	//$(this).parent().find('img.new').animate({marginTop: '25px'}, 0);
    	$(this).parent().find('img.new').hide();
    	$(this).parent().find('img.imgthumb').addClass("hover")
    		.css({
    			marginTop: '-110px',
    			marginLeft: '-110px',
    			top: '50%',
    			left: '40%',
    			width: '252px',
    			height: '191px',
    			border: '10px solid #dc1607'
    		});

    	} , function() {
    	$(this).parent().css({'z-index' : '0'});
    	//$(this).parent().find('img.new').animate({marginTop: '0'}, 0);
    	$(this).parent().find('img.new').show();
    	$(this).parent().find('img.imgthumb').removeClass("hover")
    		.css({
    			marginTop: '0',
    			marginLeft: '0',
    			top: '10px',
    			left: '30px',
    			width: '142px',
    			height: '120px',
    			padding: '0',
                border: '0'
    		});
    });

    /*$("ul.thumb-hover li a").hover(function() {
    	$(this).parent().siblings().children().css({'z-index' : '101'});
    	$(this).next().css({'z-index' : '1000'});
    	$(this).next().show();

    	} , function() {
    	$(this).parent().siblings().children().css({'z-index' : '0'});
    	$(this).next().css({'z-index' : '999'});
    	$(this).next().hide();
    });*/

    /*$("ul.thumb-hover li a").hover(function() {
        var imgrel = $(this).attr('rel');
        $('.popup-area').fadeIn(220);
        $('#'+imgrel).fadeIn(220);
        $(this).css({'opacity' : '.7'});

    	} , function() {
        var imgrel = $(this).attr('rel');
        $(this).css({'opacity' : '1'});
        $('#'+imgrel).fadeOut(220);
        $('.popup-area').fadeOut(220);
    });*/

    if(!$.browser.opera) $.localScroll();

    $('.nolink').click(function(){
        return false;
	});

    $('#rental-form').livequery(function(){
        $(this).dialog({
    		autoOpen: false,
		    bgiframe: true,
    		width: 400,
    		modal: false
        });
    });

	var rentalFormCaller = function() {
	    $('#rental-form').dialog('open');
        $("#frmName").focus();
        return false;
	};
    $('#rental-form-caller, .rental-form-caller-c').livequery('click', rentalFormCaller);

	var rentalFormClose = function() {
	    $('#rental-form').dialog('close');
        return false;
	};
    $('#rental-form-close').livequery('click', rentalFormClose);

});

$(window).bind("load", function() {
	$('.mog-at-play').load('./library/vimeo.php');
});

function land(ref, target)
{
    lowtarget=target.toLowerCase();
    if (lowtarget=="_self") {window.location=loc;}
    else {if (lowtarget=="_top") {top.location=loc;}
    else {if (lowtarget=="_blank") {window.open(loc);}
    else {if (lowtarget=="_parent") {parent.location=loc;}
    else {parent.frames[target].location=loc;};
    }}}
}
function jump(menu)
{
    ref=menu.choice.options[menu.choice.selectedIndex].value;
    splitc=ref.lastIndexOf("*");
    target="";
    if (splitc!=-1)
    {
        loc=ref.substring(0,splitc);
        target=ref.substring(splitc+1,1000);
    }
    else
    {
        loc=ref; target="_self";
    }
    if (ref != "")
    {
        land(loc,target);
    }
}
