// JavaScript for www.strongtie.com
document.write("<scr"+"ipt src='//www.google.com/jsapi?key=ABQIAAAA0HleqRswk31Scb-OE456YxQxQscgaG67s49gx8xqYAS8TFW2wBS-F4OEITLTNZUgAOg3rlF_md0Zjw' type='text/javascript'>\<\/scr"+"ipt>");
document.write("<scr"+"ipt src='//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text\/javascript'>\<\/sc"+"ript>");


//this doesn't work with Fastener Finder...
//<![CDATA[
    <!--google.load('jquery', '1');-->
//]]>


// Google Analytics a
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2010971-2']);
_gaq.push(['_trackPageview']);

(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();



//  Opt-in for Social Interaction tab in Google Analytics for AddThis buttons
 var addthis_config = {
	data_ga_property: 'UA-2010971-2',
	data_ga_social : true
 };

// Used mostly to normalize URLs in  Google Analytics
function getAbsolutePath(url) {
	var str = url.toLowerCase();
	var L= location.href;	
	if (L.substring(0, L.indexOf('/',8)) == "http://strongtie.com") L = "http://www.strongtie.com" + L.substring(L.indexOf('/',8), L.length);
	
	var ax=L.indexOf(location.pathname)+ 1;
	var Rte= L.substring(0,ax);
	try{
	if (/^\//.test(str)) return Rte + str.substring(1);
	if (/^(mailto|http)\:/.test(str)) return str;	
	var Loc = L;
	ax = Loc.lastIndexOf('/');
	Loc = Loc.substring(0, ax);
	var L2 = Rte.length;
	while (/^\.\.\//.test(str)) { 
	if (ax < L2) return L;
	ax = Loc.lastIndexOf('/');
	Loc = Loc.substring(0, ax);
	str = str.substring(3);
	}
	return Loc + '/' + str;
	}
	catch(er){
	return L; // or return '';
	}
}


function doClock(){ // By Paul Davis - www.kaosweaver.com
  var t=new Date(),a=doClock.arguments,str="",i,a1,lang="1";
  var month=new Array('January','Jan', 'February','Feb', 'March','Mar', 'April','Apr', 'May','May', 'June','Jun', 'July','Jul', 'August','Aug', 'September','Sep', 'October','Oct', 'November','Nov', 'December','Dec');
  var tday= new Array('Sunday','Sun','Monday','Mon', 'Tuesday','Tue', 'Wednesday','Wed','Thursday','Thr','Friday','Fri','Saturday','Sat');
  for(i=0;i<a.length;i++) {a1=a[i].charAt(1);switch (a[i].charAt(0)) {
  case "M":if  ((Number(a1)==3) && ((t.getMonth()+1)<10)) str+="0";
  str+=(Number(a1)>1)?t.getMonth()+1:month[t.getMonth()*2+Number(a1)];break;
  case "D": if ((Number(a1)==1) && (t.getDate()<10)) str+="0";str+=t.getDate();break;
  case "Y": str+=(a1=='0')?t.getFullYear():t.getFullYear().toString().substring(2);break;
  case "W":str+=tday[t.getDay()*2+Number(a1)];break; default: str+=unescape(a[i]);}}return str;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { 
//  var win = window.open(theURL,winName,features);
//  if (win && win.open && !win.closed) {
//		win.close();
//	}

	var win=window.open(theURL,winName,features);
	win.focus();

}


function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function hideAllDivsIn(which) {
	var hiddenDiv = document.getElementById(which);
	var hiddenLayers = hiddenDiv.getElementsByTagName("div");
	for (i=0; i < hiddenLayers.length; i++) {
		if (i>0) {
			if (hiddenLayers[i].parentNode.style.visibility == 'hidden') {
					//alert('previous div was hidden');
			}
			else {
				hiddenLayers[i].style.visibility = 'hidden';
			}
		}
		else {
			hiddenLayers[i].style.visibility = 'hidden';
		}
	}
}


function hideshow(which)
{
if (!document.getElementById|document.all) { return }
else
	{
		if (document.getElementById) { oWhich = eval ("document.getElementById('" + which + "')") }
		else { oWhich = eval ("document.all." + which) }
	}
	window.focus();
	if (oWhich.style.display=="none") { oWhich.style.display="" }
	else { oWhich.style.display="none" }
}


function hidethis(which)
{
if (!document.getElementById|document.all) { return }
else
	{
		if (document.getElementById) { oWhich = eval ("document.getElementById('" + which + "')") }
		else { oWhich = eval ("document.all." + which) }
	}
	window.focus();
	if (oWhich.style.display=="none") { oWhich.style.display="none" }
	else { oWhich.style.display="none" }
}

function showthis(which)
{
if (!document.getElementById|document.all) { return }
else
	{
		if (document.getElementById) { oWhich = eval ("document.getElementById('" + which + "')") }
		else { oWhich = eval ("document.all." + which) }
	}
	window.focus();
	if (oWhich.style.display=="none") { oWhich.style.display="" }
	else { oWhich.style.display="" }
}



function hideshowJumplinks() 
{

	if (document.getElementById('code_reports')!=null) { 
		if (document.getElementById('code_reports_jumplink')!=null) {
			showthis('code_reports_jumplink'); 
		} 
		else {
			if (jQuery('#gallery_jumplink')!= null) {
				jQuery('#gallery_jumplink').after('<li id="code_reports_jumplink"><a href="#codes" class="linklist">Code Reports</a></li>');
			}
			else {	
				jQuery("#jumplinklist").append('<li id="code_reports_jumplink"><a href="#codes" class="linklist">Code Reports</a></li>');
			}
		}
	} 
	else { 
		if (document.getElementById('code_reports_jumplink')!=null) {
			hidethis('code_reports_jumplink'); 
		} 
		else {
		}
	}


//	if (document.getElementById('drawings')!=null) { showthis('drawings_jumplink') }
//	else { hidethis('drawings_jumplink') }

	if (document.getElementById('drawings')!=null) { 
		if (document.getElementById('drawings_jumplink')!=null) {
			showthis('drawings_jumplink'); 
		} 
		else {
			if (jQuery('#code_reports_jumplink')) {
				jQuery('#code_reports_jumplink').after('<li id="drawings_jumplink"><a href="#drawings" class="linklist">Drawings</a></li>');
			}
			else {	
				jQuery("#jumplinklist").append('<li id="drawings_jumplink"><a href="#drawings" class="linklist">Drawings</a></li>');
			}
		}
	} 
	else { 
		if (document.getElementById('drawings_jumplink')!=null) {
			hidethis('drawings_jumplink'); 
		} 
		else {
			
		}
	}


//	if (document.getElementById('catalog_pages')!=null) { showthis('catalog_pages_jumplink') }
//	else { hidethis('catalog_pages_jumplink') }
	if (document.getElementById('catalog_pages')!=null) { 
		if (document.getElementById('catalog_pages_jumplink')!=null) {
			showthis('catalog_pages_jumplink'); 
		} 
		else {
			if (jQuery('#drawings_jumplink')) {
				jQuery('#drawings_jumplink').after('<li id="catalog_pages_jumplink"><a href="#catalogs" class="linklist">Catalog Pages</a></li>');
			}
			else {	
				jQuery("#jumplinklist").append('<li id="catalog_pages_jumplink"><a href="#catalogs" class="linklist">Catalog Pages</a></li>');
			}
		}
	} 
	else { 
		if (document.getElementById('catalog_pages_jumplink')!=null) {
			hidethis('catalog_pages_jumplink'); 
		} 
		else {
			
		}
	}

//	if (document.getElementById('related_products')!=null) { showthis('related_products_jumplink') }
//	else { hidethis('related_products_jumplink') }
	if (document.getElementById('related_products')!=null) { 
		if (document.getElementById('related_products_jumplink')!=null) {
			showthis('related_products_jumplink'); 
		} 
		else {
			if (jQuery('#catalog_pages_jumplink')) {
				jQuery('#catalog_pages_jumplink').after('<li id="related_products_jumplink"><a href="#products" class="linklist">Anchoring Solutions</a></li>');
			}
			else {	
				jQuery("#jumplinklist").append('<li id="related_products_jumplink"><a href="#products" class="linklist">Anchoring Solutions</a></li>');
			}
		}
	} 
	else { 
		if (document.getElementById('related_products_jumplink')!=null) {
			hidethis('related_products_jumplink'); 
		} 
		else {
			
		}
	}


//	if (document.getElementById('related_categories')!=null) { showthis('related_categories_jumplink') }
//	else { hidethis('related_categories_jumplink') }
	if (document.getElementById('related_categories')!=null) { 
		if (document.getElementById('related_categories_jumplink')!=null) {
			showthis('related_categories_jumplink'); 
		} 
		else {
			if (jQuery('#catalog_pages_jumplink')) {
				jQuery('#catalog_pages_jumplink').after('<li id="related_categories_jumplink"><a href="#categories" class="linklist">Related Categories</a></li>');
			}
			else {	
				jQuery("#jumplinklist").append('<li id="related_categories_jumplink"><a href="#categories" class="linklist">Related Categories</a></li>');
			}
		}
	} 
	else { 
		if (document.getElementById('related_categories_jumplink')!=null) {
			hidethis('related_categories_jumplink'); 
		} 
		else {
			
		}
	}

//	if (document.getElementById('technical_bulletins')!=null) { showthis('technical_bulletins_jumplink') }
//	else { hidethis('technical_bulletins_jumplink') }
	if (document.getElementById('technical_bulletins')!=null) { 
		if (document.getElementById('technical_bulletins_jumplink')!=null) {
			showthis('technical_bulletins_jumplink'); 
		} 
		else {
			if (jQuery('#related_categories_jumplink')) {
				jQuery('#related_categories_jumplink').after('<li id="technical_bulletins_jumplink"><a href="#techbulls" class="linklist">Technical Bulletins</a></li>');
			}
			else {	
				jQuery("#jumplinklist").append('<li id="technical_bulletins_jumplink"><a href="#techbulls" class="linklist">Technical Bulletins</a></li>');
			}
		}
	} 
	else { 
		if (document.getElementById('technical_bulletins_jumplink')!=null) {
			hidethis('technical_bulletins_jumplink'); 
		} 
		else {
			
		}
	}

//	if (document.getElementById('fliers')!=null) { showthis('fliers_jumplink') }
//	else { hidethis('fliers_jumplink') }
	if (document.getElementById('fliers')!=null) { 
		if (document.getElementById('fliers_jumplink')!=null) {
			showthis('fliers_jumplink'); 
		} 
		else {
			if (jQuery('#technical_bulletins_jumplink')) {
				jQuery('#technical_bulletins_jumplink').after('<li id="fliers_jumplink"><a href="#fliers" class="linklist">Fliers</a></li>');
			}
			else {	
				jQuery("#jumplinklist").append('<li id="fliers_jumplink"><a href="#fliers" class="linklist">Fliers</a></li>');
			}
		}
	} 
	else { 
		if (document.getElementById('fliers_jumplink')!=null) {
			hidethis('fliers_jumplink'); 
		} 
		else {
			
		}
	}

//	if (document.getElementById('featured_literature')!=null) { showthis('featured_literature_jumplink') }
//	else { hidethis('featured_literature_jumplink') }
	if (document.getElementById('featured_literature')!=null) { 
		if (document.getElementById('featured_literature_jumplink')!=null) {
			showthis('featured_literature_jumplink'); 
		} 
		else {
			if (jQuery('#fliers_jumplink')) {
				jQuery('#fliers_jumplink').after('<li id="featured_literature_jumplink"><a href="#featuredlit" class="linklist">Featured Literature</a></li>');
			}
			else {	
				jQuery("#jumplinklist").append('<li id="featured_literature_jumplink"><a href="#featuredlit" class="linklist">Featured Literature</a></li>');
			}
		}
	} 
	else { 
		if (document.getElementById('featured_literature_jumplink')!=null) {
			hidethis('featured_literature_jumplink'); 
		} 
		else {
			
		}
	}



}




function toggle(imagename,src1,src2){      
    if(document.images && document.images[imagename]){
        arrow=new Image;
        arrow.src=src1;
        if(document.images[imagename].src != arrow.src){
            document.images[imagename].src = arrow.src
        }
        else{
            document.images[imagename].src=src2
        }
    }
}


function disclaimer(){
  message = "Notice: By clicking this link, you will be downloading information from a web site that Simpson Strong-Tie does not maintain. \n";
  
  alert(message);
}



function getParameterByName(name)
{
  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  var regexS = "[\\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(window.location.search);
  if(results == null)
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}



