/*============================================================================
====================== COMMON FRAMEWORK FUNCTIONS ============================
============================================================================*/
/*VARIABLES*/
var browser            = new Browser();
var queryHash          = new Array();
var memoryArr          = [];


String.prototype.gReplace = function(repChar, repWith){return this.replace(new RegExp(repChar, 'ig'), repWith)};
String.prototype.makeSearchStr = function(){var searchTxt = escapeSplChars(this);	searchTxt = searchTxt.replace(/\s/g,"+"); searchTxt = searchTxt.replace(/[\+]+/g,"+"); searchTxt = replaceQuotes(searchTxt); return escape(searchTxt);};



function escapeSplChars(str){  
	str = str.replace(/[&]/g,'');
	str = str.replace(/[%]/g,'');
	return str;
}

function replaceQuotes(str){  
    str = str.replace(/["]/g,"''");
    return str;
}

function outerHTML(obj)
{
	var tsd = document.createElement("div");
	var copyOb = obj.cloneNode(true);
	tsd.appendChild(copyOb);
	return tsd.innerHTML
}

function generateQueryHash(locationObj)
{
	var queryParams = locationObj.search.substring(1).split("&");
	try
	{
		for(qh=0; qh<queryParams.length; qh++)
		{
			queryHash[queryParams[qh].split("=")[0]] = queryParams[qh].split("=")[1];
		}
	}
	catch(e)
	{
		//alert("Error inside function generateQueryHash");
	}
}

// GENERATE QUERY HASH OBJECT
generateQueryHash(window.document.location);

function Browser()
{
	try
	{
		this.moz       = (!document.all)?1:0;
		this.ie5       = (document.all)?1:0;
		this.ie6strict = (document.documentElement && document.documentElement.clientHeight)?1:0;
		this.ie6       = (navigator.appVersion.indexOf('MSIE 6')!=-1)?1:0;
		this.ie7       = (navigator.appVersion.indexOf('MSIE 7')!=-1)?1:0;
		this.safari    = (navigator.userAgent.toLowerCase().indexOf("safari") != -1)?1:0;
		this.is_aol    = (navigator.userAgent.toLowerCase().indexOf("aol") != -1)?1:0;
	}
	catch(e)
	{
		//alert("Error inside function Browser");
	}
}

function $(objId)
{
	return document.getElementById(objId);
}

function createThisElement(elementName, attribs)
{
	try
	{
		var tmpElement = document.createElement(trim(elementName));
		var arrAttribs = [];
		var tmpAttr = null;
		arrAttribs = attribs.split(',');
		for(i=0; i<arrAttribs.length; i++)
		{
			arrAttrVal = trim(arrAttribs[i]).split('=');
			tmpAttr = document.createAttribute(arrAttrVal[0]);
			tmpAttr.nodeValue = arrAttrVal[1].toString();
			tmpElement.setAttributeNode(tmpAttr);
		}
		return tmpElement;
	}
	catch(e)
	{
		//alert("Error inside function createThisElement");
	}
}

function trim(str){
   return str.replace(/^\s*|\s*$/g,"");
}


function collect(a,f){var n=[];for(var i=0;i<a.length;i++){var v=f(a[i]);if(v!=null)n.push(v)}return n};







//window.onerror = function(){return true};
/***********************************************************************************************
                    BROWSER DETECTION CODE
***********************************************************************************************/
function Is () {
    var ua = navigator.userAgent.toLowerCase();

   this.isGecko       = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
   this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);
   this.isKonqueror   = (ua.indexOf('konqueror') != -1);
   this.isSafari      = (ua.indexOf('safari') != - 1);
   this.isOmniweb     = (ua.indexOf('omniweb') != - 1);
   this.isOpera       = (ua.indexOf('opera') != -1);
   this.isIcab        = (ua.indexOf('icab') != -1);
   this.isAol         = (ua.indexOf('aol') != -1);
   this.isIE          = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) );
   this.isMozilla     = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
   this.isFirebird    = (ua.indexOf('firebird/') != -1);
   this.isNS          = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
   this.isns6 = (navigator.userAgent.indexOf("Netscape6") != -1)
   this.isns7 = (navigator.userAgent.indexOf("Netscape/7.0") != -1)
   this.isns702 = (navigator.userAgent.indexOf("Netscape/7.02") != -1)
   this.isns9              = (navigator.userAgent.indexOf("Netscape/9.0") != -1)
   this.compu70 = (ua.indexOf("7.0/7.0") != -1)
   this.compu60 = (ua.indexOf("cs 2000 6.0") != -1);
   this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
   this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
   this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
   this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
   this.appleWebKitVersion = ( (this.isAppleWebKit) ? parseFloat( ua.substring( ua.indexOf('applewebkit/') + 12) ) : -1 );
   this.versionMinor = parseFloat(navigator.appVersion);

   if (this.isGecko && !this.isMozilla && !this.isns9) 
   {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
   } 
   else if (this.isMozilla) 
   {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
   } 
   else if (this.isIE && this.versionMinor >= 4) 
   {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
   } 
   else if (this.isKonqueror) 
   {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
   } 
   else if (this.isSafari) 
   {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
   } 
   else if (this.isOmniweb) 
   {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('omniweb/') + 8 ) );
   } 
   else if (this.isOpera) 
   {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera') + 6 ) );
   } 
   else if (this.isIcab) 
   {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab') + 5 ) );
   }
   else if (this.isns9) 
   {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('netscape') + 9 ) );
   }
   
   this.versionMajor = parseInt(this.versionMinor);
   this.isDOM1 = (document.getElementById);
   this.isDOM2Event = (document.addEventListener && document.removeEventListener);
   this.mode = document.compatMode ? document.compatMode : 'BackCompat';
   this.isWin    = (ua.indexOf('win') != -1);
   this.isWin32  = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
   this.isMac    = (ua.indexOf('mac') != -1);
   this.isUnix   = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
   this.isLinux  = (ua.indexOf('linux') != -1);
   this.isIE3 = (this.isIE && this.versionMajor < 4);
   this.isIE4x = (this.isIE && this.versionMajor == 4);
   this.isIE5x = (this.isIE && this.versionMajor == 5);
   this.isIE55 = (this.isIE && this.versionMinor == 5.5);
   this.isIE6x = (this.isIE && this.versionMajor == 6);
   this.is_nav5down = (this.isNS && this.versionMajor < 5);
}

var is = new Is();

if (is.compu70)
{
    window.location.href='http://www.pinpointshopping.com';
}

if (is.is_nav5down || is.isIE3 || is.isIE4x || (is.isIE5x && !is.isIE55) || is.isns6 || (is.isMac && is.isIE)) 
{
    window.location.href='/browserError.html';
}

/************************************************************* END **************************************************************/

currentUrl = window.location.search;
currentDomain = document.domain;
var isHasFlash = false;
var isFlashCount = 0;
var is_aol = navigator.userAgent.toLowerCase().indexOf("aol") != -1;
var isWL = 0;
var reqWait = 1;
var showSLNoRes = false;
var searchFieldText='Search Shopping';
var valueModified = false;
var muzeText = "";

function isinit() {
   if (!hasAnchor()) {
       if(isgE('searchField') && isgE('searchField').value && isgE('searchField').value.length < 1){
    issetSearchFieldFocus();
   }
   }
    document.body.style.height = document.documentElement.scrollHeight+'px';
    //reloadHTML();
}

function hasAnchor() {
    var anc1 = location.hash;
    if (anc1 != null && anc1.length > 0) {
        return true;
    }
}



function issetSearchFieldFocus() {
    if (isgE('rapportSearch')) {
        if(isgE('rapportSearch').style.display!='none' && isgE('searchField')) isgE('searchField').focus();
    }
}

function doSearch ( s ) {
    var regExp1 = /\homer\b/;
    var regExp2 = /[(,),<,>,\[,\],*]/;
    var str = s.value;
    if ( str == "" ) {
        s.focus();
    } else {
        if ( typeof regExp1.source != 'undefined' ) //supports regular expression testing
            if ( regExp1.test( str ) || regExp2.test( str ) ){
                var alrt = "Please note that you can not include:";
                alrt += "\n\nThe reserved characters [, ], (, ), *, < or >";
                alrt += "\n\nin your search query!\n";
                s.focus();
                return alert( alrt );
            }
        document.frm.name.value = document.frm.Query.value;
        document.frm.submit();
    }
}


function setShim(){
    if ((navigator.userAgent.toLowerCase().indexOf("msie") != -1) || 
        (navigator.userAgent.toLowerCase().indexOf("safari") != -1)) {
        if (getObject('loginLayer') && getObject('shim')) {
            // copying certain attributes from loginLayer into the shim iframe
            var shim = getObject('shim').style;
            var logL = getObject('loginLayer').style;

            var atb = new Array('position', 'left', 'top', 'width', 'height', 'zIndex');
            for(i=0; i < atb.length; i++) {
                if (atb[i] == 'zIndex') // set z-index one less to sit behind the diplay
                    shim[atb[i]] = logL[atb[i]] - 1;
                else if (atb[i] == 'width' || atb[i] == 'height') // add 2 to width and height to account for border on display
                    shim[atb[i]] = (parseInt(logL[atb[i]]) + 2) + 'px'
                else
                    shim[atb[i]] = logL[atb[i]];
            }
        }

        var list = document.getElementsByTagName('a');

        for(i=0; i < list.length; i++) {
            if (list[i].href.indexOf('loginLayer') != -1) {
                var action = "";
                if (list[i].href.substring((list[i].href.length - 1), list[i].href.length) != ";") {
                    action = ";";
                } else {
                    action = "javascript:";
                }
                if (list[i].href.indexOf('toggleLayer') != -1) {
                    action += "toggleShim('anchorImg','shim',-150,12);";
                } else if (list[i].href.indexOf('hideLayer') != -1) {
                    action += "hideShim('shim');";
                }
                list[i].href += action;
            }       
        }
    }

}
function findPosX(obj){
    var curleft=0;
    while (obj.offsetParent){
        curleft+=obj.offsetLeft;
        obj=obj.offsetParent;
    }
    curleft+=obj.offsetLeft;
    return curleft;
}

function findPosY(obj){
    var curtop = 0;
    while(obj.offsetParent){
        curtop += obj.offsetTop;
        obj=obj.offsetParent;
    }
    curtop+=obj.offsetTop;
    return curtop;
}


function toggleShim(objname,layer_n,left_o,top_o){
    var obj=getObject(objname);
    var newX=0;
    if(obj!=null)newX=findPosX(obj);
    var newY=0;
    if(obj!=null)newY=findPosY(obj);
    var new_left=newX+left_o;
    var new_top=newY+top_o;
    if(layer_n!=""){
        if(getObject(layer_n).style.visibility=="visible")hideShim(layer_n); 
        else showShim(layer_n,new_left,new_top); 
    }
}

function showShim(layer_n,left_o,top_o){
//  insertIFrame(layer_n);
    if(top_o==null)top_o=0;
    if(left_o==null)left_o=0;
    if(layer_n!=""){
        var p=getObject(layer_n);
        p.style.left=left_o+"px";
        p.style.top=top_o+"px";
        p.style.visibility="visible";
        p.style.display="";
    }
}

function hideShim(hs_layer){
//  if(_sns_showByDef_!=1&&hs_layer!=""){
        if(hs_layer!=""){
            var p=getObject(hs_layer);
            p.style.visibility="hidden";
            p.style.display="none";
        }
//  }
}   

var i=1;

function divOn(id){
    if(document.getElementById(id) != null) {
        document.getElementById(id).style.display = 'inline';
    }
}

function divOff(id){
    if(document.getElementById(id) != null) {
        document.getElementById(id).style.display = 'none';
    }
}

function divHide(id){
    if(document.getElementById(id) != null) {
        document.getElementById(id).style.visibility = 'hidden';
    }
}

function divUnhide(id){
    if(document.getElementById(id) != null) {
        document.getElementById(id).style.visibility = 'visible';
    }
}

function saveTextField(searchBox){
    searchFieldText=searchBox.value;
    searchFieldText=searchFieldText.replace(/\+/g, " ");
    var oldVal = searchFieldText;
    
            if ($('rapportMiniFilterForm')!= null && $("rapportMiniFilterForm").k){
                oldVal=$("rapportMiniFilterForm").k.value;
            }
            else {      
                var searchStr = location.search.split('&');
                for(i=0; i<searchStr.length; i++)
                {
                    if(searchStr[i].indexOf("k=") != -1)
                    {
                        if((document.forms['rapport']) && document.forms['rapport'].searchField) {
                        oldVal = unescape(searchStr[i].replace(/\+/g, " ").substr(searchStr[i].indexOf("k=")+2));
                        }   
                    }   
                }                   
            }

    
    var newVal = searchFieldText;
    if(oldVal != newVal)
    {
        valueModified = true;
    }
}

function trim(str){ 
    return str.replace(/^\s*|\s*$/g,"");
}

function getElementByClassName(classname)
{
    for(i=0; i<document.all.length; i++)
    {
        if(document.all[i].className == classname)
        {
            return document.all[i];
        }
    }
}





function saveInput(obj){// ASSIGN THE INPUT VALUE TO THE VARIABLE INPUTTERM
    try{inputTerm = trim(obj.value);}
    catch(e){}
}
function setFocus(frmId){
eval('var sFormObj = document.'+ frmId);
sFormObj.k.focus();
}
function Validate(frmId){
eval('var sFormObj = document.'+ frmId);
var searchQuery = trim(sFormObj.k.value.toLowerCase());
    if(searchQuery=="") {
        return false;
    }
    doSrchBy(sFormObj);
    }
function submitSearch(frmId, e){
    var keycode;
    if(window.event){
        keycode = window.event.keyCode;
    }
    else if(e){
        keycode = e.which;
    }
    if(keycode == 13){
        Validate(frmId);
        return false;
    }
    return true;
}
function TabSelector(Obj){
    var ULObj = Obj.parentNode;
    var frmObj='';
    var selectedTab='';
    if(Obj.parentNode.id=='Ftr_channels'){frmObj = 'frm_footersearch';selectedTab = 'ftr_selectedTab';}
    else{frmObj='frm_search';selectedTab = 'selectedTab';}
    for(i=0;i<ULObj.childNodes.length;i++){
        if (ULObj.childNodes[i].tagName == 'LI')
        {
            ULObj.childNodes[i].className = 'tab_clr';
        }
        Obj.className = 'tab_sel';
    }
    if($(selectedTab)!='')$(selectedTab).value = Obj.id;
    if(frmObj!='')setFocus(frmObj);
    eval('frm = document.'+frmObj);
    for(i=0;i<=frm.childNodes.length;i++){
        if(frm.childNodes[i]!=null){
            if(frm.childNodes[i].tagName == 'SPAN'){
                if($(selectedTab).value!='Tab_1'){
                    frm.childNodes[i].style.display = 'none';
                    frm.k.className='NoshopSrch';
                }
                else{
                    frm.childNodes[i].style.display = 'block';
                    frm.k.className='search';
                }
            }
        }
    }
}

function srchSub(ref){
var frmObj='';
if(ref.parentNode.parentNode.parentNode.id=='Ftr_smore'){eval('frmObj = document.'+ 'frm_footersearch');}
else{eval('frmObj = document.'+ 'frm_search');}
  var queryval =frmObj.k.value.toLowerCase().makeSearchStr()
  queryval = queryval.replace( /\+/, " ");
  newurl = ref.href + queryval;
  window.location = newurl;
  return false;
}
/*More functionality*/
var agent = navigator.userAgent.toLowerCase();
var ff = (agent.indexOf('firefox') != -1);
var NS = (agent.indexOf('netscape') != -1);
var aol = (agent.indexOf('aol') != -1);
var isIE =  (agent.indexOf("msie") != -1);
var isIElessthan7 = document.all && !/MSIE 7.0/.test(navigator.userAgent);
function togMore(e,state,oLnk1){
if(oLnk1!='' || oLnk1!=null){var check = oLnk1.id;}
    var oDiv='';
    var oLnk='';
    if((check) && check=='smorea'){
        oDiv=$('smore');
        oLnk=$('smorea');
    }
    else if((check) && check=='Ftr_smorea'){
        oDiv=$('Ftr_smore');
        oLnk=$('Ftr_smorea');
    }
    if(state=='show'){
         posMore(e,oLnk,oDiv);
        oDiv.style.zIndex=99999999;
        oDiv.style.display='block';
        if(isIElessthan7){posmoreIfrm(e,oLnk,oDiv);}
    } else {
        if($('smore')){divOff('smore');divOff('hdrIfrm');}
        if($('Ftr_smore')){divOff('Ftr_smore'); divOff('ftrIfrm');}
    }
}
function posMore(e,oLnk,oDiv){
    if(oDiv.id=='Ftr_smore'){
        oDiv.style.left=(findPosX(oLnk)+15)+'px';
        if(isIE){oDiv.style.top=(findPosY(oLnk)+oLnk.offsetHeight)-240+'px';}
        else{oDiv.style.top=(findPosY(oLnk)+oLnk.offsetHeight)-260+'px';}
    }else{
        oDiv.style.left=(findPosX(oLnk)+15)+'px';
        oDiv.style.top=(findPosY(oLnk)+oLnk.offsetHeight)+2+'px';

    }
}
function getElemFromArray(arr,tagName){
 for (i=0;i<=arr.childNodes.length;i++ ){
    if(arr.childNodes[i]!=null){
        if(arr.childNodes[i].tagName == tagName){return arr.childNodes[i];}
    }
}
}
function posmoreIfrm(e,oLnk,oDiv){
    var hidenObj = getElemFromArray(oDiv.parentNode,'IFRAME');
    hidenObj.style.display = 'block';                       
    hidenObj.style.position = 'absolute';
    hidenObj.style.pixelTop = findPosY(oDiv);
    hidenObj.style.pixelLeft = findPosX(oDiv);
    hidenObj.style.pixelHeight = oDiv.offsetHeight-3;
    hidenObj.style.pixelWidth = oDiv.offsetWidth;
    hidenObj.style.zIndex = 99999999;
}
window.document.onclick=function(e) {
    if (!e) var e = window.event
    if($('smore') || $('Ftr_smore')){
    var oDiv=$('smore');    
    var ftr_oDiv=$('Ftr_smore');
    if(oDiv.style.display !='none' || ftr_oDiv.style.display !='none'){
        eventSrcID=(e.srcElement)?e.srcElement.id:e.target.id;
        eventSrc=(e.srcElement)?e.srcElement:e.target;
        if(eventSrc.tagName == "BODY" || eventSrc.tagName == "HTML") parentSrcID=" "; else parentSrcID=(eventSrc)?eventSrc.parentNode.parentNode.id:" ";
        if(oDiv && eventSrcID != "smorea" && eventSrcID != "smore" && parentSrcID != "smore") {oDiv.style.display='none';divOff('hdrIfrm');}
        if(ftr_oDiv && eventSrcID != "Ftr_smorea" && eventSrcID != "Ftr_smore" && parentSrcID != "Ftr_smore"){ftr_oDiv.style.display='none';divOff('ftrIfrm');}
    }
    }
}
function orsz(e){
    var oDiv=$('smore');    
    var oLnk=$('smorea');
    var Ftr_oDiv=$('Ftr_smore');    
    var Ftr_oLnk=$('Ftr_smorea');
    if(oDiv){posMore(e,oLnk,oDiv);if(isIElessthan7){posmoreIfrm(e,oLnk,oDiv);}}
    if(Ftr_oDiv){posMore(e,Ftr_oLnk,Ftr_oDiv);if(isIElessthan7){posmoreIfrm(e,Ftr_oLnk,Ftr_oDiv);}}
}
window.onresize=orsz;
/*Navigation FlyDown functionality*/
function NavHighlighter(obj,eve,ev,tabs,isImg,isDropDown)
{
    for(i=0;i<obj.childNodes.length;i++)
    {
        child = obj.childNodes[i]
        if(child.tagName == 'UL'){
            if(ev == 1){
                togMore('','hide','');
                child.style.borderColor = '#66CC99';
                child.style.borderStyle = 'solid';
                var topvar = '';
                var ff = (navigator.userAgent.toLowerCase().indexOf('firefox') != -1);
                 if(document.all && !/MSIE 7.0/.test(navigator.userAgent)){topvar=18;}
                 else if(/MSIE 7.0/.test(navigator.userAgent)){ topvar=17;}
                 else if(ff){
                    topvar=18;
                    child.style.top = parseInt(topvar)+"px";
                }
                child.style.display="block";
                child.style.pixelTop = findPosY(obj)+parseInt(topvar);
                child.style.pixelLeft =findPosX(obj)+1;
                child.style.zIndex = 800;
                child.style.borderWidth = '1px';
                if(document.all){
                        obj.parentNode.childNodes[0].style.position = 'absolute';
                        obj.parentNode.childNodes[0].style.pixelTop = findPosY(obj)+parseInt(topvar);
                        obj.parentNode.childNodes[0].style.pixelLeft = findPosX(obj)+1;
                        obj.parentNode.childNodes[0].style.pixelHeight = child.offsetHeight-6;
                        obj.parentNode.childNodes[0].style.pixelWidth = child.offsetWidth-6;
                        obj.parentNode.childNodes[0].style.zIndex = 800;
                        obj.parentNode.childNodes[0].style.display = 'block';
                }
            }
            else if(ev == 2)
            {
                    obj.parentNode.childNodes[0].style.display = 'none'; child.style.display="none";
                    return;
            }
        }


      else if(child.tagName == 'A')
        {
            if(ev == 1)
            {
                    if(isImg == true)
                    {
                    child.style.backgroundColor = "#66CC99";
                   child.style.color="#000000";
                     }
                    else
                    {
                        child.style.backgroundColor = "#66CC99";
                        child.style.color="#000000";
                    }
            }
            else if(ev == 2)
            {
                child.style.background = "none";
                if(isImg == true)
                {
                    child.style.color="#66CC99";
                }
                else
                {
                    child.style.color = "#818181"; 
                }
            }
        }
		
    }

}
/*Article Archive Functionality*/
function showhide(obj){
    var par = obj.parentNode;
    for(i=0;i<par.childNodes.length;i++){
         if(par.childNodes[i].tagName == 'LI'){
             var childOfLi = par.childNodes[i].childNodes;
            for(j=0;j<=childOfLi.length;j++){
                if(childOfLi[j]!=null){
                    if(childOfLi[j].className=='drawerContent'||childOfLi[j].className=='drawerContent feed'){childOfLi[j].style.display='none';}
                }
            }
         }
    }
     for(i=0;i<obj.childNodes.length;i++){
            child = obj.childNodes[i];
            if(child.className=='drawerContent'||child.className=='drawerContent feed'){child.style.display='block';}
     }
}
function contentDisplay(TabId,TotalTab){
    var seltab = TabId.substring(8,9);
    for(var i=1;i<=TotalTab;i++){
     divOff("cont_"+i);
     $('feedtab_'+i).className='inActivTab';
    }
    divOn("cont_"+seltab);
    $(TabId).className='ActivTab';
}
function showfirst(obj){
var objs = $(obj).childNodes;
var isFirstArticle = true;
    for(j=0;j<=objs.length;j++ )
    {
        if((objs[j]) && (objs[j].tagName == 'LI')){
            if(isFirstArticle){
            var childOfLi = objs[j].childNodes;
            for(i=0;i<=childOfLi.length;i++){
                if(childOfLi[i]){
                    if(childOfLi[i].className == 'drawerContent' || childOfLi[i].className == 'drawerContent feed'){
                        childOfLi[i].style.display = 'block';
                    }
                }
            }}isFirstArticle=false;
        }
    }   
}
function selectCat(catId,frmId){
    eval('var sFormObj = document.'+ frmId);
    selObj = sFormObj.catDrpDwn.options;
    for (i = 0; i <=selObj.length; i++) {
        if(selObj[i].value == catId){
            selObj[i].selected = true;
        }
    }
}

var fadeIn;
var fadeOut;
var anim;

function ecSub(subId, attributes, cName){
    //anim = new YAHOO.util.Anim(subId, attributes, 1.5, YAHOO.util.Easing.backOut);
    anim = new YAHOO.util.Anim(subId, attributes, 0.5);
    if(!anim.isAnimated()){
        anim.animate();
        YAHOO.util.Dom.get(subId).parentNode.className = cName;
    }
}
function toggleSub(subId){
    subObj = YAHOO.util.Dom.get(subId);
	if(!subObj) return false;
    var subOl = document.createElement("ol");
    subOl.id = subId + 1;
    subOl.innerHTML = subObj.innerHTML;
    subObj.parentNode.appendChild(subOl);               
    var subHeight = (YAHOO.util.Dom.get(subId + 1).clientHeight);               
    subObj.parentNode.removeChild(subOl);
    fadeIn = {height: {from:5, to:subHeight}};  
    fadeOut = {height: {from:subHeight, to:0}};

    if(subObj.parentNode.className == "" || subObj.parentNode.className == "mOut")  
        ecSub(subId, fadeIn, "mOver");
    else
        ecSub(subId, fadeOut, "mOut");
}

function menu(obj,eve,ev)
{
    var tabs = obj.id;
    var isDropDown = false;
    var isImg = false;
    switch (tabs){
        case 'deptList' :
            NavHighlighter(obj,eve,ev);
        break;
        case 'progList' :
                 for(i=0;i<obj.childNodes.length;i++){
                    child = obj.childNodes[i]
                    if(child.tagName == 'UL'){
                        isDropDown = true;
                    }
                    if(child.tagName == 'A'){
                        for(j=0;j<child.childNodes.length;j++){
                            grandchild = child.childNodes[j];
                            if(grandchild.tagName == 'IMG'){
                                isImg = true;
                            }
                        }
                    }
                 }
                 NavHighlighter(obj,eve,ev,tabs,isImg,isDropDown);
        break;
    }
}   

function trim(str){
   return str.replace(/^\s*|\s*$/g,"");
}

function $(objId)
{
    return document.getElementById(objId)
}

function Refresh(strURL) 
{
	window.location=strURL;
	return false;
}