//&& document.createTextNode

if( document.getElementById )
 getElemById = function( id ) {
 return document.getElementById( id );
 }

 else if( document.all )
 getElemById = function( id ) {
 return document.all[ id ];
 }

 else if( document.layers )
 getElemById = function( id ) {
 return document.layers[ id ];
 }
	
	
	function show_hide(divID){
	var divArea = document.getElementById(divID)
	var divAreaVisible = divArea.className != "show"
	var plusIcon = document.getElementById('plus_icon')
	
	if(divAreaVisible){
	divArea.className = "show"
	plusIcon.innerHTML = "<p class='fs14 minusMar4 marTop pad1 padLeft'>-</p>"
	}else{
	divArea.className = "hide"
	plusIcon.innerHTML = "+"
	}
	}


function GoToHlinks(goHere)
{
	winx=window.open(goHere,'','width=800,height=600,toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes');
	winx.focus();
	winx.blur();
}

function redirectOnCreditCardSelection(rbtnlist)
{
    var radiolist = document.getElementsByName(rbtnlist);
    for (var j = 0; j < radiolist.length; j++)
    {
        if (radiolist[j].checked)
        {
            PageManager.Navigate(radiolist[j].value);
        }
    }       
}

function TabbingMarquee(parent, sender, args)
    {
       switch(args.type) 
       {
            case "click":
              var tips = new Array();
               var divs = parent.getElementsByTagName("div");
               for(var i = 0; i < divs.length; i++)
               {
                    if(divs[i].className ==  "tabContentDiv" || divs[i].className ==  "tabContentDiv selected")
                    {
                        tips.push(divs[i]);
                    }
               }  
                
                if(sender.name == "next")
                {
                     for(var i = 0; i < tips.length; i++)
                       {
                            if(tips[i].className ==  "tabContentDiv selected")
                            {
                                 tips[i].className = "tabContentDiv"; 
                                 if(i == (tips.length - 1))
                                 { 
                                    tips[0].className = "tabContentDiv selected";
                                    break;
                                 }
                                 else
                                 {
                                    tips[i+1].className = "tabContentDiv selected";
                                    break;
                                 }
                            }
                       }  
                }
               else if(sender.name == "prev")
               {
                     for(var i = 0; i < tips.length; i++)
                       {
                            if(tips[i].className ==  "tabContentDiv selected")
                            {
                                tips[i].className = "tabContentDiv"; 
                                if(i > 0)
                                { 
                                    tips[i - 1].className = "tabContentDiv selected";
                                    break;
                                 }
                                 else
                                 {
                                    tips[tips.length - 1].className = "tabContentDiv selected";
                                    break;
                                 }
                            }
                       }                 
               }  
            break;
            
            case "load":
             break;
            
            case "change":
            break; 
           
            case "blur":
            case "focus":
            break; 
           } 
      
       }

function SetccPID() 
{  
    var ccWebPID = document.getElementById("webPID").value;
    var ccWebVAL = document.getElementById("web").value;
    if(!(ccWebPID == "" || ccWebPID == null))
    {
        ccPID = ccWebPID;     
    }
    else
    {
        ccPID = "100";    
    }
    ccWEB = ccWebVAL; 
}

var GetCcAc =
{
    RequestString:"/GetCcAc.ajx",
    Manage:function(Id,Sender,event,target,args)
    {
    	var siteCC = PageManager.PageMetaData.Item('Site');
    	if(!(siteCC == "" || siteCC == null))
    	{
        	document.getElementById("web").value = siteCC;
    	}
    	else
    	{
       		document.getElementById("web").value = "br3";
    	}
	    
       var struct = new Object();
       struct.target = target;
       sender = document.getElementById("web");
       var JSON = new Hash();
       JSON.set("web",sender.value);
       AjaxManager.Send(struct,this.RequestString,JSON.toJSON(),this.CallBack)
    },
    CallBack:function(struct,result)
    {   
        if(result.Status == "SUCCESS")
        {
            document.getElementById("webPID").value  = result.Response.Buffer.AC;
        } 
        else 
        {
            ExceptionManager.HandleException("GetCcAc","CallBack","Status",result.responseText);
        }
    },
    Filter:function(Id,Module,Type){return true;},
    Exception:function(Id,Module,Type,Exception)
    {
        ExceptionManager.HandleException(Id,Module,Type,Exception);
        return;
    }
};
