// JavaScript Document
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function P7_Snap() { //v2.63 by PVII
 var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=P7_Snap.arguments;a=parseInt(a);
 if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
 if((g=MM_findObj(args[k]))!=null){if((el=MM_findObj(args[k+1]))!=null){
 a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
 da="document.all['"+args[k]+"']";if(document.getElementById){
 d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
 d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
 }else if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){
 p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
 }else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
 if(tw==0||(navigator.appVersion.indexOf("MSIE 4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){
  ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}else{
  w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
  x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clientY;}}
 }else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var s=0;s<q0.length;s++){
  dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');y+=eval(dd+'.top');
  break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
 if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
  xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
 e.left=xx+pa;e.top=yy+pa;}}}
}
/**
function HideAll(){
MM_showHideLayers('HideAll','','hide','SubMenu1','','hide','SubMenu2','','hide','SubMenu3','','hide','SubMenu4','','hide','SubMenu5','','hide','SubMenu6','','hide','SubMenu7','','hide','SubMenu8','','hide','SubMenu9','','hide','SubMenu10','','hide')
}
*/
var SubMenuNumber=10;
var SubMenuArray=new Array ();
var SubVerticalMenuArray=new Array ();

function FillArray(counter) {

for (j=1 ; j<=counter;j++)
	{
		SubMenuArray[j]='SubMenu'+j;
	}
}

function FillVerticalArray(counter) {

for (j=1 ; j<=counter;j++)
	{
		SubVerticalMenuArray[j]='SubMenu'+j;
	}
}

//FillArray();
function HideAll(){
	MM_showHideLayers('HideAll','','hide');	
	//MM_showHideLayers('SubMenu0','','hide');
	HideAll3();
}
function HideAll2(SubMenuNumber){
	for (j=1 ; j<=SubMenuNumber;j++)
	{
		MM_showHideLayers('SubMenu'+j,'','hide')
	}
}
function HideAll3(){

	for (j=1 ; j<SubMenuArray.length - 1;j++)
	{
		MM_showHideLayers(SubMenuArray[j],'','hide')
	}
	for (i=1 ; i<SubVerticalMenuArray.length - 1;i++)
	{
		MM_showHideLayers(SubVerticalMenuArray[i],'','hide')
	}
}
/**/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

var className = "";
var classID = "";
function changeclass(LienId,LienName){
	var Sub = document.getElementById (LienId);
		if(Sub.className == LienName){
			Sub.className= LienName+"on";
			if (classID != "") changeclass(LienId,LienName);
			classID = LienId;
			className = LienName;
		}
		else
		{
			Sub.className= LienName;
			classID = "";
			className = LienName;
		}
	}
var CurrentNews = 1;
function NextNews()
{
//var MaxNews =document.getElementByName('ttt').value // 6;
    var MaxNews=document.getElementById("Text1").value;
	if(document.getElementById('news'+(CurrentNews+1)))
	{
		for (i=1; i<=MaxNews; i++){
		if(document.getElementById('news'+i) != null )
		{
		document.getElementById('news'+i).style.display = "none";
		}
			
		}			
		document.getElementById('news'+(CurrentNews+1)).style.display = "";
	}
	CurrentNews++;
	if (CurrentNews == MaxNews)
		CurrentNews = 0;
}
function RunDIV()
{
     
	setInterval('NextNews()', 2000);
}
function validApplication(){	
if (document.Form1.cardlimit.value == "")
	{
		alert("Please enter a value for the selected field.");
		document.Form1.cardlimit.focus();
		return;
	}
	else 
	if (document.Form1.title.value == "")
		{
			alert("Please enter a value for the selected field.");
			document.Form1.title.focus();
			return;
		}
		else 
		if (document.Form1.fistname.value == "")
			{
				alert("Please enter a value for the selected field.");
				document.Form1.fistname.focus();
				return;
			}
		else 
		if (document.Form1.middlename.value == "")
			{
				alert("Please enter a value for the selected field.");
				document.Form1.middlename.focus();
				return;
			}
		else 
		if (document.Form1.familyname.value == "")
			{
				alert("Please enter a value for the selected field.");
				document.Form1.familyname.focus();
				return;
			}
		else
			document.Form1.submit();
	

}
var PanelSlideOut1 = "";
function revelerCacherSousNav1(LienId){
var Sub = document.getElementById (LienId+"_sub");
	if(Sub.style.display == "none"){
		document.getElementById (LienId).style.color="#0b8d0b";
		Sub.style.display = "";
		if (PanelSlideOut1 != "") revelerCacherSousNav1(PanelSlideOut1);
		PanelSlideOut1 = LienId;
	}
	else
	{
		document.getElementById (LienId).style.color="";
		/*document.getElementById (LienId).className='productTitle';
		document.getElementById (plus).className='plus';*/
		Sub.style.display = "none";
		PanelSlideOut1 = "";
	}
}
/*calculators functions*/
function checkNum(input) {
	var oldnum;
	var newnum;
	var ch;
	oldnum = input.value;
	newnum ="";
	for(var i=0; i<oldnum.length; i++) {
		ch = oldnum.charAt(i);
		if(ch != ",") {
			newnum += ch;
		}
	}
	return parseFloat(newnum);
}
function checkNumPeriods(input,plus) {
	  input.value = checkNum(input);
        input.value = parseInt(input.value);
        if(input.value == null || input.value.length == 0 || input.value == "NaN") {
                input.value = "";
        }
        else {
                if(parseFloat(input.value) <= 0) {
                        input.value = "";
                }
        }
		if(plus==1)
        	calcMonthlyplus(input.form);
			else if(plus==2)
				calcMonthly2(input.form);
				else
					calcMonthly(input.form);
		input.value = put_commas(input.value);
}
function strip_commas(input) {
        var newnum;
        var ch;
        newnum ="";
        for(var i=0; i<input.length; i++) {
                ch = input.charAt(i);
                if(ch != ",") {
                        newnum += ch;
                }
        }
        return parseFloat(newnum);
}
function put_commas(input) {
    var result, len;
    input += "";
    len = input.indexOf(".");
    if(len == -1) {
        len = input.length;
        result = "";
    }
    else {
        result = input.substring(len, input.length);
    }
    while(len > 3) {
        result = input.substring(len-3, len) + result;
        result = "," + result;
        len -= 3;
    }
    result = input.substring(0, len) + result;
    return result;
}
function checkLoan(input,plus) {
	  input.value = checkNum(input);
        input.value = parseFloat(input.value);
        if(input.value == null || input.value.length == 0 || input.value == "NaN") {
                input.value = "";
        }
        else {
                if(parseFloat(input.value) < 0) {
                        input.value = "";
                }
        }
        if(plus==1)
        	calcMonthlyplus(input.form);
			else if(plus==2)
				calcMonthly2(input.form);
				else
					calcMonthly(input.form);
		input.value = put_commas(input.value);
}
function checkInterest(input,plus) {
        input.value = parseFloat(input.value);
        if(input.value == null || input.value.length == 0 || input.value == "NaN") {
                input.value = "";
			}
        else {
                if(parseFloat(input.value) <= 0 || parseFloat(input.value) > 100.0) {
                        input.value = "";
                }
        }
        if(plus==1)
        	calcMonthlyplus(input.form);
			else if(plus==2)
				calcMonthly2(input.form);
				else
					calcMonthly(input.form);
}
function calcMonthlyplus(input) {
        if(input.interest.value == "" || input.nper.value == "" || input.loan.value == "" ) {
                input.monthly.value = "";
        }
        else {
                i = strip_commas(input.interest.value) / 100;
                i = i / 12;
                n = strip_commas(input.nper.value) * 12;
                tmp = (1/i) * (1 - Math.pow(1/(1+i), n));
                tmp = strip_commas(input.loan.value) / tmp;
                tmp = Math.round(tmp*100) / 100;
				input.total.value = put_commas(Math.round(12 *(tmp * input.nper.value)))
				input.monthly.value = put_commas(Math.round(tmp));
                if(input.monthly.value == null || input.monthly.value.length == 0 || input.monthly.value == "NaN") {
                        input.monthly.value = "";
                }
        }
}
function calcMonthly(input) {
        if(input.interest.value == "" || input.nper.value == "" || input.loan.value == "" ) {
                input.monthly.value = "";
        }
        else {
                i = strip_commas(input.interest.value) / 100;
                i = i / 12;
                n = strip_commas(input.nper.value); //* 12
                tmp = (1 - Math.pow(1/(1+i), n));
                tmp = strip_commas(input.loan.value) * i/ tmp;
                tmp = Math.round(tmp*100) / 100;
				   input.total.value = put_commas(Math.round((tmp * input.nper.value)))
				   input.monthly.value = put_commas(Math.round(tmp));
         		  if(input.monthly.value == null || input.monthly.value.length == 0 ||  input.monthly.value == "NaN") {
                       input.monthly.value = "";
                }
        }
}
function calcMonthly2(input) {
        if(input.interest.value == "" || input.nper.value == "" || input.loan.value == "" ) {
                input.monthly.value = "";
        }
        else {
                i = strip_commas(input.interest.value) / 100;
                i = i / 12;
                n = strip_commas(input.nper.value) * 12;
                tmp = (1 - Math.pow(1/(1+i), n));
                tmp = strip_commas(input.loan.value) * i/ tmp;
                tmp = Math.round(tmp*100) / 100;
				   input.total.value = put_commas(Math.round(12 *(tmp * input.nper.value)))
				   input.monthly.value = put_commas(Math.round(tmp));
         		  if(input.monthly.value == null || input.monthly.value.length == 0 || input.monthly.value == "NaN") {
                       input.monthly.value = "";
                }
        }
}

function EmptyText(txtId)
{
 var txt = document.getElementById(txtId); 
 var str=txt.value;

	 if (str=="Search")
	 {
	 	txt.value="";
	 }
}

function FillText(txtId)
{
 var txt = document.getElementById(txtId); 
 var str=txt.value;

	 if (str=="")
	 {
	 	txt.value="Search";
	 }
}
function clickButton(e, buttonid,txtId)
{ 
               
     var bt = document.getElementById(buttonid); 
     if (typeof bt == 'object')
     { 
       if(navigator.appName.indexOf("Netscape")>(-1))
       { 
         if (e.keyCode == 13)
         { 
			e.returnValue=false;
			e.cancel = true;
            bt.click(); 
         } 
       } 
       if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
       {
         if (event.keyCode == 13)
         {
			e.returnValue=false;
			e.cancel = true;
            bt.click(); 
         } 
       } 
    }
}
function ifEmpty(txtBox){
	 var str=txtBox.value;
	 alert(x);
	 var x=trim(str);
	 if (x=="Search")
	 {
	 	txtBox.value="";
	 }
 }
 function ifsearch(txtBox){
	 var str=txtBox.value;
	 var x=trim(str);
	 if (x=="Searchhere")
	 {
	 	txtBox.value="";
	 }
 }
function IfEnter(txtBox, e)
{
    var str=txtBox.value;
	var x=trim(str);
	if (event.keyCode==13) 
	{
		if ((x.length < 3)||(x =='Searchhere'))
  			{
			alert("Please enter at least 3 characters for the site search field.");
			txtBox.focus();
			txtBox.select();
			event.keyCode=12
			return;
   
			}
	}
}

function openindex(t){ 
      
    
window.open (t, 'newwindow', config='height=600,width=900, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, directories=no, status=no')
}

function OpenNewWinddow(url){ 
      
    
window.open (url);
}

var PanelSlideOut = "";
var imgSlideOut = "";
function collapsedivs(LienId,img){
	var Sub = document.getElementById (LienId+"_sub");
		if(Sub.style.display == "none"){
			document.getElementById (LienId).className= "itemcollapseon";
			document.getElementById (img).className= "imgcollapseon";
			Sub.style.display = "";
			if (PanelSlideOut != "") collapsedivs(PanelSlideOut,imgSlideOut);
			PanelSlideOut = LienId;
			imgSlideOut = img;
		}
		else
		{
			document.getElementById (LienId).className= "itemcollapse";
			document.getElementById (img).className= "imgcollapse";
			Sub.style.display = "none";
			PanelSlideOut = "";
			imgSlideOut = "";
		}
	}


function toggleLayer(nID,imgID,pathLanguage) {


	var pLayer;

	pLayer = document.getElementById(nID);
	
	if (pLayer.style.display != "none") {
		document.getElementById(imgID).src="include/en-us/Arrow-closed.jpg";
		pLayer.style.display = "none";
	} else {
		document.getElementById(imgID).src="include/en-us/Arrow-open.jpg";
		pLayer.style.display = "block";
	}

}
function OpenEmail(URL){
    if (URL=='' || URL==null){
        OpenWnd('/emailPageURL.aspx?URL='+window.location.href, 'Email', 665,495, 'no');
    }
    else{
        OpenWnd('/Pages/Forward.aspx?URL='+URL, 'Email', 665,495, 'no');
     }
}

function OpenWnd(mypage, myname, w, h, scroll)
{
      var winl = (screen.width - w) / 2;
      var wint = (screen.height - h) / 2;
      winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=No'
      win = window.open(mypage, myname, winprops)
      if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}

function addFav()
{
    
    if (window.sidebar) 
         { // Mozilla Firefox Bookmark
		    window.sidebar.addPanel(document.title, window.location,"");
	     } 
	else if( window.external ) 
	     { // IE Favorite
		    window.external.AddFavorite(window.location, document.title);
		 }
		 
} 

function setFontSizeUp(objWanted){
        
		document.getElementById(objWanted).className='FontSize16';
		
		}
function setFontSizeDown(objWanted){
			document.getElementById(objWanted).className='FontSize11';
		}
	
function CallPrint(strid)
      {
        var dteNow = new Date();
        var intYear = dteNow.getFullYear();
        var prtContent = document.getElementById(strid);
        var WinPrint = window.open('','','left=100,top=50,width=900,height=600,toolbar=0,scrollbars=1,status=0,resizeable=1');
        WinPrint.document.write("<link href='/Style%20Library/Includes/en-US/styles.css' rel='stylesheet' type='text/css' />"); 
        WinPrint.document.write("<table width='100%'><tr><td width='50%'><img src='/Style%20Library/Includes/CommonImages/welcome_logo.gif' border=0 /> </td>");
        WinPrint.document.write("<td><a href='Javascript:window.print(); window.close();'><img title='Print' alt='Print' src='/Style%20Library/Includes/CommonImages/print.jpg' style='border:0px;'/></td></tr>");
        WinPrint.document.write("<tr><td class='ArticleText'>");
        WinPrint.document.write(prtContent.innerHTML);
        WinPrint.document.write("</td></tr></table>");
        WinPrint.document.close();
      }
