﻿
function loadContent(productLineId) {
	
	var content_show1 = window.location.href.toString().replace(/^[^\?]*\?/, '?'); // get rid of any
    content_show1 = content_show1.replace(/^[^#]*#/, '#'); // get rid of any

	if (content_show1 != window.location.href) {
		var content_show = content_show1.replace('#', '');
		content_show = content_show.replace('?', '');
		$("#defaultContent").hide();
		$('html, body').animate({scrollTop:0}, 'fast'); 
		$.ajax({
			method: "get", url: "details.aspx", data: content_show + "&ProductLineId=" + productLineId,
			success: function(html) { //so, if data is retrieved, store it in html
				$("#pageContent").html(html); //show the html inside .content div
				$("#pageContent").fadeIn("slow"); //animation
				
                $('h1').sifr({
		            font: 'ITC Franklin Gothic', 
		            textTransform: 'uppercase',
		            color: '#075c22',
		            path: '/sifr'
	            });
			}
		}); //close $.ajax(
		$.ajax({
			method: "get", url: "Downloaddetails.aspx", data: content_show + "&ProductLineId=" + productLineId,
			success: function(html) { //so, if data is retrieved, store it in html
				$("#downloadContent").html(html); //show the html inside .content div
				$("#downloadContent").fadeIn("slow"); //animation
				$("#loading").hide();
				
			}
		}); //close $.ajax(
		
	}
	if (content_show1 == window.location.href) {
		$("#pageContent").hide();
		$("#defaultContent").fadeIn("slow");
	}
	$('h1').sifr({
		font: 'ITC Franklin Gothic', 
		textTransform: 'uppercase',
		color: '#075c22',
		path: '/sifr'
	});
	
	

}
function loadAllProductJquery(productLineId) {
    
	jQuery('#list1a').accordion({
	    alwaysOpen: false,
	    autoheight: false,
		header: '.menCategoryAccordian',
		active: false,
		selectedClass: 'menCategoryAccordianSelected',
		navigation: true,
		clearStyle: true
	});
	
	// toggles the slickbox on clicking the noted link
	$('a#toggle-menus').click(function() {
		$('#list1a').toggle(200);
		$('#list1').toggle(250);
		$('#toggleBut').toggle();
		$('#toggleBut2').toggle();
		return false;
	});
	// toggles the slickbox on clicking the noted link
	$('a#toggle-menus2').click(function() {
		$('#list1a').toggle(250);
		$('#list1').toggle(200);
		$('#toggleBut').toggle();
		$('#toggleBut2').toggle();
		return false;
	});

	loadContent(productLineId);



	$('#list1a a').click(function() { //start function when any link is clicked
	
	var urlVariables = window.location.href.toString().replace(/^[^#]*#/, '#');
	var urlVariablesNo = urlVariables.replace('#', '');
	var content_show = $(this).attr("href").replace('#', ''); //retrieve title of link so we can compare with php file
    content_show = content_show.replace('?', '');
	if(content_show != urlVariablesNo)
	{
	    $(".relatedCategory").removeClass("relatedCategory").addClass("menCategoryAccordian");
		$("#pageContent").fadeOut("fast");
		$("#loading").fadeIn("fast");
		$("#downloadContent").fadeOut("fast");
		$('.menuProductAccordian a').removeClass("current");
		$("#defaultContent").hide();
		
		window.location = "#" + content_show;
        if (jQuery.browser.msie) {
        var d = new Date();
        $('html, body').animate({scrollTop:0}, 'fast'); 
            $.ajax({
			    method: "get", url: "details.aspx", data: content_show + "&"+ d.getTime() + "&ProductLineId=" + productLineId,
			    success: function(html) { //so, if data is retrieved, store it in html
				    $("#pageContent").html(html); //show the html inside .content div
				    $("#pageContent").fadeIn("slow"); //animation
                    $('h1').sifr({
		                font: 'ITC Franklin Gothic', 
		                textTransform: 'uppercase',
		                color: '#075c22',
		                path: '/sifr'
	                });
			    }
		    }); //close $.ajax(
		    $.ajax({
			    method: "get", url: "DownloadDetails.aspx", data: content_show + "&"+ d.getTime() + "&ProductLineId=" + productLineId,
			    success: function(html) { //so, if data is retrieved, store it in html
				    $("#downloadContent").html(html); //show the html inside .content div
				    $("#downloadContent").fadeIn("slow"); //animation
				    $("#loading").hide();
    				
			    }
		    }); //close $.ajax(
		
        }
        if (jQuery.browser.msie) {
        $("#list1a").toggle(1);
	    $("#list1a").toggle(1);
	    }
    }
    
	}); //close click(

	$('#list1 a').click(function() { //start function when any link is clicked
	var urlVariables = window.location.href.toString().replace(/^[^#]*#/, '#');
	var urlVariablesNo = urlVariables.replace('#', '');
	var content_show = $(this).attr("href").replace('#', ''); //retrieve title of link so we can compare with php file
	content_show = content_show.replace('?', '');
	if(content_show != urlVariablesNo)
	{
	    $(".relatedCategory").removeClass("relatedCategory").addClass("menCategoryAccordian");
		$("#pageContent").fadeOut("fast");
		$("#downloadContent").fadeOut("fast");
		$("#loading").fadeIn("fast");
		$('.menuProductAccordian a').removeClass("current");
		$("#defaultContent").hide();
		window.location = "#" + content_show;
		if (jQuery.browser.msie) {
		$('html, body').animate({scrollTop:0}, 'fast'); 
		var d = new Date();
        $.ajax({
			method: "get", url: "details.aspx", data: content_show + "&"+ d.getTime() + "&ProductLineId=" + productLineId,
			success: function(html) { //so, if data is retrieved, store it in html
				$("#pageContent").html(html); //show the html inside .content div
				$("#pageContent").fadeIn("slow"); //animation
                $('h1').sifr({
		            font: 'ITC Franklin Gothic', 
		            textTransform: 'uppercase',
		            color: '#075c22',
		            path: '/sifr'
	            });
			}
		}); //close $.ajax(
		$.ajax({
			method: "get", url: "DownloadDetails.aspx", data: content_show + "&"+ d.getTime() + "&ProductLineId=" + productLineId,
			success: function(html) { //so, if data is retrieved, store it in html
				$("#downloadContent").html(html); //show the html inside .content div
				$("#downloadContent").fadeIn("slow"); //animation
				$("#loading").hide();
				
			}
		}); //close $.ajax(
        }
		//reload the accordian
		$('.menCategoryAccordian').removeClass("menCategoryAccordianSelected");
		jQuery('#list1a').accordion("destroy");
		jQuery('#list1a').accordion({
			alwaysOpen: false,
			autoheight: false,
			header: '.menCategoryAccordian',
			active: false,
			selectedClass: 'menCategoryAccordianSelected',
			navigation: true,
			clearStyle: true
		});
		}
	});  //close click(

	$('.menuProductAccordian a').click(function() {
		$('.menuProductAccordian a').removeClass("current");
		$(this).addClass("current");
	});   //close click
	
/*	
	$('.searchboxCategory a').click(function() { //start function when any link is clicked
	//reload the accordian
		$('.menCategoryAccordian').removeClass("menCategoryAccordianSelected");
		jQuery('#list1a').accordion("destroy");
		jQuery('#list1a').accordion({
			alwaysOpen: false,
			autoheight: false,
			header: '.menCategoryAccordian',
			active: false,
			selectedClass: 'menCategoryAccordianSelected',
			navigation: true,
			clearStyle: true
		});
	});   //close click
*/	
}


$('.productPoints a').livequery('click', function() {
	$("#pageContent").fadeOut("fast");
	$("#downloadContent").fadeOut("fast");
	$("#loading").fadeIn("fast");
	var content_show1 = $(this).attr("href").replace(/^[^#]*#/, '#'); // get rid of any
	var content_show = content_show1.replace('#', ''); //retrieve title of link so we can compare with php file
	content_show = content_show.replace('?', '');
	var d = new Date();
	if (jQuery.browser.msie) {
	    $('html, body').animate({scrollTop:0}, 'fast'); 
        $.ajax({
			method: "get", url: "Details.aspx", data: content_show + "&"+ d.getTime() + "&ProductLineId=" + appId,
			success: function(html) { //so, if data is retrieved, store it in html
				$("#pageContent").html(html); //show the html inside .content div
				$("#pageContent").fadeIn("slow"); //animation
                $('h1').sifr({
		            font: 'ITC Franklin Gothic', 
		            textTransform: 'uppercase',
		            color: '#075c22',
		            path: '/sifr'
	            });
			}, 

            error:function(event, request, settings){ 
            alert("Ajax failed!"+event+request+settings); 
            } 
			
		}); //close $.ajax(
		$.ajax({
			method: "get", url: "DownloadDetails.aspx", data: content_show + "&"+ d.getTime() + "&ProductLineId=" + appId,
			success: function(html) { //so, if data is retrieved, store it in html
				$("#downloadContent").html(html); //show the html inside .content div
				$("#downloadContent").fadeIn("slow"); //animation
				$("#loading").hide();
				
			}
		}); //close $.ajax(
        }
	
	window.location = "#" + content_show;
	
	        //reload the accordian
	    $(".relatedCategory").removeClass("relatedCategory").addClass("menCategoryAccordian");
	    $('.menuProductAccordian a').removeClass("current");
		$('.menCategoryAccordian').removeClass("menCategoryAccordianSelected");
		jQuery('#list1a').accordion("destroy");
		jQuery('#list1a').accordion({
			alwaysOpen: false,
			autoheight: false,
			header: '.menCategoryAccordian',
			active: false,
			selectedClass: 'menCategoryAccordianSelected',
			navigation: true,
			clearStyle: true
		});
}); //close click(

/*
$('.searchboxProduct a').livequery('click', function() {
	$("#pageContent").fadeOut("fast");
	$("#downloadContent").fadeOut("fast");
	$("#loading").fadeIn("fast");
	var content_show1 = $(this).attr("href").replace(/^[^#]*#/, '#'); // get rid of any
	var content_show = content_show1.replace('#', ''); //retrieve title of link so we can compare with php file
	content_show = content_show.replace('?', '');
	var d = new Date();
*/
	/*
	if (jQuery.browser.msie) {
	    
        $.ajax({
			method: "get", url: "Details.aspx", data: content_show + "&"+ d.getTime(),
			success: function(html) { //so, if data is retrieved, store it in html
				$("#pageContent").html(html); //show the html inside .content div
				$("#pageContent").fadeIn("slow"); //animation
                $('h1').sifr({
		            font: 'ITC Franklin Gothic', 
		            textTransform: 'uppercase',
		            color: '#075c22',
		            path: '/sifr'
	            });
			}, 

            error:function(event, request, settings){ 
            alert("Ajax failed!"+event+request+settings); 
            } 
			
		}); //close $.ajax(
		$.ajax({
			method: "get", url: "DownloadDetails.aspx", data: content_show + "&"+ d.getTime(),
			success: function(html) { //so, if data is retrieved, store it in html
				$("#downloadContent").html(html); //show the html inside .content div
				$("#downloadContent").fadeIn("slow"); //animation
				$("#loading").hide();
				
			}
		}); //close $.ajax(
        }
	*/
/*	window.location = content_show;*/
	/*
	$("#searchTopResidential").fadeOut("fast");
	$("#searchTopCommercial").fadeOut("fast");
	        //reload the accordian
	    $(".relatedCategory").removeClass("relatedCategory").addClass("menCategoryAccordian");
	    $('.menuProductAccordian a').removeClass("current");
		$('.menCategoryAccordian').removeClass("menCategoryAccordianSelected");
		jQuery('#list1a').accordion("destroy");
		jQuery('#list1a').accordion({
			alwaysOpen: false,
			autoheight: false,
			header: '.menCategoryAccordian',
			active: false,
			selectedClass: 'menCategoryAccordianSelected',
			navigation: true,
			clearStyle: true
		});
		*/
/*
}); //close click(
*/
	    
/*	    
$('.searchboxCategory a').livequery('click', function() {
	$("#pageContent").fadeOut("fast");
	$("#downloadContent").fadeOut("fast");
	$("#loading").fadeIn("fast");
	var content_show1 = $(this).attr("href").replace(/^[^#]*#/, '#'); // get rid of any
	var content_show = content_show1.replace('#', ''); //retrieve title of link so we can compare with php file
	content_show = content_show.replace('?', '');
*/
	/*
	if (jQuery.browser.msie) {
	    
        $.ajax({
			method: "get", url: "Details.aspx", data: content_show,
			success: function(html) { //so, if data is retrieved, store it in html
				$("#pageContent").html(html); //show the html inside .content div
				$("#pageContent").fadeIn("slow"); //animation
                $('h1').sifr({
		            font: 'ITC Franklin Gothic', 
		            textTransform: 'uppercase',
		            color: '#075c22',
		            path: '/sifr'
	            });
			}, 

            error:function(event, request, settings){ 
            alert("Ajax failed!"+event+request+settings); 
            } 
			
		}); //close $.ajax(
		$.ajax({
			method: "get", url: "DownloadDetails.aspx", data: content_show,
			success: function(html) { //so, if data is retrieved, store it in html
				$("#downloadContent").html(html); //show the html inside .content div
				$("#downloadContent").fadeIn("slow"); //animation
				$("#loading").hide();
				
			}
		}); //close $.ajax(
    }
	*/
/*	window.location = content_show; */
	
	/*
	$("#searchTopResidential").fadeOut("fast");
	$("#searchTopCommercial").fadeOut("fast");
	        //reload the accordian
	    $(".relatedCategory").removeClass("relatedCategory").addClass("menCategoryAccordian");
	    $('.menuProductAccordian a').removeClass("current");
		$('.menCategoryAccordian').removeClass("menCategoryAccordianSelected");
		jQuery('#list1a').accordion("destroy");
		jQuery('#list1a').accordion({
			alwaysOpen: false,
			autoheight: false,
			header: '.menCategoryAccordian',
			active: false,
			selectedClass: 'menCategoryAccordianSelected',
			navigation: true,
			clearStyle: true
		});
	*/	
/*
}); //close click(
*/