$(document).ready(function() {
	
	$('div.order-form-box').css({ opacity : .6 });
	
	$('div.r-col div.item-box').find('div.shape').mouseenter(function() {
		$(this).addClass('hover');
		$(this).stop();
		$(this).find('div.order-form-box').css({ opacity : 1 });
	}).mouseleave(function() {
		$(this).removeClass('hover');
		$(this).stop();
		$(this).find('div.order-form-box').css({ opacity : .6 });
	});
	
	
	$('div.v-menu').find('li:last').css({ background : 'none' });
	
	
	$('div.res-box').find('div.w45:odd').css({ left : 'auto', right : '-1%' });
	
	$('div.order-form-box div.btn').find('a').mouseover(function() {
		$(this).addClass('hover');
		$(this).parent().find('span').addClass('hover');
	}).mouseleave(function() {
		$(this).removeClass('hover')
		$(this).parent().find('span').removeClass('hover');
	});
	
	$('div.sale-form input').mouseover(function() {
		$(this).addClass('hover');
	}).mouseleave(function() {
		$(this).removeClass('hover');
	});
	
	$('input.btn-form-subm').mouseover(function() {
		$(this).addClass('hover');
	}).mouseleave(function() {
		$(this).removeClass('hover');
	});
	
	
	$('div.l-col').find('div.shape:last').css({ padding : 0 });
	
	$('div.sub-box').find('img').css({ opacity : .7 })
	$('div.sub-box').find('img').mouseover(function() {
		$(this).stop();
		$(this).animate({ opacity : 1 });
	}).mouseout(function() {
		$(this).stop();
		$(this).animate({ opacity : .7 });
	});
	
	$('div.order-item').find('td:last').css({ border : 'none' }).prev().css({ border : 'none' });
	
	$('div.l-col').find('div.salat-shape:last').css({ paddingBottom : '20px' })
});


var globalID = 0;
var forbidden = false;
function popup(id, toid)
{
	if(forbidden)return;
	forbidden = true;
	globalID = id;
	var pos = $("#"+toid).position();
	//alert(pos.left + " " + pos.top);
	var info = $('#'+id);
	info.css({
		top: pos.top,
		left: pos.left,
		display: 'block'
	}).animate({
		top: '-=55px',
		opacity: 1
	}, 250, 'swing', function() {
		beingShown = false;
		shown = true;
	});
	
	setTimeout("popdown()",2000);
}

function popdown()
{
	var info = $('#'+globalID);
	info.css({
		display: 'none'
	}).animate({
		top: '+=55px',
		opacity: 1
	}, 250, 'swing', function() {
		beingShown = false;
		shown = true;
	});
	forbidden = false;
}

function facepic(url)
{
	var html = '<img src="' + url + '" alt="" onclick="jQuery(document).trigger(\'close.facebox\')" />';
	jQuery.facebox(html);
}

function isIE()
{
  return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);
}
