function CollapseExpand(n,activeNode) 
{
    if (document.getElementById(activeNode).style.display == "block" )
    {
    document.getElementById(activeNode).style.display="none";
    } else 
    {
    document.getElementById(activeNode).style.display="block";
    }
} 

function faq_CollapseExpand(activeNode) 
{ 

    if (document.getElementById(activeNode).style.display == "block" )
    {
        document.getElementById(activeNode).style.display="none";
    } 
    else 
    {
        document.getElementById(activeNode).style.display="block";
    }
} 

function ClearZip(obj)
{
   document.getElementById(obj).value="";
}

function CheckZip(obj)
{
    if (document.getElementById(obj).value=="")
    {
       document.getElementById(obj).value ="Zip Code";
    }
}

function CheckCity(obj)
{
    if (document.getElementById(obj).value=="")
    {
        document.getElementById(obj).value ="City";
    }
}

function CheckEamil(obj)
{
    if (document.getElementById(obj).value=="")
    {
        document.getElementById(obj).value ="Email Address";
    }
}
function storeLocator(obj)
{
  var str=document.getElementById(obj).value;
  if (str == "Zip Code")
    str = "";
window.location = "http://locator5001.info/results.aspx?postalcode=" + str;
}

function swappingImage(imgObj,imgpath)
{       
    imgObj.src="images/"+imgpath;       
}
function swapImage(imgObj,imgpath)
{
    var img=document.getElementById(imgObj);    
    img.src="images/"+imgpath;
}

function StateCity_Locator(citObj,stateObj)
{

  var str1= document.getElementById(citObj).value;
  var str2= document.getElementById(stateObj)   
  str2 = str2.options[str2.selectedIndex].value; 
  if (str1 == "City")
  {
    str1 ="";
  }
  if (str1 != "")
  {
    str1= str1.replace(" ","+");
  }
  window.location = "http://locator5001.info/results.aspx?city=" + str1 + "&state=" + str2 + "&Search_Param=LU";
}

function Get_Email()
{
    var is_q = document.URL.indexOf('?email=');
    if (is_q != -1)
    { 
    
    document.getElementById('txtEmail_Address').value=document.URL.substring(is_q+7, document.URL.length);
    }
     document.getElementById('txtEmail_Address').focus();     
}

function Update_Email(obj)
{
  var str=document.getElementById(obj).value;  
  if (str=="Email Address")
  {
  str="";  
  }
  window.location= "rm_form.aspx?email="+str;
}


function fireStoreLocator(obj,$mozChar) {    
    if($mozChar != null)
     { // Look for a Mozilla-compatible browser
        if( $mozChar == 13 )
        {
          storeLocator(obj);                
        }
      }
      else
      { // Must be an IE-compatible Browser
           if($char==13)
           {
                storeLocator(obj);                  
           }
      }

}
function fireStateCity_Locator(citObj,stateObj,$mozChar)
{
    if($mozChar != null)
     { // Look for a Mozilla-compatible browser
        if( $mozChar == 13 )
        {
          StateCity_Locator(citObj,stateObj);           
        }
      }
      else
      { // Must be an IE-compatible Browser
           if($char==13)
           {
                StateCity_Locator(citObj,stateObj);
           }
      }
}
function fireUpdate_Email(obj,$mozChar)
{
    if($mozChar != null)
     { // Look for a Mozilla-compatible browser
        if( $mozChar == 13 )
        {
          Update_Email(obj);                     
        }
      }
      else
      { // Must be an IE-compatible Browser
           if($char==13)
           {
                Update_Email(obj); 
           }
      }
}



function populatedropdown(dayfield, monthfield, yearfield){
var monthtext=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];


var today=new Date()
var curr_year = today.getFullYear();
var dayfield=document.getElementById(dayfield)
var monthfield=document.getElementById(monthfield)
var yearfield=document.getElementById(yearfield)
for (var i=0; i<31; i++)
dayfield.options[i]=new Option(i+1, i+1)
//dayfield.options[today.getDate()]=new Option(today.getDate(), today.getDate(), true, true) //select today's day
for (var m=0; m<12; m++)
monthfield.options[m]=new Option(monthtext[m], monthtext[m])
//monthfield.options[today.getMonth()]=new Option(monthtext[today.getMonth()], monthtext[today.getMonth()], true, true) //select today's month
var thisyear=today.getFullYear()

Index_var = 0;
for (var thisyear = 1950; thisyear<=curr_year; thisyear++){
yearfield.options[Index_var]=new Option(thisyear, thisyear)
Index_var+=1
}
}
function check_Query()
{
var obj,mailObj;
    var str2= document.getElementById('cmb_query')   
  str2 = str2.options[str2.selectedIndex].value; 
  obj= document.getElementById('cc_issues')  
  obj.style.display='none';
  obj= document.getElementById('gc_issues')  
  obj.style.display='none';
  obj= document.getElementById('gc_purchase')  
  obj.style.display='none';
  obj= document.getElementById('ret_card')  
  obj.style.display='none';
  obj= document.getElementById('refund')  
  obj.style.display='none';
  obj= document.getElementById('lstore_issues')  
  obj.style.display='none';
  mailObj= document.getElementById('mailCont')  
  mailObj.style.display='none';
  obj= document.getElementById('rfv_txt_Name')  
  obj.style.display='none';  
  obj= document.getElementById('rfv_txt_Email')  
  obj.style.display='none';  
  obj= document.getElementById('rfv_txt_Address')  
  obj.style.display='none';  
  obj= document.getElementById('rfv_Email')  
  obj.style.display='none';
  obj= document.getElementById('txt_CardNumber')  
  obj.value=''; 
  obj= document.getElementById('txt_Name')  
  obj.value=''; 
  obj= document.getElementById('txt_Email')  
  obj.value=''; 
  obj= document.getElementById('txt_Address')  
  obj.value=''; 
  
  //alert(str2);
  switch (str2)
  {
    case "cc_issues":
            obj= document.getElementById('cc_issues')  
            obj.style.display='block';
            break;
     case "gc_issues":
            obj= document.getElementById('gc_issues')  
            obj.style.display='block';
            mailObj.style.display='block';
            break;
      case "gc_purchase":
            obj= document.getElementById('gc_purchase')  
            obj.style.display='block';
            break;
       case "ret_card":
            obj= document.getElementById('ret_card')  
            obj.style.display='block';
            mailObj.style.display='block';
            break;
        case "refund":
            obj= document.getElementById('refund')  
            obj.style.display='block';
            mailObj.style.display='block';
        break;
        case "lstore_issues":
            obj= document.getElementById('lstore_issues')  
            obj.style.display='block';
            mailObj.style.display='block';
        break;
            
  }
}

function Check(obj)
{
  if (document.getElementById(obj).checked)
  {
    obj.style.display='none';
    event.returnValue = true;
  }
  else
  {
    var obj= document.getElementById('lbl_Message');
    obj.style.display='block';
    event.returnValue = false;
  }
 
}

function clickButton($char, $mozChar)
     {
       if($mozChar != null)
       { // Look for a Mozilla-compatible browser
        if( $mozChar == 13 )
        {
           alert("Moz");
           return false;
        }
      }
      else
      { // Must be an IE-compatible Browser
       if($char==13)
       {
            alert("Other");
            return false;
       }
      }
 
    }
    
    function enableButton(BtnObj,ageObj, ppObj)
    {        
        var x = document.getElementById(BtnObj);
        var y = document.getElementById(ageObj);
        var z = document.getElementById(ppObj);
        if (y.checked && z.checked )
        {            
            x.disabled = false;
            x.src = "Images/submit.png";
            x.style.cursor ="pointer";

        }
        else
        {         
            x.disabled = true;
            x.src = "Images/submit_off.png"; 
            x.style.cursor ="default";           
        }
    }

    function enableButtonUnsubscribe(BtnObj)
    {        
        var x = document.getElementById(BtnObj);
        var y = document.getElementById(ageObj);
        var z = document.getElementById(ppObj);
                     
            x.disabled = true;
            x.src = "Images/submit_off.png";
            x.style.cursor ="default";

    }
    var rotateInterval = 0;
    function theRotator() {

        if (jQuery.browser.msie && jQuery.browser.version != "9.0") {
            //Hide all images
            //$('div.rotator ul li').hide(); // because .hide doesn't work on ie 8 for some reason
            $('div.rotator ul li').attr("style", "display: none;");

            //Get the first image and display it
            $('div.rotator ul li:first').removeAttr("style").addClass('show');
        }
        else {
            //Set the opacity of all images to 0
            $('div.rotator ul li').css({ opacity: 0.0 });

            //Get the first image and display it (gets set to full opacity)
            $('div.rotator ul li:first').css({ opacity: 1.0 });
        }

        //Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
        rotateInterval = setInterval('rotate()', 3000);
    }

    function rotate() {
        //Get the first image
        var current = ($('div.rotator ul li.show') ? $('div.rotator ul li.show') : $('div.rotator ul li:first'));

        if (current.length == 0) current = $('div.rotator ul li:first');

        //Get next image, when it reaches the end, rotate it back to the first image
        var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div.rotator ul li:first') : current.next()) : $('div.rotator ul li:first'));

        //Un-comment the 3 lines below to get the images in random order

        //var sibs = current.siblings();
        //var rndNum = Math.floor(Math.random() * sibs.length );
        //var next = $( sibs[ rndNum ] );

        //Set the fade in effect for the next image, the show class has higher z-index
        if (jQuery.browser.msie && jQuery.browser.version != "9.0") {
            //Hide the current image
            //current.hide().removeClass('show');
            current.attr("style", "display: none;").removeClass('show');

            next.removeAttr("style").addClass('show');
        }
        else {
            next.css({ opacity: 0.0 })
	        .addClass('show')
	        .animate({ opacity: 1.0 }, 1000);

            //Hide the current image
            current.animate({ opacity: 0.0 }, 1000)
	        .removeClass('show');
        }
    };
