﻿jQuery.noConflict();

function loadContact()
{
	ajaxpage(ajaxpack.basedomain + '/' + 'contact.php', 'popup-contact-content');
	ajaxpage(ajaxpack.basedomain + '/' + 'find-us.php', 'popup-find-us-content');
}

function showContact()
{

	document.getElementById('popup-curtain').style.display = "block";

	jQuery('#popup-contact-content').fadeIn("slow");
	jQuery('#popup-find-us-content').fadeIn("slow");

	if(navigator.appName == "Microsoft Internet Explorer"){
		setTimeout(function(){
			document.getElementById('popup-contact-holder').style.display = "block"
			document.getElementById('popup-find-us-holder').style.display = "block"
			document.getElementById('close-contact').style.display = "block"
			}, 500);
	}
	else{
		jQuery('#popup-contact-holder').fadeIn("slow");
		jQuery('#popup-find-us-holder').fadeIn("slow");
		jQuery('#close-contact').fadeIn("slow");
	}

}

function hideContact()
{
	
	document.getElementById('popup-curtain').style.display = "none";
	document.getElementById('close-contact').style.display = "none"
	
	if(navigator.appName == "Microsoft Internet Explorer"){
		setTimeout(function(){
			document.getElementById('popup-contact-holder').style.display = "none"
			document.getElementById('popup-find-us-holder').style.display = "none"
			}, 500);
	}
	else{
		jQuery('#popup-contact-holder').fadeOut("slow");
		jQuery('#popup-find-us-holder').fadeOut("slow");
	}
	jQuery('#popup-contact-content').fadeOut("slow");
	jQuery('#popup-find-us-content').fadeOut("slow");

}

function loadPortfolio(url) 
{
	ajaxpage(ajaxpack.basedomain + '/' + url, 'popup-portfolio-content');
	jQuery('#popup-portfolio-content').load(ajaxpack.basedomain + '/' + url);
	loadobjs('js/portfolio-tabs.js')
	document.getElementById('popup-curtain').style.display = "block";

	var divTag = document.createElement("div");
	divTag.id = 'portfolio-loading';
	document.getElementById('popup-portfolio-content').appendChild(divTag);

	jQuery('#popup-portfolio-content').fadeIn("slow");

	if(navigator.appName == "Microsoft Internet Explorer"){
		setTimeout(function(){
			document.getElementById('popup-portfolio-holder').style.display = "block"
			document.getElementById('close').style.display = "block"
			}, 500);
	}
	else{
		jQuery('#popup-portfolio-holder').fadeIn("slow");
		jQuery('#close').fadeIn("slow");
	}

}


function closePortfolio()
{
	if(document.all){
		document.getElementById('popup-portfolio-holder').innerHtml = "";
		document.getElementById('popup-portfolio-content').innerHtml = "";
	}
	else{
		document.getElementById('popup-portfolio-holder').textContent = "";
		document.getElementById('popup-portfolio-content').textContent = "";
	}
	
	document.getElementById('popup-curtain').style.display = "none";
	document.getElementById('close').style.display = "none"
	
	if(navigator.appName == "Microsoft Internet Explorer"){
		setTimeout(function(){
			document.getElementById('popup-portfolio-holder').style.display = "none"
			}, 500);
	}
	else{
		jQuery('#popup-portfolio-holder').fadeOut("slow");
	}
	jQuery('#popup-portfolio-content').fadeOut("slow");
}

jQuery(document).ready(function($){
		$("#popup-curtain,#close").click(function(){
			hideContact();
			closePortfolio();
		});
	});
jQuery(document).ready(function($){
		$("#popup-curtain,#close-contact").click(function(){
			hideContact();
			closePortfolio();
		});
	});

