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://locator5000.info/results.aspx?search_param=n10&postalcode=" + str;
}

function swapImage(imgObj,imgpath)
{
    var img=document.getElementById(imgObj);
    img.src="images/"+imgpath;
}
function swappingImage(imgObj,imgpath)
{       
    imgObj.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://locator5000.info/results.aspx?city=" + str1 + "&state=" + str2 + "&Search_Param=n10";
}

function Get_Email()
{
var str="";
    var is_q = document.URL.indexOf('?email=');
    if (is_q != -1)
    { 
    
    str=unescapeTxt(document.URL.substring(is_q+7, document.URL.length));
     str= str.replace("+"," ");
    document.getElementById('txtEmail_Address').value = str;
    
    }
    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 )
        {
           
           return false;
        }
      }
      else
      { // Must be an IE-compatible Browser
       if($char==13)
       {
            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 )
        if (z.checked)
        {            
            x.disabled = false;
            x.src = "Images/submit.jpg";
            x.style.cursor ="pointer";

        }
        else
        {         
            x.disabled = true;
            x.src = "Images/submit_off.jpg"; 
            x.style.cursor ="default";           
        }       
    }
    
    var encN=1;

// DECODES AND UNESCAPES ALL TEXT.
function decodeTxt(s){
var s1=unescape(s.substr(0,s.length-1));
var t='';
for(i=0;i<s1.length;i++)t+=String.fromCharCode(s1.charCodeAt(i)-s.substr(s.length-1,1));
return unescape(t);
}

// ENCODES, IN UNICODE FORMAT, ALL TEXT AND THEN ESCAPES THE OUTPUT
function encodeTxt(s){
s=escape(s);
var ta=new Array();
for(i=0;i<s.length;i++)ta[i]=s.charCodeAt(i)+encN;
return ""+escape(eval("String.fromCharCode("+ta+")"))+encN;
}


// CONVERTS *ALL* CHARACTERS INTO ESCAPED VERSIONS.
function escapeTxt(os){
var ns='';
var t;
var chr='';
var cc='';
var tn='';
for(i=0;i<256;i++){
tn=i.toString(16);
if(tn.length<2)tn="0"+tn;
cc+=tn;
chr+=unescape('%'+tn);
}
cc=cc.toUpperCase();
os.replace(String.fromCharCode(13)+'',"%13");
for(q=0;q<os.length;q++){
t=os.substr(q,1);
for(i=0;i<chr.length;i++){
if(t==chr.substr(i,1)){
t=t.replace(chr.substr(i,1),"%"+cc.substr(i*2,2));
i=chr.length;
}}
ns+=t;
}
return ns;
}


// SIMPLY UNESCAPES TEXT (ONLY INCLUDED TO MAKE A COMPLEMENTARY FUNCTION FOR escapeTxt()
function unescapeTxt(s){
return unescape(s);
}
