﻿var exPopupBoxDiv = '';

function showPopupBox(popupBoxBtn, popupBoxDiv, topAdjust, leftAdjust) {
	hidePopupBox(exPopupBoxDiv);
	exPopupBoxDiv = popupBoxDiv;
	
	document.getElementById(popupBoxDiv).style.top = $("." + popupBoxBtn).position().top+$("." + popupBoxBtn).height() - topAdjust + "px";
	document.getElementById(popupBoxDiv).style.left = leftAdjust + "px";
	
	if (document.getElementById(popupBoxDiv) != null) {
		$("." + popupBoxDiv).show('fast', function() {
		    // Animation complete.
		  });
	}
}

function hidePopupBox(popupBoxDiv) {
	if (document.getElementById(popupBoxDiv) != null) {
		$("." + popupBoxDiv).hide('fast', function() {
		    // Animation complete.
		  });
	}
}

function email_click() 
{	
	emailClick(null, null, location.href);
}  
function fbs_click() 
{
	fbsClick(location.href);
}   
function twitter_click() 
{
	twitterClick(location.href);
} 
function emailClick(inputSubject, inputTitle, sharePath) 
{	
	var subject = "HA/HD Website";
	var title = "";
	
	if (inputSubject != null && inputSubject != '') {
		subject = inputSubject;
	} 
	
	if (inputTitle == null || inputTitle == '') {

	} else {
		title = inputTitle;
	}
		
	u = "mailto:?";
	u += ("subject=" + subject);
	u += ("&body=" + title + "%0D%0A" + sharePath);
	//alert(u);
	
	parent.location=u;	
	
	return false;
}  
function fbsClick(s) 
{
	u=s;
	t=document.title;
	window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=1000,height=600");
	return false;
}   
function twitterClick(s) 
{
	u=s;
	t=document.title;
	window.open('http://twitter.com/share?url='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=800,height=600');
	return false;
} 

function popup800600(url) 
{
	window.open (url, "","status=0,toolbar=0,menubar=0,resizable=1,scrollbars=0,width=800,height=600");
} 

function openWindow(url) 
{
	window.open (url);
} 

function popup800600Scroll(url) 
{
	window.open (url, "","status=0,toolbar=0,menubar=0,resizable=1,scrollbars=1,width=800,height=600");
} 

function popup824624Scroll(url) 
{
	window.open (url, "","status=0,toolbar=0,menubar=0,resizable=1,scrollbars=1,width=824,height=624");
} 

function popup1024768(url) 
{
	window.open (url, "","status=0,toolbar=0,menubar=0,resizable=1,scrollbars=0,width=1024,height=768");
} 

function popup1024768Scroll(url) 
{
	window.open (url, "","status=0,toolbar=0,menubar=0,resizable=1,scrollbars=1,width=1024,height=768");
} 
