//Master Javascript file
//version:   4.0
//author:    Paul Boag
//email:     paul.boag@headscape.co.uk
//website:   http://www.headscape.co.uk

// Loads up the various functions we are going to use
$(document).ready(function(){
	jsEnabled();
	newwindow();
	addCorners();
	addOverlay();
	addOverlaySmall();
	bigTextImage();
	mainNavSelected();
});


// t4 main navigation
function mainNavSelected() {
	$("ul.topNav li span").append("<b class=\"currentCorner\"></b>");
}

function newwindow() {
	$(".email a").click(function(){
			window.open (this.href, "mywindow","resizable=1,width=550,height=450"); 	
			return false;
	});
};

// Adds a class to the body tag so any elements on the page can be styled differently if the browser supports JS
function jsEnabled(i) { 
	$("body").addClass("jsEnabled");
}

//Lighbox function
function lighbox(i) {
    $('.box a').lightBox();
}

//Creates the curved corners 
function addCorners(i) {
	$(".curvedBL").append('<span class="curveBL">&nbsp;</span>');
}


function addOverlay (i) {
	$(".overlayCurve").wrap('<span class="curvedImage"></span>');
	$(".curvedImage").append('<span class="curveBr">&nbsp;</span>');
}

//Creates the curved corners
function addOverlaySmall(i) {
	$(".overlayCurveSmall").wrap('<span class="curvedImageSmall"></span>')
	$(".curvedImageSmall").append('<span class="curveBrSmall">&nbsp;</span>');
}

//Creates the curved corners
function bigTextImage(i) {
	$(".bigTextImage").wrap('<div class="curvedBL"></div>') 
	$(".bigTextImage").before('<span class="curveTR">&nbsp;</span>') 
	$(".bigTextImage").after('<span class="curveBL">&nbsp;</span>') 
}
