function o(timer_2) {
var timer_3;
identity=document.getElementById("OL");
identity.className="blink_2";
timer_3 = timer_2 +1;
if (timer_3 <= 7  )
{
	setTimeout("a("+timer_3+")", 500);
}
//clearTimeout(myTimer);
}

function a(timer) {
var timer_1;
identity=document.getElementById("OL");
identity.className="blink_1";
timer_1 = timer + 1;
setTimeout("o("+timer_1+")", 500);
}

//---------------------------------------------------------------------------------------------------
function checkEmailAlone(myForm) {
	
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.txtMail.value)){
	return (true)
	}
	alert("Please enter  a valid email address")
	return (false)
}
//---------------------------------------------------------------------------------------------------
function count(strobj, maxlen) {
var cc;
cc = 0;
	  if(strobj.value.length > maxlen) {
        strobj.value = strobj.value.substring(0,maxlen);
        cc++;
        if(cc > 0) {
          alert('Maximal comment length ' + maxlen + ' symbols!');
          cc = 0;
        }
      }
}

function showTab(pass) { 
var divs = document.getElementsByTagName('div'); 
for(i=0;i<divs.length;i++){ 
	if(divs[i].id.match(pass)){  //if they are 'see' divs 
		if (document.getElementById) // IE5, NS6 
			divs[i].style.display="block";// show/hide 
		else 
			if (document.layers) // Netscape 4 
				document.layers[divs[i]].display = 'visible'; 
			else // IE 4 
				divs[i].visibility = 'visible'; 
	}
	
	else { 
		if (document.getElementById) 
				if (!divs[i].id.substr(0,8).match('div_top_')){
						divs[i].style.display="none";}
				if (divs[i].id.substr(0,1).match('a')){
						divs[i].style.display="block";}
				//if (divs[i].id.match('divAffiliateLinks')){
				//		divs[i].style.display="block"; 
				//		divs[i].visibility = 'visible';
				//		alert('1');}
		
		else 

		if (document.layers) // Netscape 4 
				if (!divs[i].id.match('divAffiliateLinks')){
				divs[i].visibility = 'hidden';
				}
				
				if (divs[i].id.match('divAffiliateLinks')){
				divs[i].style.display="block"; 
				divs[i].visibility = 'visible';
				}

			else // IE 4 
				if (!divs[i].id.match('divAffiliateLinks')){
				divs[i].visibility = 'hidden';
				}
				if (divs[i].id.match('divAffiliateLinks')){
				divs[i].style.display="block";
				divs[i].visibility = 'visible';
				}

	  } 

				if (divs[i].id.match('divAffiliateLinks') ){
				divs[i].style.display="block"; 
				divs[i].visibility = 'visible';}
} //end for 
} 

//-----------------------------------------------------
//images on over click
	function SwapImgRestore() { 
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function FindObj(n, d) { 
	  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=FindObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function SwapImage() { 
	  var i,j=0,x,a=SwapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=FindObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

	function PreloadImages() { 
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=PreloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

//---------------------------------------------------------------------------------------------------
function checkEmail(myForm) {
	if (myForm.iCompanyMark.selectedIndex == 0 || myForm.txtComment.value=='Per favore aggiungete qui i propri commenti') {
	alert("Per favore selezionate un voto dalla lista e aggiungete I vostri commenti")
	return (false)}
	
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.txtMail.value)){
	return (true)
	}
	alert("Per favore inserire un indirizzo email valido")
	return (false)
}
//---------------------------------------------------------------------------------------------------
var tabImages = new Array(5);
tabImages[0] = new Image;
tabImages[0].src = "http://www.77finance.co.uk/images/isa_1.gif";
tabImages[1] = new Image;
tabImages[1].src = "http://www.77finance.co.uk/images/isa_2.gif";
tabImages[2] = new Image;
tabImages[2].src = "http://www.77finance.co.uk/images/isa_3.gif";
tabImages[3] = new Image;
tabImages[3].src = "http://www.77finance.co.uk/images/isa_4.gif";
tabImages[4] = new Image;
tabImages[4].src = "http://www.77finance.co.uk/images/isa_5.gif";
tabImages[5] = new Image;
tabImages[5].src = "http://www.77finance.co.uk/images/isa_6.gif";
//---------------------------------------------------------------------------------------------------
function loadSlide2(Pic_ID) {
	document.ISA_0.src='http://www.77finance.co.uk/images/isa_1_.gif'; 
	document.ISA_1.src='http://www.77finance.co.uk/images/isa_2_.gif'; 
	document.ISA_2.src='http://www.77finance.co.uk/images/isa_3_.gif';
	document.ISA_3.src='http://www.77finance.co.uk/images/isa_4_.gif'; 
	document.ISA_4.src='http://www.77finance.co.uk/images/isa_5_.gif'; 
	document.ISA_5.src='http://www.77finance.co.uk/images/isa_6_.gif';
	
	target = document.getElementById(Pic_ID);
	l = Pic_ID.length;
	k = Pic_ID.substring(l-1,l);;
	target.src = tabImages[k].src;
}
//------------preload images
function preloadIsa() {
if (document.images)
{
tab1=new Image; tab1.src="http://www.77finance.co.uk/images/isa_1.gif";
tab2=new Image; tab2.src="http://www.77finance.co.uk/images/isa_2.gif";
tab3=new Image; tab3.src="http://www.77finance.co.uk/images/isa_3.gif";
tab4=new Image; tab4.src="http://www.77finance.co.uk/images/isa_4.gif";
tab5=new Image; tab5.src="http://www.77finance.co.uk/images/isa_5.gif";
tab6=new Image; tab6.src="http://www.77finance.co.uk/images/isa_6.gif";
tab7=new Image; tab7.src="http://www.77finance.co.uk/images/isa_1_.gif";
tab8=new Image; tab8.src="http://www.77finance.co.uk/images/isa_2_.gif";
tab9=new Image; tab9.src="http://www.77finance.co.uk/images/isa_3_.gif";
tab10=new Image; tab10.src="http://www.77finance.co.uk/images/isa_4_.gif";
tab11=new Image; tab11.src="http://www.77finance.co.uk/images/isa_5_.gif";
tab12=new Image; tab12.src="http://www.77finance.co.uk/images/isa_6_.gif";
}
}
//------------preload images
if (document.images)
{
a1=new Image; a1.src="http://www.77finanza.com/images/pointer_p_off.gif";
a2=new Image; a2.src="http://www.77finanza.com/images/btn_login_click.gif";
a3=new Image; a3.src="http://www.77finanza.com/images/btn_more_g_click.gif";
a4=new Image; a4.src="http://www.77finanza.com/images/btn_more_g_over.gif";
a5=new Image; a5.src="http://www.77finanza.com/images/btn_search_click.gif";
a6=new Image; a6.src="http://www.77finanza.com/images/btn_search.gif";
a7=new Image; a7.src="http://www.77finanza.com/images/s_calculator.gif";
a8=new Image; a8.src="http://www.77finanza.com/images/s_how_to.gif";
a9=new Image; a9.src="http://www.77finanza.com/images/s_best_buys.gif";
a10=new Image; a10.src="http://www.77finanza.com/images/bttn_website.gif";
a11=new Image; a11.src="http://www.77finanza.com/images/bttn_website_click.gif";
a12=new Image; a12.src="http://www.77finanza.com/images/pointer_p_on.gif";
}

var toptimers = Array();

function topmouseover(i)
{
	document.all("div_top_"+i).style.visibility="visible"
	clearTimeout(toptimers[i]);
}

function topmouseout(i)
{
	toptimers[i]=setTimeout("hidetop("+i+")",100);
}

function hidetop(i)
{
	document.all("div_top_"+i).style.visibility="hidden"
}
//------------------------------------------------------------------------------------------------------
function showDiv(pass) { 
var divs = document.getElementsByTagName('div'); 
for(i=0;i<divs.length;i++){ 
	if(divs[i].id.match(pass)){  //if they are 'see' divs 
		if (document.getElementById) // IE5, NS6 
			divs[i].style.display="block";// show/hide 
		else 
			if (document.layers) // Netscape 4 
				document.layers[divs[i]].display = 'visible'; 
			else // IE 4 
				document.all.divs[i].visibility = 'visible'; 
	} else { 
		if (document.getElementById) 
				if (divs[i].id=='divAffiliateLinks'){
					divs[i].style.display='block';}
				else{ 
					if (!divs[i].id.substr(0,8).match('div_top_'))
						divs[i].style.display="none";
					}
		else 
			if (document.layers) // Netscape 4 
				document.divs[i].visibility = 'hidden'; 
			else // IE 4 
				document.all.divs[i].visibility = 'hidden'; 
	  } 
} //end for 
var e = document.getElementById("divAffiliateLinks");
loadXmlDocument("http://www.77finance.co.uk/espottingProxy.asp?keyword=secured loan", writeXMLData);
} 


//------------------------------------------------------------------------------------------------------
function showHideInfo(c,sPath) {

d = 'b' + c;
e = 'a' + c;

if (navigator.appName == "Netscape"){


		if (document.getElementById && document.getElementById(d).style.display=="none")
		{

			imgName = 'a' + c + '_big';
			document.getElementById(d).style.display="block";
			document.getElementById(e).style.display="none";
			document[imgName].src = sPath + c + ".png";

		}
		else
		{
			imgName = 'a' + c + '_th';
			document.getElementById(e).style.display="block";
			document.getElementById(d).style.display="none";
			document[imgName].src = sPath + c + "_th.jpeg";
		}
}


else

 {


		if (document.all[d].style.display=='block')

		{
			if (document.images){
				imgName = 'a' + c + '_th';
				document.all[e].style.display = 'block';
				document.all[d].style.display = 'none';
				document[imgName].src = sPath + c + "_th.jpeg";
			}
		}
		else
		{
			if (document.images){
				imgName = 'a' + c + '_big';
				document.all[d].style.display = 'block';
				document.all[e].style.display = 'none';
				document[imgName].src = sPath + c + ".png";
			}
		}

 }

}

//------------------------------------------------------------------------------------------------------
function openTandC()
{
window.open("http://www.77finanza.com/termsandconditions.html", "tcs", "directories=0,menubar=0,toolbar=0,location=1,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=350");
}

if(document.images){

pointeron = new Image();
pointeron.src = "http://www.77finance.co.uk/images/pointer_p_on.gif";
pointeroff = new Image();
pointeroff.src = "http://www.77finance.co.uk/images/pointer_p_off.gif";

}
function imgOn(imgName){
	if(document.images){
	document[imgName].src = pointeron.src;
	}
}


function imgOff(imgName){
	if(document.images){
	document[imgName].src = pointeroff.src;
	}
}
	
function doSearch(){
	if (document.frmSearch.txtSearch.value!=''){
	document.frmSearch.submit();
	}
}


function doSearchReturn(objEvent){
	if(objEvent.keyCode==13){
		if (document.frmSearch.txtSearch.value!=''){
		document.frmSearch.submit();
		}
	}
}


function loadXmlDocument(xmlFile, containFn)
{
   var xdoc;
   if( window.ActiveXObject && /Win/.test(navigator.userAgent) )
   {
      xdoc = new ActiveXObject("Microsoft.XMLDOM");

      xdoc.async = false;
      xdoc.load(xmlFile);
		
      containFn(xdoc);

      return true;
   }
   else if( document.implementation && document.implementation.createDocument )
   {
      xdoc = document.implementation.createDocument("", "", null);
      xdoc.load(xmlFile);

      xdoc.onload = function()
      {
         containFn(xdoc);
      }

      return true;
   }
   else
   {
      return false;
   }
}

function writeXMLData(xdoc)
 {
	
		 
	var ClickUrlNode = xdoc.getElementsByTagName('ClickUrl');
	count = ClickUrlNode.length;
    var ListingNode = xdoc.getElementsByTagName('Listing');
	  var sBulletColor = 'violet';
	 e.appendChild(document.createElement("div")).innerHTML = '<table cellpadding="0" cellspacing="0" border="0">';
	  if (count <=3)
	  {
	  iCount = count}
	  if (count >3)
	  {
	  iCount = 3}
	
	  if (count > 0)
	  {
	  for(var i = 0; i < iCount; i++)
	  {

		if(sBulletColor=='violet'){
				sBulletColor='gray';
		}
		else{
			sBulletColor='violet';
		}

		 e.appendChild(document.createElement("div id='divAffiliateLinks'")).innerHTML = '<tr><td>&nbsp;</td><td  width="9"><img src="http://www.77finanza.com/images/' + sBulletColor +'bullet.jpg" width="9" height="9"></td><td>&nbsp;<a class="subheader" target="_blank" href="' + ClickUrlNode[i].firstChild.nodeValue + '">' + ListingNode.item(i).getAttribute('title') + '</a></td></tr>';
		 e.appendChild(document.createElement("div id='divAffiliateLinks'")).innerHTML = '<tr><td><p style="margin: 0px 0px 0px 15px;" class="paragraph" align="left" >' + ListingNode.item(i).getAttribute('description') + '<br><a class="more" target="_blank" href="' + ClickUrlNode[i].firstChild.nodeValue + '">' + ListingNode.item(i).getAttribute('siteHost') + '</a></p></td></tr>';
   }}
e.appendChild(document.createElement("div")).innerHTML = '</table>';
}
	

