// JavaScript Document
$(document).ready(function() {
//Find First & Last Li
	$("ul#menu li:first-child").addClass("first");
	$("ul#menu li:last-child").addClass("last");
	
// Drop Down

$("ul#menu li.menuitem a.menu").hover(function() {
	$(this).parent().find("ul.submenu").slideDown('fast').show();
	$(this).parent().find("a.menu").addClass("hovered");
	$(this).parent().hover(function() {
		}, function(){
		$(this).parent().find("ul.submenu").slideUp('fast');
		$(this).parent().find("a.menu").removeClass("hovered");
	});
});


	
// Products Sliding
	$(".scroll-tab-content").css('visibility','hidden');
	$("ul.proruct-scroll-tab li:first a").addClass("active");
	$(".scroll-tab-content:first").css('visibility','visible');

	$("ul.proruct-scroll-tab li").click(function() {
			$("ul.proruct-scroll-tab li a").removeClass("active");
			$(this).children("a").addClass("active");
			$(".scroll-tab-content").css('visibility','hidden');
			var activeTab = $(this).find("a").attr("href");
			$(activeTab).css('visibility','visible');
			return false;
	});
	
// Find Last Li
	$("ul.breadcrumb li:last-child").addClass("last");
	$("ul.right-menu li:last-child").addClass("last");
	
// Downloads
	$("ul.download-links").each(function(){
		if ($.browser.msie && $.browser.version.substr(0,1)<8) {
			$(this).append('<li style="background:none; clear:left; float:none; height:0; padding:0; width:100%; font-size:0; line-height:0"><!-- --></li>');
		} else {
			$(this).append('<li style="background:none; clear:left; float:none; height:7px; padding:0; width:100%;"><!-- --></li>');
		}
	});

//products-details-template3.shtml

//product-left content Last Li 	
	$(".product-left ul li:last-child").css('padding-bottom','0');
	$("ul.button-list li:last-child").css('padding-bottom','0');
		
//footprint each 4th div.pin-box 
    var no=$("div.pin-box-list").length;			
	var temp=no/4;	
	var abc=3;
	for(i=0;i<temp;i++)
	{  
		$("div.pin-box-list:eq("+abc+")").css("margin-right", "0");
		abc=abc+4;
}

//products-details-template2.shtml
//Product Image and description each 3rd div.pro-img-des margin-right 0
    var pidNo=$("div.pro-img-des").length;			
	var pidNoLength=pidNo/3;	
	var toMar0=2;
	for(i=0;i<pidNoLength;i++)
	{  
		$("div.pro-img-des:eq("+toMar0+")").css("margin-right", "0");
		toMar0=toMar0+3;
}
var pidNo1 = $("div.pro-img-cat").length;
var pidNoLength1 = pidNo1 / 5;
var toMar01 = 4;
for (i = 0; i < pidNoLength1; i++) {
    $("div.pro-img-cat:eq(" + toMar01 + ")").css("margin-right", "0");
    toMar01 = toMar01 + 5;
}
//$("div.pro-img-cat:nth-child(5n)").css('margin-right','0');
	$(".wafer-table table tr").each(function(){
		$(this).children("td:last-child").css('border-right','1px solid #A3BED3');							 
	});
	 $("div.specification").each(function(){
          $(this).children(".specification-details:first-child").css('padding-top','3px');											         
		  $(this).children(".specification-details:last-child").addClass("specification-details-last");	
    });
    $('.wafer-table table tr th:eq(0)').addClass("no");	
	$('.wafer-table table tr th:eq(1)').addClass("dimension");	
	$('.wafer-table table tr th:eq(2)').addClass("straight");	
	/*$('.wafer-table table tr:eq(1)').addClass("first-row");*/
	$('.wafer-table table tr:last-child').addClass("lastrow");
	
//dealers-distributors.shtml
  //add classs to last dealers-list to remove bottom image
   $("div.dealers-list:last-child").addClass("dealers-list-last");	
   
//products-details-template5.shtml	
     if($("#page div").hasClass("product-left")){
		var firsttagname=$(".product-left").children().get(0).tagName;
		if(firsttagname=="H3")
		{
		$(".product-left h3:first-child").css('padding-top','0');
		} 
	  }	
	$("a.group").hover(
  function () {

    $(this).append('<img src="../images/zoom-btn.png" class="zoom-img" alt="" title=""/>');

  }, 
  function () {
	  $(this).children('img.zoom-img').remove();
	  }
   );
	$(".quality-brands ul li a").append('<img src="../images/zoom-btn.png" class="zoom-img" alt="" title=""/>');	
});

/*Paging Script*/
 function genresults(num) {
       document.getElementById('hfpageid').value=num;
       document.getElementById('flag').value="1";
       document.getElementById("btSubmit").click();
        //__doPostBack('$btSubmit','');

      
    }



