﻿// JScript File
function doSearch()
{
    if (document.srchFrm.kw.value != "") 
        return true;
    
    return false;
}

function gotoProduct(obj)
{
    window.location.href = "Product.aspx?p=" + obj.options[obj.selectedIndex].value;
}

function showLayer(id, link)
{
	document.getElementById(id).style.visibility = 'visible';
	document.getElementById(link).style.backgroundColor = '#003366';
	document.getElementById(link).style.color = '#ffffff';
}

function hideLayer(id, link)
{
	document.getElementById(id).style.visibility = 'hidden';
	//window.setTimeout("hl('"+id+"')", 1500);
	document.getElementById(link).style.backgroundColor = '#fff';
	document.getElementById(link).style.color = '';
}


function MM_openBrWindow(theURL,winName,features) 
{ 
  window.open(theURL,winName,features);
}



function MM_swapImage() 
{
  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_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//******************************************
currentLayer = 1;
//******************************************
function showLayer1(num)
{
	var layerName ="";
	//--------------------------[Hamdy  count the anchors from the page // used in BIM page and Steel_Framoing_products]
	var len = 0;
	var ans = document.anchors
	for(i=0;i<=ans.length-1;i++)
	{
	var str = ans[i].id;
	if(str.substring(0,4)== "link")
	    len++;
}
//-------------------	
	for (i=1; i<=len; i++)
	{
		var layerName = "pro" + i;
		document.getElementById(layerName).style.display='none';
		document.getElementById("link" + i).style.color='#000066';
	}
	document.getElementById("link" + num).style.color = "#7680FE";
	document.getElementById("pro" + num).style.display='block';
	}
	
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 checkLayer(num)
{
    if (currentLayer!= num)
    {
	    document.getElementById("pro" + num).style.display='none';
	    document.getElementById("link" + num).style.color='#000066';
	    document.getElementById("pro" + currentLayer).style.display='block';
	    document.getElementById("link" + currentLayer).style.color='#7680FE';
    }
}

function setCurrentLayer(num)
{
	currentLayer = num;
}



var str = ["Hilton Garden Inn - Durham, NC",
              "UNC-G Dorm - Greensboro, NC" ,
			"Old Dominion University - Quad Housing",
			 "Hampton Inn - Dunn, NC", 
			" Venice Lofts - Manayunk, PA",
			"Wyndham Hotel - Gettysburg, PA",
			];
			
var imgs = ["Hilton Garden Inn - Charlottesville, VA.jpg", "UNC-G Dormitory - Greensboro, NC.jpg", "Old Dominion University -  Quad Housing.jpg", "Hampton Inn - Dunn, NC.jpg", "Venice Lofts - Manayunk, PA.jpg", "Wyndham Hotel - Gettysburg, PA.jpg"];
var currentIndex = 0;
var timeOutID = 0;

function changePicture()
{


			document.getElementById("projTitle").innerHTML=str[currentIndex];
			document.getElementById("projImg").src="images/new/" + imgs[currentIndex];
			if (currentIndex == 5)
				currentIndex = 0;
			else
				currentIndex ++;
			timeoutID = setTimeout("changePicture()", 3000);

}

function getRadioSelectedValue(radioList)
{
    var options = document.getElementById(radioList).getElementsByTagName('input');
    for(i=0;i<options.length;i++)
    {
        var opt = options[i];
        if(opt.checked)
        {
        return opt.value;
        }
     }
}