﻿/* This function grabs the curent year and then writes it to the screen for use in the copyright rate */
function ShowCurrentYear()
{
	var d = new Date();
	var CurYear = d.getFullYear();
	document.write(CurYear);
}

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

if (top.location!= self.location) {
	top.location = self.location.href
}


/************Google Search*****************/

google.load('search', '1', {language : 'en'});
  google.setOnLoadCallback(function() {
    var customSearchControl = new google.search.CustomSearchControl('008820942375758081061:4y3kqdlgyum');
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    var options = new google.search.DrawOptions();
    options.setAutoComplete(true);
    options.enableSearchboxOnly("http://www.shipconstructor.com/en/search-results");
    customSearchControl.draw('cse-search-form', options);
  }, true);
