// JavaScript Document
var s_field_val=new Array('most_popular','intro_apr','regular_apr','annual_fee');
var s_field_prval=new Array('Most Popular','Intro APR','Regular APR','Annual Fee');
var n_list_val=new Array(5,10,15,20,30,40,50);
var flag_preloader=0;
var compare_carts="";	
var nav_bar=1;
function sort_results(){
	sort_fields=document.getElementById("sort_field").value;
	n_listing=document.getElementById("n_listing").value;
	window.location=html_url+"?num_listings="+n_listing+"&sort_fields="+sort_fields;
}
function results_sort_results(page){
	sort_fields=document.getElementById("sort_field").value;
	n_listing=document.getElementById("n_listing").value;
	window.location=page+"&num_listings="+n_listing+"&sort_fields="+sort_fields;
}
function redirect(link){
window.location = link;
}

function set_redirect(link){
window.setTimeout('redirect(\''+link+'\')',10);
}

function New_Win(objpath,t_page,w,h)
{
window.open(objpath,"TerminHelp",'scrollbars=1, resizable=1, width=' +w+ ',height=' +h+ ',left=50,top=50');
}


function add_to_compeare(elem){
	if(elem.checked){
		numb_compare++;	
		compare_carts += elem.id+",";
		card_name_id=elem.id;
		card_name_id=card_name_id.replace("compare","h2");
		document.getElementById("list_compare_cards").innerHTML +=document.getElementById(card_name_id).innerHTML+"<br>";
		addRemoveButton(card_name_id);
		if(numb_compare==4){
			arr=document.getElementsByTagName("input");
			for(i=0;i<arr.length;i++){
				t=arr[i];
				if(t.type=="checkbox" && t.checked!=true)t.disabled=true;
			}
		}
		left_cards=4-numb_compare;
		if(left_cards==0)  left_cards='(full)';
		else left_cards='(you can add '+left_cards +' more cards)';
		if(numb_compare>0){
			document.getElementById("nav_bot_left").style.display="";
			document.getElementById("compare_box").style.display="";
			document.getElementById("compare_box_crads").style.display="";
		}else{
			document.getElementById("nav_bot_left").style.display="none";
			document.getElementById("compare_box").style.display="none";
			document.getElementById("compare_box_crads").style.display="none";
		}
		document.getElementById("num_compare_cards").innerHTML=left_cards;
	}else{
		card_name_id=elem.id;
		id_card=card_name_id.replace("compare_","");
		remove_card_by_id(id_card);
		}
		
	
}


function clear_check_boxes(){
arr=document.getElementsByTagName("input");
	for(i=0;i<arr.length;i++){
		t=arr[i];
		if(t.type=="checkbox" ){
			t.disabled=false;
			t.checked=false;
		}
	}
}


function clear_list_card(){
	arr=document.getElementsByTagName("input");
	for(i=0;i<arr.length;i++){
		t=arr[i];
		if(t.type=="checkbox" ){
			t.disabled=false;
			t.checked=false;
		}
	}
	document.getElementById("cards_remove").innerHTML='';
	document.getElementById("list_compare_cards").innerHTML='';
	document.getElementById("nav_bot_left").style.display="none";
	document.getElementById("compare_box").style.display="none";
	document.getElementById("compare_box_crads").style.display="none";
	compare_carts='';
	numb_compare=0;
	document.getElementById("list_card_tpl").style.display='';
	document.getElementById("comparison_wrap").style.display='none';
	document.getElementById("comparison_wrap").innerHTML='';
}


function addRemoveButton(card_id){
	var elem=document.createElement('img');
	elem.setAttribute('src',home_dir+'images/rem_card.gif');
	elem.setAttribute('align','top');
	elem.style.marginLeft='5px';
	elem.style.marginTop='2px';
	card_id=card_id.replace("h2","rc");
	elem.setAttribute('id',card_id);
	document.getElementById("cards_remove").appendChild(elem);
	addEvent(elem, "mouseover", ev_function1_1, false);
	addEvent(elem, "mouseout", ev_function2_2, false);
	addEvent(elem, "mousedown",remove_cards, false);
}


function remove_cards(e){
		if (!e) var e = window.event;
		try{
			var el=e.srcElement;
			idelem=el.id;
			d=idelem.split("_");
		}catch(err){
			idelem=this.id;
			d=idelem.split("_");
			el=document.getElementById(idelem);
		}
		
	remove_card_by_id(d[1]);
	e.cancelBubble = true;

	if (e.stopPropagation) e.stopPropagation();
}


function remove_card_by_id(id_card){
		var el=document.getElementById("rc_"+id_card);
		numb_compare--;
		elem_id="compare_"+id_card;
		tid=elem_id+",";
		compare_carts=compare_carts.replace(tid,"");
		document.getElementById(elem_id).checked=false;
		card_name_id=elem_id.replace("compare","h2");
		old_text=document.getElementById("list_compare_cards").innerHTML;
		old_text=old_text.replace(document.getElementById(card_name_id).innerHTML+"<br>","");
		old_text=old_text.replace(document.getElementById(card_name_id).innerHTML+"<BR>","");
		document.getElementById("list_compare_cards").innerHTML=old_text;
		if(numb_compare==3){
			arr=document.getElementsByTagName("input");
			for(i=0;i<arr.length;i++){
				t=arr[i];
				if(t.type=="checkbox" && t.checked!=true)t.disabled=false;
			}
		}
		
	test=document.getElementById('comparison_wrap');
	
	if(test.hasChildNodes()){
		//alert ("yes nodes");
		var test=document.getElementById("tr_0");
		var children = test.childNodes;
   		for (var i = 0; i < children.length; i++){
			cell=children[i].id;
			cell_arr=cell.split("_");
			//alert(cell_arr.length);
			if(cell_arr.length==4){
				if(cell_arr[3]==id_card){
					//alert(children[i]);
					delete_table_cell(cell_arr[2],cell_arr[3]);
				}
			}
		}
	}
	//alert(compare_carts);
		left_cards=4-numb_compare;
		if(left_cards==0)  left_cards='(full)';
		else left_cards='(you can add '+left_cards +' more cards)';
		document.getElementById("num_compare_cards").innerHTML=left_cards;
		try{
			el.removeNode(true);
		}catch(err){
			document.getElementById('cards_remove').removeChild(el);
		}
		if(numb_compare>0){
			//document.getElementById("compare_box").style.display="";
			//document.getElementById("compare_box_crads").style.display="";
		}else{
			document.getElementById("compare_box").style.display="none";
			document.getElementById("compare_box_crads").style.display="none";
		}
		if(numb_compare==0){
			document.getElementById("list_card_tpl").style.display='';
			document.getElementById("comparison_wrap").style.display='none';
			document.getElementById("comparison_wrap").innerHTML='';
			document.getElementById("nav_bot_left").style.display="none";
			document.getElementById("compare_box").style.display='none';
			nav_bar_display();
		}
}
function nav_bar_display(){
	if(nav_bar==1){
		document.getElementById("nav_top_left").style.display='';
		document.getElementById("nav_mid_left").style.display='';
		document.getElementById("nav_bot_left").style.display='';
	}
}
function nav_bar_hide(){
	if(nav_bar==1){
		document.getElementById("nav_top_left").style.display='none';
		document.getElementById("nav_mid_left").style.display='none';
		document.getElementById("nav_bot_left").style.display='none';
	}
}
function load_compare_cards(home_dir){
	document.getElementById("comparison_wrap").innerHTML='';
	document.getElementById("comparison_wrap").style.display='';
	document.getElementById("list_card_tpl").style.display='none';
	document.getElementById("nav_bot_left").style.display="none";
	document.getElementById("compare_box").style.display='none';
	document.getElementById("compare_box_crads").style.display='none';
	nav_bar_hide();
	flag_preloader=0;
	main_elem.style.zIndex=100;
	loadXMLContentRead(home_dir+"compare_carts.php?compare_carts="+compare_carts);
}

function close_compare(e){
	if (!e) var e = window.event;
	document.getElementById("list_card_tpl").style.display='';
	document.getElementById("comparison_wrap").style.display='none';
	document.getElementById("comparison_wrap").innerHTML='';
	document.getElementById("nav_bot_left").style.display="";
	document.getElementById("compare_box").style.display='';
	document.getElementById("compare_box_crads").style.display='';
	nav_bar_display();
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
}


function close_cell(e){
if (!e) var e = window.event;
	try{
		var el=e.srcElement;
		idelem=el.id;
		d=idelem.split("_");
	}catch(err){
		idelem=this.id;
		d=idelem.split("_");
	}
	el_for_del=d[2];
	
	remove_card_by_id(d[3]);
	
	//delete_table_cell(el_for_del,d[3]);
	
	e.cancelBubble = true;

	if (e.stopPropagation) e.stopPropagation();
}

function delete_table_cell(efd, eid){
		i=0;
		sep_efd=efd-1;
		var father=document.getElementById("tr_"+i);
		var el_for_del=document.getElementById("td_"+i+"_"+sep_efd);
		
		try{
			el_for_del.removeNode(true);
		}catch(err){
			father.removeChild(el_for_del);
		}
		var el_for_del=document.getElementById("td_"+i+"_"+efd+'_'+eid);
		
		try{
			el_for_del.removeNode(true);
		}catch(err){
			father.removeChild(el_for_del);
		}
	
	for(i=1;i<numb_table_row-1;i++){
		sep_efd=efd-1;
		var father=document.getElementById("tr_"+i);
		var el_for_del=document.getElementById("td_"+i+"_"+sep_efd);
		
		try{
			el_for_del.removeNode(true);
		}catch(err){
			father.removeChild(el_for_del);
		}
		
		var el_for_del=document.getElementById("td_"+i+"_"+efd);
		try{
			el_for_del.removeNode(true);
		}catch(err){
			father.removeChild(el_for_del);
		}
	}
	//th_width();
}

function th_width(){
	var test=document.getElementById("tr_0");
		var children = test.childNodes;
		t_w=parseInt(100/children.length)*2;
   		for (var i = 1; i < children.length; i=i+2){
			cell=children[i];
			ceel.style.width=t_w+'%';
		}
}


function add_elemnt(element,xmlelem){

	var elem=element;

	

	var attribute = xmlelem.getAttribute("id");

	if(attribute != '' && attribute != null)elem.setAttribute('id',attribute);

	var attribute = xmlelem.getAttribute("width");

	if(attribute != '' && attribute != null)elem.setAttribute('width',attribute);

	var attribute = xmlelem.getAttribute("colspan");

	if(attribute != '' && attribute != null)elem.setAttribute('colSpan',attribute);
	
	var attribute = xmlelem.getAttribute("align");

	if(attribute != '' && attribute != null)elem.style.textAlign=attribute;
	
	var attribute = xmlelem.getAttribute("marginLeft");

	if(attribute != '' && attribute != null)elem.style.marginLeft=attribute;
	var attribute = xmlelem.getAttribute("marginRight");

	if(attribute != '' && attribute != null)elem.style.marginRight=attribute;
	
	var attribute = xmlelem.getAttribute("cellpadding");
	
	if(attribute != '' && attribute != null)elem.setAttribute('cellPadding',attribute);
	
	var attribute = xmlelem.getAttribute("cellspacing");

	if(attribute != '' && attribute != null)elem.setAttribute('cellSpacing',attribute);

	var attribute = xmlelem.getAttribute("bg");

	if(attribute != '' && attribute != null)elem.style.background=attribute;

	var attribute = xmlelem.getAttribute("border");

	if(attribute != '' && attribute != null)elem.style.border=attribute;

	var attribute = xmlelem.getAttribute("color");

	if(attribute != '' && attribute != null)elem.style.color=attribute;

	var attribute = xmlelem.getAttribute("value");

	if(attribute != '' && attribute != null)elem.setAttribute('value',attribute);
	
	var attribute = xmlelem.getAttribute("src");

	if(attribute != '' && attribute != null)elem.setAttribute('src',attribute);
	
	var attribute = xmlelem.getAttribute("href");

	if(attribute != '' && attribute != null)elem.setAttribute('href',attribute);
	
	var attribute = xmlelem.getAttribute("class");

	if(attribute != '' && attribute != null){
		//elem.setAttribute((document.all ? 'className' : 'class'),attribute);
		elem.setAttribute('className',attribute);
		elem.setAttribute('class',attribute);
	}

	var attribute = xmlelem.getAttribute("js");

	if(attribute!='' && attribute!=null){

		arr_js=attribute.split("#");

		for(i=0;i<arr_js.length;i++){

			str_event=arr_js[i].split("=");

			the_event=str_event[0];

			the_function=str_event[1];

			addEvent(elem, the_event, eval(the_function), false);

		}

	}

	

}
function addEvent(obj, evType, fn, useCapture){

  if (obj.addEventListener){

    obj.addEventListener(evType, fn, useCapture);

    return true;

  } else if (obj.attachEvent){

    var r = obj.attachEvent("on"+evType, fn);

    return r;

  } else {

    alert("Handler could not be attached");

  }

}
var numb_table_row=0;

function clear_symbols(symbol){


symbol=symbol.replace(/\[and\]reg;/g,'\u00AE');
symbol=symbol.replace(/\[and\]trade;/g,'\u2122');
symbol=symbol.replace("[br]","<br>");
symbol=symbol.replace('[and]','&');

return symbol;
}

function loadXMLContentRead(url){
	document.getElementById('preloader').style.display="";
	document.getElementById('disclaimer').style.display='none';
	numb_table_row=0;
    if (window.XMLHttpRequest) {

        req = new XMLHttpRequest; 

        req.onreadystatechange = processReqRead;

        req.open("GET", url, true);

        req.send(null);

    } else if (window.ActiveXObject) {

        isIE = true;

        req = new ActiveXObject("Microsoft.XMLHTTP");

        if (req) {

			

            req.onreadystatechange = processReqRead;

            req.open("GET", url, true);

            req.send(null);

        }

    }

}

function processReqRead() {

	 if (req.readyState == 4) {

        if (req.status == 200) {

		 	if(req.responseText !="")

		 	{
				document.getElementById('preloader').style.display="none";
				//document.getElementById('preloader1').style.zIndex=-101;
				flag_preloader=1;
		 		msg=req.responseText;

		 		//alert(msg);

				if (typeof DOMParser == "undefined") {

   					DOMParser = function () {}

   					DOMParser.prototype.parseFromString = function (str, contentType) {

      				if (typeof ActiveXObject != "undefined") {

				         var d = new ActiveXObject("MSXML.DomDocument");

				         d.loadXML(str);

				         return d;

				      } else if (typeof XMLHttpRequest != "undefined") {

				         	var req = new XMLHttpRequest;

				        	req.open("GET", "data:" + (contentType || "application/xml") +

				        	";charset=windows-1251," + encodeURIComponent(str), false);

				        	if (req.overrideMimeType) {

				           		req.overrideMimeType(contentType);

				        	}

							req.send(null);

				        	return req.responseXML;

				      	}

   			  		}

				}

				var xmlobject = (new DOMParser()).parseFromString(msg, "text/xml");

				var root = xmlobject.getElementsByTagName('nmsg')[0];

				

				var items = root.getElementsByTagName("item");

				

				for (var i = 0 ; i < items.length ; i++) {

				

					var item = items[i];

					var type_elem = item.getAttribute("elem");

					switch(type_elem){

						case 'table' :

							var e_table=document.createElement('table');

							

							var e_body=document.createElement('tbody');

							e_table.appendChild(e_body); 

							e_table_item=item;

							

						break;

						case 'tr' :
							numb_table_row++;
							if(e_tr != null) {

								add_elemnt(e_tr,e_tr_item);

								

								try{

									e_body.appendChild(e_tr);

								}catch(err){

									main_elem.appendChild(e_tr);

								}

							

							}

							var e_tr=document.createElement('tr');

							e_tr_item=item; 

							

						break;

						case 'th' :

							var e_th=document.createElement('th');

							try	{
								t=item.firstChild.nodeValue;
								t=clear_symbols(t);
								var currenttext = document.createTextNode(t);
							}catch(err){
								var currenttext = document.createTextNode("");
							}
							e_th.appendChild(currenttext); 
							add_elemnt(e_th,item);
							container_elm=e_th;
							e_tr.appendChild(e_th); 

						break;

						case 'td' :

							var e_td=document.createElement('td');

							

							

							try

							{							

								t=item.firstChild.nodeValue
								//t=t.replace("[br]","<br>");
								//t=t.replace('[and]','&');
								//t=t.replace(/\[and\]reg;/g,'\u00AE');
								t=clear_symbols(t);
								var currenttext = document.createTextNode(t);

								//currenttext=currenttext.replace('[and]','&');

								e_td.appendChild(currenttext); 
								//currenttext.innerHTML=t;

							}catch(err)

							{

								var currenttext = document.createTextNode("");

								e_td.appendChild(currenttext); 

							}

							add_elemnt(e_td,item);
							container_elm=e_td;
							e_tr.appendChild(e_td); 

						break;
						case 'a' :
							var e_a=document.createElement('a');
							add_elemnt(e_a,item);
							container_elm.appendChild(e_a);
							container_elm=e_a; 
						break;
						case 'img' :
						var e_img=document.createElement('img');
							add_elemnt(e_img,item);
							container_elm.appendChild(e_img);
						break;
						case 'saldo' :

							document.getElementById('saldo').innerHTML=item.firstChild.nodeValue;

							

						break;

						case 'ch_pass_ans' :

							currenttext=item.firstChild.nodeValue;

							

							document.getElementById('ch_pass_ans').innerHTML=currenttext.replace("[br]","<br>");

							

						break;
				
						case 'input' :

							var e_input=document.createElement('input');

							add_elemnt(e_input,item);

							e_td.appendChild(e_input);

						break;

						case 'vars' :

							var currenttext=item.firstChild.nodeValue;

							var name_var=item.getAttribute("name");

							var type_var=item.getAttribute("type");

							if(type_var=="string") {

								eval(name_var+'='+'"'+currenttext+'";');

								currenttext=currenttext.replace('"',"'");

							}else eval(name_var+'='+currenttext+";");

							//alert(eval(name_var));

						break;

					}

				}

			

				try{

				      add_elemnt(e_tr,e_tr_item);
						
				       }catch(err){

				    

				     }

				try{

					e_body.appendChild(e_tr);

					e_table.appendChild(e_body);

					main_elem.appendChild(e_table);

					add_elemnt(e_table,e_table_item);

				}catch(err){

					try{
					
						//main_elem.appendChild(e_tr);
						if (main_elem.firstChild) {
						main_elem.insertBefore(e_tr, main_elem.firstChild);
						}else main_elem.appendChild(e_tr);
					}catch(err){}

				} 

				

		 	}

		 	flag_load_data=1;
			document.getElementById('disclaimer').style.display='';

		}

	}

}

function cursor_pointer(e) {

	if (!e) var e = window.event;

	try{

		this.style.cursor='default';

	}catch(err){

		var el=e.srcElement.parentNode;

		el.style.cursor='default';

	}

	e.cancelBubble = true;

	if (e.stopPropagation) e.stopPropagation();

}
function ev_function1(e) {
	if (!e) var e = window.event;
	try{
		this.style.cursor='pointer';
		//this.className='test_bckgr_hover';
		el_id=this.id;
	}catch(err){
		var el=e.srcElement;
		el.parentNode.style.cursor='pointer';
		//el.className='test_bckgr_hover';
		el_id=el.id;
	}
	//alert(el_id);
	el_img_id=el_id.replace("td","img");
	document.getElementById(el_img_id).src=home_dir+"images/unrem_card.gif";
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
}

function ev_function2(e) {
	if (!e) var e = window.event;
	try{
		this.style.cursor='default';
		//this.className='test_bckgr';
		el_id=this.id; 
	}catch(err){
		var el=e.srcElement;
		el.parentNode.style.cursor='default';
		//el.className='test_bckgr';
		el_id=el.id;
	}
	el_img_id=el_id.replace("td","img");
	document.getElementById(el_img_id).src=home_dir+"images/rem_card.gif";
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
}

function ev_function1_1(e) {
	if (!e) var e = window.event
	try{
		this.style.cursor='pointer';
		this.src=home_dir+'images/unrem_card.gif';
	}catch(err){
		var el=e.srcElement.parentNode;
		el.style.cursor='pointer';
		el.src=home_dir+'images/unrem_card.gif';
	}
	
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
}

function ev_function2_2(e) {
	if (!e) var e = window.event;
	try{
		this.style.cursor='default';
		this.src=home_dir+'images/rem_card.gif';
	}catch(err){
		var el=e.srcElement.parentNode;
		el.style.cursor='default';
		el.src=home_dir+'images/rem_card.gif';
	}
	
	e.cancelBubble = true;
	if (e.stopPropagation) e.stopPropagation();
}

var badEntities=new Array();
 // misc entities®
badEntities["ˆ"]=    "\u20AC";  //$NON-NLS-1$ //$NON-NLS-2$ // euro
badEntities["‘"]=   "\u2018";  //$NON-NLS-1$ //$NON-NLS-2$ // left single quotation mark
badEntities["’"]=   "\u2019";  //$NON-NLS-1$ //$NON-NLS-2$ // right single quotation mark
// Latin 1 entities
badEntities["&nbsp;"]=   "\u00A0"; //$NON-NLS-1$ //$NON-NLS-2$ // no-break space
badEntities["&iexcl;"]=  "\u00A1"; //$NON-NLS-1$ //$NON-NLS-2$ // inverted exclamation mark
badEntities["&cent;"]=   "\u00A2"; //$NON-NLS-1$ //$NON-NLS-2$ // cent sign
badEntities["&pound;"]=  "\u00A3"; //$NON-NLS-1$ //$NON-NLS-2$ // pound sign
badEntities["¤"]= "\u00A4"; //$NON-NLS-1$ //$NON-NLS-2$ // currency sign
badEntities["&yen;"]=    "\u00A5"; //$NON-NLS-1$ //$NON-NLS-2$ // yen sign
badEntities["¦"]= "\u00A6"; //$NON-NLS-1$ //$NON-NLS-2$ // broken vertical bar
badEntities["§"]=   "\u00A7"; //$NON-NLS-1$ //$NON-NLS-2$ // section sign
badEntities["&uml;"]=    "\u00A8"; //$NON-NLS-1$ //$NON-NLS-2$ // diaeresis
badEntities["©"]=   "\u00A9"; //$NON-NLS-1$ //$NON-NLS-2$ // copyright sign
badEntities["&ordf;"]=   "\u00AA"; //$NON-NLS-1$ //$NON-NLS-2$ // feminine ordinal indicator
badEntities["«"]=  "\u00AB"; //$NON-NLS-1$ //$NON-NLS-2$ // left-pointing double angle quotation mark
badEntities["¬"]=    "\u00AC"; //$NON-NLS-1$ //$NON-NLS-2$ // not sign
badEntities["&shy;"]=    "\u00AD"; //$NON-NLS-1$ //$NON-NLS-2$ // soft hyphen
badEntities["®"]=    "\u00AE"; //$NON-NLS-1$ //$NON-NLS-2$ // registered sign
badEntities["&macr;"]=   "\u00AF"; //$NON-NLS-1$ //$NON-NLS-2$ // macron
badEntities["°"]=    "\u00B0"; //$NON-NLS-1$ //$NON-NLS-2$ // degree sign
badEntities["±"]= "\u00B1"; //$NON-NLS-1$ //$NON-NLS-2$ // plus-minus sign
badEntities["&sup2;"]=   "\u00B2"; //$NON-NLS-1$ //$NON-NLS-2$ // superscript two
badEntities["&sup3;"]=   "\u00B3"; //$NON-NLS-1$ //$NON-NLS-2$ // superscript three
badEntities["&acute;"]=  "\u00B4"; //$NON-NLS-1$ //$NON-NLS-2$ // acute accent
badEntities["µ"]=  "\u00B5"; //$NON-NLS-1$ //$NON-NLS-2$ // micro sign
badEntities["¶"]=   "\u00B6"; //$NON-NLS-1$ //$NON-NLS-2$ // pilcrow sign
badEntities["·"]= "\u00B7"; //$NON-NLS-1$ //$NON-NLS-2$ // middle dot
badEntities["&cedil;"]=  "\u00B8"; //$NON-NLS-1$ //$NON-NLS-2$ // cedilla
badEntities["&sup1;"]=   "\u00B9"; //$NON-NLS-1$ //$NON-NLS-2$ // superscript one
badEntities["&ordm;"]=   "\u00BA"; //$NON-NLS-1$ //$NON-NLS-2$ // masculine ordinal indicator
badEntities["»"]=  "\u00BB"; //$NON-NLS-1$ //$NON-NLS-2$ // right-pointing double angle quotation mark
badEntities["&frac14;"]= "\u00BC"; //$NON-NLS-1$ //$NON-NLS-2$ // vulgar fraction one quarter
badEntities["&frac12;"]= "\u00BD"; //$NON-NLS-1$ //$NON-NLS-2$ // vulgar fraction one half
badEntities["&frac34;"]= "\u00BE"; //$NON-NLS-1$ //$NON-NLS-2$ // vulgar fraction three quarters
badEntities["&iquest;"]= "\u00BF"; //$NON-NLS-1$ //$NON-NLS-2$ // inverted question mark
badEntities["&Agrave;"]= "\u00C0"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter A with grave
badEntities["&Aacute;"]= "\u00C1"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter A with acute
badEntities["&Acirc;"]=  "\u00C2"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter A with circumflex
badEntities["&Atilde;"]= "\u00C3"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter A with tilde
badEntities["&Auml;"]=   "\u00C4"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter A with diaeresis
badEntities["&Aring;"]=  "\u00C5"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter A with ring above
badEntities["&AElig;"]=  "\u00C6"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter AE
badEntities["&Ccedil;"]= "\u00C7"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter C with cedilla
badEntities["&Egrave;"]= "\u00C8"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter E with grave
badEntities["&Eacute;"]= "\u00C9"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter E with acute
badEntities["&Ecirc;"]=  "\u00CA"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter E with circumflex
badEntities["&Euml;"]=   "\u00CB"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter E with diaeresis
badEntities["&Igrave;"]= "\u00CC"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter I with grave
badEntities["&Iacute;"]= "\u00CD"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter I with acute
badEntities["&Icirc;"]=  "\u00CE"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter I with circumflex
badEntities["&Iuml;"]=   "\u00CF"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter I with diaeresis
badEntities["&ETH;"]=    "\u00D0"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter ETH
badEntities["&Ntilde;"]= "\u00D1"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter N with tilde
badEntities["&Ograve;"]= "\u00D2"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter O with grave
badEntities["&Oacute;"]= "\u00D3"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter O with acute
badEntities["&Ocirc;"]=  "\u00D4"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter O with circumflex
badEntities["&Otilde;"]= "\u00D5"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter O with tilde
badEntities["&Ouml;"]=   "\u00D6"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter O with diaeresis
badEntities["&times;"]=  "\u00D7"; //$NON-NLS-1$ //$NON-NLS-2$ // multiplication sign
badEntities["&Oslash;"]= "\u00D8"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter O with stroke
badEntities["&Ugrave;"]= "\u00D9"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter U with grave
badEntities["&Uacute;"]= "\u00DA"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter U with acute
badEntities["&Ucirc;"]=  "\u00DB"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter U with circumflex
badEntities["&Uuml;"]=   "\u00DC"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter U with diaeresis
badEntities["&Yacute;"]= "\u00DD"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter Y with acute
badEntities["&THORN;"]=  "\u00DE"; //$NON-NLS-1$ //$NON-NLS-2$ // latin capital letter THORN
badEntities["&szlig;"]=  "\u00DF"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter sharp s
badEntities["&agrave;"]= "\u00E0"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter a with grave
badEntities["&aacute;"]= "\u00E1"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter a with acute
badEntities["&acirc;"]=  "\u00E2"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter a with circumflex
badEntities["&atilde;"]= "\u00E3"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter a with tilde
badEntities["&auml;"]=   "\u00E4"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter a with diaeresis
badEntities["&aring;"]=  "\u00E5"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter a with ring above
badEntities["&aelig;"]=  "\u00E6"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter ae
badEntities["&ccedil;"]= "\u00E7"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter c with cedilla
badEntities["&egrave;"]= "\u00E8"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter e with grave
badEntities["&eacute;"]= "\u00E9"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter e with acute
badEntities["&ecirc;"]=  "\u00EA"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter e with circumflex
badEntities["&euml;"]=   "\u00EB"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter e with diaeresis
badEntities["&igrave;"]= "\u00EC"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter i with grave
badEntities["&iacute;"]= "\u00ED"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter i with acute
badEntities["&icirc;"]=  "\u00EE"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter i with circumflex
badEntities["&iuml;"]=   "\u00EF"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter i with diaeresis
badEntities["&eth;"]=    "\u00F0"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter eth
badEntities["&ntilde;"]= "\u00F1"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter n with tilde
badEntities["&ograve;"]= "\u00F2"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter o with grave
badEntities["&oacute;"]= "\u00F3"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter o with acute
badEntities["&ocirc;"]=  "\u00F4"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter o with circumflex
badEntities["&otilde;"]= "\u00F5"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter o with tilde
badEntities["&ouml;"]=   "\u00F6"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter o with diaeresis
badEntities["&divide;"]= "\u00F7"; //$NON-NLS-1$ //$NON-NLS-2$ // division sign
badEntities["&oslash;"]= "\u00F8"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter o with stroke
badEntities["&ugrave;"]= "\u00F9"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter u with grave
badEntities["&uacute;"]= "\u00FA"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter u with acute
badEntities["&ucirc;"]=  "\u00FB"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter u with circumflex
badEntities["&uuml;"]=   "\u00FC"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter u with diaeresis
badEntities["&yacute;"]= "\u00FD"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter y with acute
badEntities["&thorn;"]=  "\u00FE"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter thorn
badEntities["&yuml;"]=   "\u00FF"; //$NON-NLS-1$ //$NON-NLS-2$ // latin small letter y with diaeresis
function RemoveBadEntities (text_to_cleare){
	return badEntities[text_to_cleare];
}
function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  return myHeight ;
}
function view_more_cards(){
alertSize();
	document.getElementById('preloader_loading').style.height=alertSize()+'px';
	document.getElementById('preloader_loading').style.display='';
	t=setTimeout("display_more_cards()",3000);
	
	
}
function display_more_cards(){
	clearTimeout(t);
	document.getElementById('landing_page').style.display='none';
	document.getElementById('landing_page').innerHTML='';
	document.getElementById('landing_more').style.display='none';
	document.getElementById('preloader_loading').style.display='none';
	document.getElementById('preloader_loading').style.height="0px";
	document.getElementById('preloader_img_2').style.height="0px";
	document.getElementById('more_credit_cards').style.display='';
	document.getElementById('preloader_loading').innerHTML='';
}
function view_landing_cards(){
	document.getElementById('landing_page').style.display='';
	document.getElementById('landing_more').style.display='';
	document.getElementById('more_credit_cards').style.display='none';
	
}
function change_business_consumers(ev){
	if(ev==1){
		document.getElementById("consumer_tab").className='tab active';
		document.getElementById("business_tab").className='tab inactive';
	}else{
		document.getElementById("consumer_tab").className='tab inactive';
		document.getElementById("business_tab").className='tab active';
	}
	document.getElementById("preloader111").style.display='';
	document.getElementById("preloader111").style.zIndex=100;
	document.getElementById("prescr_listing_c").style.display='none';
		document.getElementById("div_c").style.display='none';
		document.getElementById("floated_c").style.display='none';
		document.getElementById("prescr_listing_b").style.display='none';
		document.getElementById("div_b").style.display='none';
		document.getElementById("floated_b").style.display='none';
	t=setTimeout("change_business_consumers_2("+ev+")",3000);
}

function change_business_consumers_2(ev){
	document.getElementById("preloader111").style.display='none';
	document.getElementById("preloader111").style.zIndex=0;
	if(ev==1){
		document.getElementById("prescr_listing_c").style.display='';
		document.getElementById("div_c").style.display='';
		document.getElementById("floated_c").style.display='';
		document.getElementById("prescr_listing_b").style.display='none';
		document.getElementById("div_b").style.display='none';
		document.getElementById("floated_b").style.display='none';
	}else{
		document.getElementById("prescr_listing_c").style.display='none';
		document.getElementById("div_c").style.display='none';
		document.getElementById("floated_c").style.display='none';
		document.getElementById("prescr_listing_b").style.display='';
		document.getElementById("div_b").style.display='';
		document.getElementById("floated_b").style.display='';
	}
}