/**
$(document).ready(function() {
	
	$('#toggle').addClass('toggleMore');
	$('.toggleMore').html('...click to view more');
	
	
	$('.toggleMore, .toggleLess').mouseover(function(){
		$(this).addClass('hover');
	});
	
	$('.toggleMore, .toggleLess').mouseout(function(){
		$(this).removeClass('hover');
	});
	
	$('.toggleMore').click(function(){
		$('#mainContentContainer').animate({'height': '101%'}, 100, 'swing');
		$('#pageMediaRtCol').animate ({'height':'101%'}, 1000, 'swing');
		//$('.toggleMore').fadeOut();
		$('.toggleMore').html('...click to view less');
		$('.toggleMore').removeClass('toggleMore').addClass('toggleLess');		
	});
	
	$('.toggleLess').click(function(){
	   alert('hello');  
		$('#pageMediaRtCol').animate ({'height':'390px'}, 500, 'swing');
		$('#mainContentContainer').animate({'height': '543px'}, 100, 'swing');
		
		//$('.toggleMore').animate ({'color':'#ffffff'}, 100, 'swing');
		//$('.toggleMore').animate ({'color':'#000000'}, 500, 'swing').fadeIn('slow');	
		//$('.toggleLess').html('...click to view more');
		//$('.toggleLess').removeClass('toggleLess').addClass('toggleMore');		
	});
 
});
*/

$(document).ready(function()
{
	
	$('.toggleMore, .toggleLess').mouseover(function(){
		$(this).addClass('hover');
	});
	
	$('.toggleMore, .toggleLess').mouseout(function(){
		$(this).removeClass('hover');
	});
	
	$('.toggleMore').toggle(
    	
    	function()
    	{
    		$('#mainContentContainer').animate({'height': '100%'}, 'slow', 'swing');
    		$('#pageMediaRtCol').animate({'height':'100%'}, 'slow', 'swing');
    		$('.toggleMore').html('...click to view less');	
        },
 
        function()
        {
            $('#mainContentContainer').animate({'height': '543px'}, 'slow', 'swing');
    		$('#pageMediaRtCol').animate({'height':'390px'}, 'slow', 'swing');
    		$('.toggleMore').html('...click to view more');
        });
});

//CLICK FOR MORE/LESS MEDIA PAGE

/*
$(document).ready(function() {
	
	$('.toggleMore, .toggleLess').mouseover(function(){
		$(this).addClass('hover');
	});
	
	$('.toggleMore, .toggleLess').mouseout(function(){
		$(this).removeClass('hover');
	});
	
	$('.toggleMore').click(function(){      
		$('#mainContentContainer').animate({'height': '101%'}, 100, 'swing');
		$('#pageMediaRtCol').animate({'height':'101%'}, 1000, 'swing');
		$('.toggleMore').fadeOut();		
	});
	
	$('.toggleLess').click(function(){
		$('#pageMediaRtCol').animate ({'height':'390px'}, 500, 'swing');
		$('#mainContentContainer').animate({'height': '543px'}, 100, 'swing');
		$('.toggleMore').animate ({'color':'#ffffff'}, 100, 'swing');
		$('.toggleMore').animate ({'color':'#000000'}, 500, 'swing').fadeIn('slow');			
	});
 
});
*/


//CLICK DIRECT CAROUSEL FUNCTION
$(document).ready(function () {
			var autoscrolling = false;
			
			$('.clickDirectScroll').infiniteCarousel().mouseover(function () {
				autoscrolling = false;
			}).mouseout(function () {
				autoscrolling = false;
			});
			/**
			setInterval(function () {
				if (autoscrolling) {
					$('.clickDirectScroll').trigger('next');
				}
			}, 5000);
			*/		
});

//Poptastic - for popup windows
var newwindow; 
function poptastic(url) {
	newwindow=window.open(url,'name');
	if (window.focus) {newwindow.focus()}
}

function printYear() {
var today=new Date();
document.write(today.getFullYear());
}

//START EMAIL SCRAMBLE
function stringReverse(textString) {
   if (!textString) return '';
   var revString='';
   for (i = textString.length-1; i>=0; i--)
       revString+=textString.charAt(i)
   return revString;
}

function showEM(userName,emServer) {
	userName = stringReverse(userName); 
	emServer = stringReverse(emServer); 
	var emLink = userName+"@"+emServer; 
	document.write("<a title='Click here to contact us via email' href='mailto:"+emLink+" '>"); 
	document.write('Email me'); 
	document.write("</a>"); 	
}

function showEMTheTeam(userName,emServer) {
	userName = stringReverse(userName); 
	emServer = stringReverse(emServer); 
	var emLink = userName+"@"+emServer; 
	document.write("<a class=\"iggBlueText\" title='Click here to contact us via email' href='mailto:"+emLink+" '>"); 
	document.write(emLink); 
	document.write("</a>"); 	
}


function showEMSendMeEmail(userName,emServer) {
	userName = stringReverse(userName); 
	emServer = stringReverse(emServer); 
	var emLink = userName+"@"+emServer; 
	document.write("<a id=\"letsTalk\" class=\"iggBlueText\" title=\"Click here to contact us via email\" href=\"mailto:"+emLink+" \">"); 
	document.write('<span>Send me an email and let&rsquo;s talk about<br />creating your I&rsquo;mGoin&rsquo;Green web&ndash;in</span>'); 
	document.write("</a>"); 	
}

function showLetsTalkInlineEmail(userName,emServer) {
	userName = stringReverse(userName); 
	emServer = stringReverse(emServer); 
	var emLink = userName+"@"+emServer; 
	document.write("<a class=\"iggRedText underline\" title=\"Click here to contact us via email\" href=\"mailto:"+emLink+" \">"); 
	document.write('Let&rsquo;s Talk!');
	document.write("</a>"); 	
}

/**this goes in the HTML 
<script type="text/javascript">showEM("maeteht","moc.neergniogmi");</script>
*/
//END EMAIL SCRAMBLE

