browserBypass = false;

currentImgPath = "";
currentSwfPath = "";
currentName = "";
currentWidth = "";
currentHeight = "";
currentPlayer = "";

if (BrowserDetect.browser == "Safari" && BrowserDetect.version == "312.6") {
	browserBypass = true;
}

jQuery(document).ready(function($) {
	if (screen.width < 1024) {
		//$("#alert").html("<div id=\"message\"><p>Apologies, but this site is optimised for a monitor resolution of 1024x768.</p></div>");
		//$("#alert").hide();
		//$("#alert").fadeIn(1000);
	}
})

function slideshow(index,num) {
	viewportWidth = 600; // Width of the viewport and also the images in the portfolio slideshow pages.
	workBlock = "#scroll"+index;
	$(workBlock).stop().animate({left:-(viewportWidth*num)},1000, 'easeInOutCubic');
	temp = $(workBlock).parent().parent();
	temp2 = $(temp).find(".workText");
	temp3 = $(temp2).find("li");
	i = 0;
	temp3.each(function(){
		$(this).find("a").removeClass("selected");
		$(this).find("a").addClass("");
		if (i == num) {
			$(this).find("a").addClass("selected");
		}
		i++;
	});
}

function profile(num) {
	if (browserBypass == false) {
		viewportWidth = 600; // Width of the viewport and also the images in the portfolio slideshow pages.
		$("#profileList").stop().animate({left:-(viewportWidth*num)},1000, 'easeInOutCubic');
		
		temp = $(".rightcol").children().children();
		i = 0;
		temp.each(function(){
			
			currentItem = $(this).text();
			$(this).removeClass("selected");
			lastChr = currentItem.charCodeAt(currentItem.length-1);
			if (lastChr == 8212) {
				newText = currentItem.substr(0,currentItem.length-2);
				$(this).text(newText);
			}

			if (i == num) {
				$(this).append(" &mdash;");
				$(this).addClass("selected");
			}
			i++;
		});
	}
}

function videoControl(imgpath, swfpath, width, height, playerNum) {
	if (currentPlayer != "") {
		videoFinish();
	}
	
	currentImgPath = imgpath;
	currentSwfPath = swfpath;
	currentName = "fp"+playerNum;
	currentWidth = width;
	currentHeight = height;

	//alert(currentPlayer);
	
	
	var so = new SWFObject(swfpath, "fp"+playerNum, width, height, "7", "#000000");
	so.addParam("wmode", "transparent");
	so.write("player"+playerNum);
	currentPlayer = playerNum;
	return false;
	
}

function videoFinish(){
	$("#player"+currentPlayer).html("<a href=\"#\" onClick=\"videoControl('"+ currentImgPath +"', '"+ currentSwfPath +"', '"+ currentWidth +"', '"+ currentHeight +"','"+ currentPlayer +"'); return false;\"><img src=\""+ currentImgPath +"\" alt=\"\" width=\""+ currentWidth +"\" height=\""+ currentHeight +"\" /></a>");
	content.focus();
}



$(document).ready(function(){
	$(".scroll").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();

		//get the full url - like mysitecom/index.htm#home
		var full_url = this.href;

		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];

		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;

		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);
	});
});

$(function() {
                $("#toTop").scrollToTop({speed:1000,ease:"easeInBack",start:550});
            }); 
			
$(document).ready(function(){
$("a").fadeTo("fast", 1.0);
$("a").hover(function(){
$(this).fadeTo("fast", 0.4);
},function(){
$(this).fadeTo("fast", 1.0);
});
});

		



