function myInit() {
	
	$("a[href^='http:']").not("[href*='sunbiofuels.com']").attr('target','_blank');
	
	/*
	$("#navigation > ul > li").hover( function () {		
		$("#navigation ul > li").removeClass('hover');
		$(this).addClass('hover');
		},function () {
		//$(this).removeClass('hover');
		}
		);
	*/
	

	$('#navigation ul li:has(li.selected)').addClass('selected');
	
	$('#navigation > ul > li:last').addClass('last');	
	$('#navigation > ul > li.last').prev().addClass('penultimate');
	
	
	$("#subscriberForm").submit(function() {	
										 
		var email = $("input[name='email']").val();
		
		if (!email) {
			alert("Please enter your email address");
			return false;
			}
			
		$.ajax({
			type: "POST",
			url: "/signup.php",
			data: "email="+email,
			success: function(returned){					
				$("#subscriberForm").html("<p>Thank you for subscribing</p>");
				}
			});				
		return false;	
		
	   });	


	$('#ticker ul').innerfade({ 
		speed: 500, 
		timeout: 5000, 
		type: 'sequence', 
		containerheight: '16px'
		});

	$('#homePageImageRotate ul').innerfade({ 
		speed: 500, 
		timeout: 5000, 
		type: 'sequence', 
		containerheight: '314px'
		});
	
	
	
	}


/***********************************************
* Local Time script- © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function showLocalTime(container,servertimestring){
if (!document.getElementById || !document.getElementById(container)) return
this.container=document.getElementById(container)
this.localtime=this.serverdate=new Date(servertimestring)
this.updateTime()
this.updateContainer()
}

showLocalTime.prototype.updateTime=function(){
var thisobj=this
this.localtime.setSeconds(this.localtime.getSeconds()+1)
setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second
}

showLocalTime.prototype.updateContainer=function(){
var thisobj=this

var hour=this.localtime.getHours()
var minutes=this.localtime.getMinutes()
var seconds=this.localtime.getSeconds()
var ampm=(hour>=12)? "PM" : "AM"
this.container.innerHTML=formatField(hour)+":"+formatField(minutes)+":"+formatField(seconds)

setTimeout(function(){thisobj.updateContainer()}, 1000) //update container every 10 seconds
}

function formatField(num, isHour){
if (typeof isHour!="undefined"){ //if this is the hour field
var hour=(num>12)? num-12 : num
return (hour==0)? 12 : hour
}
return (num<=9)? "0"+num : num//if this is minute or sec field
}


function popup(url){	
	var width  = 330;
	var height = 250;
	var left   = (screen.width  - width)/2;
	var top    = (screen.height - height)/2;
	var params = 'width='+width+', height='+height;
	params += ', top='+top+', left='+left;
	params += ', directories=no';
	params += ', location=no';
	params += ', menubar=no';
	params += ', resizable=no';
	params += ', scrollbars=no';
	params += ', status=no';
	params += ', toolbar=no';
	newwin=window.open(url,'windowname5', params);
	if (window.focus) {newwin.focus()}
	return false;
}
