var address= 'info@' + 'chinesekungfu.co.uk';

$(document).ready(function(){
	
	//printEmail();
	$("#email-header").createEmailLink();
	iFrameIndexFix();
	
});


function printEmail()
{
	$("#email-header").html('<a href="mailto:'+address+'">'+address+'</a>');
}

/*
	*	appends a typical iframe youtube link so the zindex works
*/
function iFrameIndexFix()
{
	$('iframe').each(function()
	{
		var url = $(this).attr("src");
		if(url.search("youtube") >= 0)
		{
			// index will check if a query string already exists, else append the url at the end
			var index = url.indexOf("?");
			if(index >=0)
			{
				var str1 = url.slice(0,index+1);
				var str2 = url.slice(index+1);
				str2 = "wmode=transparent&" + str2;
				$(this).attr("src",str1+str2);	
			}
			else
			{
				$(this).attr("src",url+"?wmode=transparent")
			}
		}		
	});
}

function prettyPhotoClose()
{
	
}

jQuery.fn.createEmailLink = function()
{
    var html = $(this).html();
	$(this).html(html+'<a href="mailto:'+address+'">'+address+'</a>');
};
