var actPage ="";

var path = "";
//popup functionality
window.onerror=null;
var win = null;
function PopWindow(mypage,myname) {
	//closePopWin();
	winprops = 'height=500,width=820,top=30,left=0,scrollbars=1,resizable=1,status=1';
	win = window.open(mypage, myname, winprops);
	}
function SizedPopWindow(mypage,myname,w,h) {
	//closePopWin();
	winprops = 'height='+h+',width='+w+',top=30,left=0,scrollbars=1,resizable=1,status=1';
	win = window.open(mypage, myname, winprops);
	}
function closePopWin() {
	if(win != null) { 
		if(!win.closed) { 
			win.close();
			win = null;
			} else {
			win = null;
			}
		}	
	}

if (document.images){

   
	// new images, post redesign
	// top nav images
	/*
    n_solutionon = new Image
	n_solutionoff = new Image
	n_solutionroll = new Image
	n_clogson = new Image
	n_clogsoff = new Image
	n_clogsroll = new Image
	n_productson = new Image
	n_productsoff = new Image
	n_productsroll = new Image
	
	// product page nav images
	p_howitworkson = new Image
	p_howitworksoff = new Image
	p_howitworksroll = new Image
	p_directionson = new Image
	p_directionsoff = new Image
	p_directionsroll = new Image
	p_precautionson = new Image
	p_precautionsoff = new Image
	p_precautionsroll = new Image
	
	
	n_solutionon.src = path+"/i/tab_solutionfinder_on.gif"
	n_solutionoff.src = path+"/i/tab_solutionfinder_off.gif"
	n_solutionroll.src = path+"/i/tab_solutionfinder_roll.gif"
	n_clogson.src = path+"/i/tab_clogs101_on.gif"
	n_clogsoff.src = path+"/i/tab_clogs101_off.gif"
	n_clogsroll.src = path+"/i/tab_clogs101_roll.gif"
	n_productson.src = path+"/i/tab_products_on.gif"
	n_productsoff.src = path+"/i/tab_products_off.gif"
	n_productsroll.src = path+"/i/tab_products_roll.gif"
	
	p_howitworkson.src = path+"/i/btn_howitworks_on.gif"
	p_howitworksoff.src = path+"/i/btn_howitworks_off.gif"
	p_howitworksroll.src = path+"/i/btn_howitworks_roll.gif"
	p_directionson.src = path+"/i/btn_directions_on.gif"
	p_directionsoff.src = path+"/i/btn_directions_off.gif"
	p_directionsroll.src = path+"/i/btn_directions_roll.gif"
	p_precautionson.src = path+"/i/btn_precautions_on.gif"
	p_precautionsoff.src = path+"/i/btn_precautions_off.gif"
	p_precautionsroll.src = path+"/i/btn_precautions_roll.gif"
	
}
else {

	n_solutionon.src = ""
	n_solutionoff.src = ""
	n_solutionroll.src = ""
	n_clogson.src = ""
	n_clogsoff.src = ""
	n_clogsroll.src = ""
	n_productson.src = ""
	n_productsoff.src = ""
	n_productsroll.src = ""
	
	p_howitworkson = ""
	p_howitworksoff = ""
	p_howitworksroll = ""
	p_directionson = ""
	p_directionsoff = ""
	p_directionsroll = ""
	p_precautionson = ""
	p_precautionsoff = ""
	p_precautionsroll = ""
	*/
}
	
var DHTML = (document.getElementById || document.all || document.layers);

// navigation on/off




function swapbtn(btnId, x) {
    /*
	if(actPage != btnId){
		if(x == "out"){document.getElementById(btnId).src=("../i/tab_" + btnId + "_off.gif");}
		if(x == "over"){document.getElementById(btnId).src=("../i/tab_" + btnId + "_roll.gif");}
	}
    */
}

// function: show / hide menu
function showMenu(menuId) {
	document.getElementById(menuId).style.display="";
}

function hideMenu(menuId) {
	document.getElementById(menuId).style.display="none";
}

// function: show / hide tabs
function showTab(tabId) {
/*
	document.getElementById('tab1').style.display="none";
	document.getElementById('tab2').style.display="none";
	document.getElementById('tab3').style.display="none";
	document.getElementById('tab1a').style.display="none";
	document.getElementById('tab2a').style.display="none";
	document.getElementById('tab3a').style.display="none";
	document.getElementById('tab1b').style.display="inline";
	document.getElementById('tab2b').style.display="inline";
	document.getElementById('tab3b').style.display="inline";
	document.getElementById(tabId+'b').style.display="none";
	document.getElementById(tabId+'a').style.display="inline";
	document.getElementById(tabId).style.display="block";
    */
}

// function: faq / ideas
function switchy(item) {
	/*
	for (i = 1; i <= 7; i++)
	{
	document.getElementById('c'+i).src='/i/btn_top_off.gif';
	}

	for (i = 1; i <= 7; i++)
	{
	document.getElementById('c'+i+'a').className='arrowOff';
	}

	for (i = 1; i <= 7; i++)
	{
	document.getElementById('c'+i+'b').src='/i/btn_btm_off.gif';
	}

	document.getElementById(item).src='/i/btn_top_on.gif';
	document.getElementById(item+'b').src='/i/btn_btm_on.gif';
	document.getElementById(item+'a').className='arrowDown';
    */
}
	
if (DHTML)
	var doc = 'document.', vis='.visibility';
if (document.all)
	var doc = 'document.all.', vis = '.style.visibility';
// below check enables NN 6.x compatibility
if (!document.all && document.getElementById)
    var doc = 'document.getElementById("', vis = '").style.visibility';

//The below functions enable & Hide the dropdown of header section [written for IE6]
    function displayDropDown(obj) 
    {
        var obj_list = obj.id + '_list';
        document.getElementById(obj_list).style.display = "block";
    }
    function hideDropDown(obj)
    {
        var obj_list = obj.id + '_list';
        document.getElementById(obj_list).style.display = "none";
    }

// The below functions are written for the mosue hover when hovered on sub nav links
    function changetoNewColor(obj1, obj2) {
        document.getElementById(obj1).style.backgroundColor = "#D81720";
        document.getElementById(obj1).style.color = "White";
        document.getElementById(obj2).style.color = "White";

    }
    function changetoOldColor(obj1, obj2) {
        document.getElementById(obj1).style.backgroundColor = "#F9F9F9";
        document.getElementById(obj1).style.color = "black";
        document.getElementById(obj2).style.color = "black";
    }



    function activateMenu(menuName) {
        if (menuName == 'Products') {
            $('#products').addClass('active_tab');
        }
        else if (menuName == 'Solutions') {
            $('#solutionfinder').addClass('active_tab');
        }
        else if (menuName == 'en-US') {
            var URL = location.pathname;
            if (URL.indexOf('Clogs') != -1 || URL.indexOf('FAQ') != -1) {
                $('#clogs101').addClass('active_tab');
            }
        }
    }

    $(document).ready(function () {
        if ($.browser.msie) {
            if (parseInt($.browser.version, 10) == 7) {
                $('.navigation').css({ 'width': '374px'});
            }
        }

    });
