//popup functionality - taken directly from the RAID utility.js
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;
			}
		}	
	}

//faq toggle
function toggle(obj) {
	var el = document.getElementById(obj);
	var ar = document.getElementById(obj+'ar');
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
		ar.innerHTML = '<img src="/Style Library/Images/arrow_right.gif" style="width:5px;height:9px;" alt="" title="" />';
	}
	else {
		el.style.display = 'block';
		ar.innerHTML = '<img src="/Style Library/Images/arrow_down.gif" style="width:9px;height:5px;" alt="" title="" />';
	}

}

//navigation rollovers
function load(defImg) {
    if (document.getElementById(defImg) != null && document.getElementById(defImg) != 'undefined')
	    document.getElementById(defImg).src=("/en-US/PublishingImages/i/left/nav_" + defImg + "_on.gif");
}

sfHover = function() {
	var sfEls = document.getElementById("leftNav").getElementsByTagName("a");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent && document.getElementById("leftNav") != null) window.attachEvent("onload", sfHover);


// 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 showTab4(tabId) {
	document.getElementById('tab1').style.display="none";
	document.getElementById('tab2').style.display="none";
	document.getElementById('tab3').style.display="none";
	document.getElementById('tab4').style.display="none";
	document.getElementById('tab1a').style.display="none";
	document.getElementById('tab2a').style.display="none";
	document.getElementById('tab3a').style.display="none";
	document.getElementById('tab4a').style.display="none";
	document.getElementById('tab1b').style.display="inline";
	document.getElementById('tab2b').style.display="inline";
	document.getElementById('tab3b').style.display="inline";
	document.getElementById('tab4b').style.display="inline";
	document.getElementById(tabId+'b').style.display="none";
	document.getElementById(tabId+'a').style.display="inline";
	document.getElementById(tabId).style.display="block";
}

// function: clear form field
function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = "";
  el.setAttribute('maxLength','9');
}


//Added by AG Moved from Omniture_methods.js

function getQueryString(parameter) {
    var queryString = window.location.search.substring(1);
    var sections = queryString.split("&");
    var store = new Array();
    for (var i = 0; i < sections.length; i++) {
        var pieces = sections[i].split("=");
        if (pieces.length > 1) {
            store[pieces[0]] = pieces[1];
        } else {
            store[pieces[0]] = null;
        }
    }
    if (parameter == null) {
        return store;
    }
    if (typeof store[parameter] != undefined) {
        return store[parameter];
    }
    return null;
}

function clearDefault(el) {
    if (el.defaultValue == el.value) el.value = "";
    el.setAttribute('maxLength', '9');
}

// dynamic updation of date

$(document).ready(function () {

    $('.currentYear').html((new Date()).getFullYear());

});
