
/** Small Search Form Javascript **/


var originalSmallSearchFormAction = '';

/**
 * This function opens a popup window to display the search tips
 */

function launchSearchTips() {
	var urlToOpen = iwp_global_siteurl + "/searchtips.html";
	var day = new Date();
	var id = day.getTime();
	window.open(urlToOpen, "'" + id + "'", 'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width=600,height=500');
}

$(document).ready(function() {
	var url = '';
	url = document.location.href;
	if(url.substr(-1, 1) == '/'){
		url = url.substr(0, (url.length - 1));
	}

	// @TODO: Add in a fix for finding the current URL for links that are using /site/path instead of http://www.example.com/site/path

	$('.tplIsCurrentItem:has(a[href='+url+'])').each(function(){
		$(this).addClass('currentItem');
	});

	$('.tplIsCurrentItem:has(a[href='+url+'/])').each(function(){
		$(this).addClass('currentItem');
	});
});
