
// Initialize

$(function() {
	$("#accordion").accordion({
		autoHeight: false
	});
});

$(function() {
	$('#tab-box > ul').tabs();
});

$(function()
{
	$('.tags-list').jScrollPane({showArrows: true});
});

$(document).ready(function() {

	$('.tags-search-field').click( function() {
		if (this.value == this.defaultValue) {
			this.value = '';
		}
	});

	$('.tags-search-field').blur(function() {
		if (this.value == '') {
			this.value = this.defaultValue;
		}
	});

	$('.newsletter-search-field').click( function() {
		if (this.value == this.defaultValue) {
			this.value = '';
		}
	});

	$('.newsletter-search-field').blur(function() {
		if (this.value == '') {
			this.value = this.defaultValue;
		}
	});

});

$(document).ready(function(){
   $("#right a[rel^='prettyPhoto']").prettyPhoto({theme:'custom'});
});



// Search

function ctlSearch_OnClick ()
{
 var url;
 var theform = document.frmSearchBox;
 
 if (theform.keyword.value.length < 2)
 {
  alert('Please enter at least two characters.');
  theform.keyword.focus();
 }
 else
 {
	var iIndex = 2;
	var sSearchType = 2;

  
// Version 2.7 release
// 1. using default Domain, like "orientalmotor.thomasnet.com" in our sample 
// 2. using root category shortName, like "all-categories" in our sample
  url = "http://eicsolutions.thomasnet.com/keyword/all-categories?&plpver=1002"
  url = url + "&SchType=" + sSearchType;
  url = url + "&keyword=" + encodeURI(theform.keyword.value);
  url = url + "&refer=" + encodeURI(document.location.href);
   
  document.location.href = url;
 }

//alert (url);				
}




// Print

function PrintPage(p) {

   var sOption="toolbar=0,location=0,directories=0,menubar=1,scrollbars=1,width=670,height=500,resizable=0"; 
   window.open(self.location.href+p,null,sOption).focus();

}
