// contact slider //
$(document).ready(function(){

	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").hide(); 

	//Switch the "Open" and "Close" state per click
	$("#trigger").toggle(function(){
		$(this).addClass("active");
		}, function () {
		$(this).removeClass("active");
	});

	//Slide up and down on click
	$("#trigger").click(function(){
		$(this).next(".toggle_container").slideToggle("slow");
	});

});

// div toggle //
function showonlyone(thechosenone) {
      var newboxes = document.getElementsByTagName("div");
            for(var x=0; x<newboxes.length; x++) {
                  name = newboxes[x].getAttribute("name");
                  if (name == 'newboxes') {
                        if (newboxes[x].id == thechosenone) {
                        newboxes[x].style.display = 'block';
                  }
                  else {
                        newboxes[x].style.display = 'none';
                  }
            }
      } 
}


//equalizes div heights//
function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
$(document).ready(function() {
	equalHeight($(".promo"));
});
// email obsfucation //
function emailantispam(email1, email3, email4){
   emailE = email1 + '@' + email3 + email4;
   document.write('<a href="mailto:' + emailE + '">' + emailE + '</a>')
};

// creates popups from work pages//
function popupaudio(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=415,height=100,left=40,top=40, toolbar=no, resizable=yes, status=no,location=no, scrollbars=no');
return false;
}

function popupflash(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=630,height=480,left=40,top=40, toolbar=no, resizable=yes, status=no, location=no, scrollbars=no');
return false;
}
function popupleaderboard(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=750,height=200,left=40,top=40, toolbar=no, resizable=yes, status=no, location=no, scrollbars=no');
return false;
}

function popupmpu(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=335,height=340,left=40,top=40, toolbar=no, resizable=yes, status=no, location=no, scrollbars=no');
return false;

}

function targetopener(mylink, closeme, closeonly)
{
if (! (window.focus && window.opener))return true;
window.opener.focus();
if (! closeonly)window.opener.location.href=mylink.href;
if (closeme)window.close();
return false;
}