/*
 * class that holds all starcatchers specific javascript
 * @copyright MB Digital 17/06/2009
*/
function starCatchers()
{
//runs when the main document body is ready to run (uses the jquery framework)
$(document).ready(function(){
	
	//set the original font size for the site
	var origFontSize = $('body').css('font-size').replace('px','');

	/*
	 * enlarge text button
	*/
	$('#text_resize a').click(function(e){
		e.preventDefault();
		if($('body').css('font-size').replace('px','') > origFontSize)
			{
			var newFontSize = origFontSize + 'px';
			}
		else
			{
			var newFontSize = (origFontSize * 1.5) + 'px';
			}
		$('body').css('font-size',newFontSize);
		});
	
	/*
	 * disable context menu on gallery images
	*/
	$('#main_photo').bind("contextmenu",function(e){
              return false;
       });
	$('#gallery_list li').bind("contextmenu",function(e){
              return false;
       });
	$('#other_gallery li').bind("contextmenu",function(e){
              return false;
       });
	
	//end of the on page ready functions
	});

/*
 * changes the feedback form business element
*/
function showOrg(theEl)
{
if(theEl.value == '1')
	{
	var theShow = document.getElementById('orgname');
	var theShow2 = document.getElementById('orgname_label');
	//alert("the show el: " + theShow);
	theShow.style.display = "block";
	theShow2.style.display = "block";
	}
}
this.showOrg = showOrg;

/*
 * grabs the colour of the h1 tag
*/
function getHColour()
{
var css = mbD.getCSSRule("h1");
var cssColour = css.style.color;
var colString = '';
if(css.style.color.substr(0,1) == '#')
	{
	colString = cssColour.substr(1);
	}
else
	{
	cssColour = cssColour.substr(4);
	cssColour = cssColour.replace(')','');
	cssColour = cssColour.split(',');
	colString = mbD.toHex(cssColour[0]) + mbD.toHex(cssColour[1]) + mbD.toHex(cssColour[2]);
	}

return colString;
}
this.getHColour = getHColour;


}

//set the class
var starCatchers = new starCatchers();


