// JavaScript Document

$(document).ready(function(){
	$("#window-welcome").dialog({
		bgiframe: true,
		height: 300,
		width: 550,
		position: 'center',
		zIndex: 20
	});
	
	$("#window-portfolio").dialog({
		bgiframe: true,
		position: 'center',
		height: 495,
		width:780,
		zIndex: 20,
		autoOpen: false
	});
	
	$("#window-contact").dialog({
		bgiframe: true,
		position: 'center',
		height: 435,
		width:385,
		zIndex: 20,
		autoOpen: false
	});
	
	$("#window-aboutus").dialog({
		bgiframe: true,
		position: 'center',
		height: 500,
		width:750,
		zIndex: 20,
		autoOpen: false
	});
	
	$("#window-tips").dialog({
		bgiframe: true,
		position: 'center',
		height: 500,
		width:750,
		zIndex: 20,
		autoOpen: false
	});
	
	$("#window-packages").dialog({
		bgiframe: true,
		position: ['center','center'],
		height: 465,
		width:710,
		zIndex: 20,
		autoOpen: false
	});
	
	$("#window-offer").dialog({
		bgiframe: true,
		position: ['right','center'],
		height: 400,
		width:450,
		zIndex: 20,
		autoOpen: false
	});
});

function view_portfolio(){
	$("#portfolio_menu").load("/include/portfolio-menu.php");
	$("#portfolio_menu").slideDown(400);
	
	$("#menu_items").fadeOut('fast', function(){
		$("#portfolio_items").fadeIn('slow').load("/include/portfolio-thumbs.php");
	});
}

function close_portfolio(){
	$("#portfolio_menu").slideUp(200);
	$("#portfolio_items").fadeOut('fast', function() {
		$("#menu_items").fadeIn('slow').load("/include/menu_items.php");
	});
	$("#window-welcome").dialog('open');
}

function change_portfolio_menu_items( category ){
	$("#menu_items").fadeOut('fast', function(){
		$("#portfolio_items").fadeIn('slow').load("/include/portfolio-thumbs.php", "category="+category);
	});
}

function view_window(objid, category,hidden){
	var obj = "#window-"+objid;
	var url = "/include/"+objid+".php";
	var args = "category="+category;

	$(obj).load(url,args);
	$(obj).dialog('open');
}

function make_offer(packagetitle, price){
	var obj = "#window-offer";
	var url = "/include/makeoffer.php";
	var args = "package="+packagetitle+"&itemprice="+price;

	$(obj).load(url,args);
	$(obj).dialog('open');
}
