
//---------------------------------------------------------------------------------------------------
function getQueryVariable(variable) { 
    var query = window.location.search.substring(1); 
    var vars = query.split("&"); 
    for (var i=0;i<vars.length;i++) { 
    var pair = vars[i].split("="); 
    if (pair[0] == variable) { 
    return pair[1]; 
    } 
    } 
    //alert('Query Variable ' + variable + ' not found'); 
} 
//---------------------------------------------------------------------------------------------------
function mf_showhiddenrows(sPass, iTotal, iFrom){
    for (var i = iFrom; i <= iTotal; i++){   
       document.getElementById(sPass+i).style.display = "block";
    }
    document.getElementById("HideIt").style.display = "none";
}
//---------------------------------------------------------------------------------------------------
function ShowHideElementById(id){
var obj=document.getElementById(id);
obj.style.display=='block' ? obj.style.display='none' : obj.style.display='block';
}
//---------------------------------------------------------------------------------------------------
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
//---------------------------------------------------------------------------------------------------
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
//---------------------------------------------------------------------------------------------------
function eraseCookie(name) {
	createCookie(name,"",-1);
}
//---------------------------------------------------------------------------------------------------
function checkCompanySubmit(formObj) {
var validation = true;
var message = "Please fill following fields:";
if (formObj.txtCompanyName.value == "") {
    message += "\nCompany name";
    validation = false;
}
if (formObj.txtUrl.value == "") {
    message += "\nCompany website url";
    validation = false;
}
if (formObj.txtDescription.value == "") {
    message += "\nCompany description";
    validation = false;
}
if (formObj.txtContactName.value == "") {
    message += "\nContact person name";
    validation = false;
}
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formObj.txtContactMail.value)){
	}
else{
    message += "\nContact person e-mail";
    validation = false;
}
if ('validationKey='+formObj.txtValid.value != readCookie('validationKey')) {
    message += "\nValidation code";
    validation = false;
}
if(validation == false){alert(message);}

return validation;
}
//---------------------------------------------------------------------------------------------------
var qsParm = new Array();
function qs() {
var query = window.location.search.substring(1);
var parms = query.split('&');
for (var i=0; i<parms.length; i++) {
var pos = parms[i].indexOf('=');
if (pos > 0) {
var key = parms[i].substring(0,pos);
var val = parms[i].substring(pos+1);
qsParm[key] = val;
}
}
} 
//---------------------------------------------------------------------------------------------------
function fnHideShowDivs_(sPass, iTotal, active) { 
    var i;
    for (i = 1; i <= iTotal; i++){   
       document.all(sPass+i).style.display = "none";
    }
    document.all(sPass+active).style.display = "block";
} 
//---------------------------------------------------------------------------------------------------
function SelectedCompaniesShowAll(id, iTotal) {
/*for (i = 2; i <= iTotal; i++){   
    document.getElementById(id+'_'+i).style.display = 'block';}
document.getElementById(id+'_link').style.display='none'; 
*/
for (i = 2; i <= iTotal; i++){   
    document.getElementById(id+'_'+i).style.display == "block" ? document.getElementById(id+'_'+i).style.display = "none" : document.getElementById(id+'_'+i).style.display = "block";
    //document.getElementById(id+'_link').style.display == "block" ?document.getElementById(id+'_link').style.display = "none" : document.getElementById(id+'_link').style.display = "block";
}

}
//---------------------------------------------------------------------------------------------------
function more() 
{document.all('talak').style.display='block'; 
document.all('linka').style.display='none'; 
}
//---------------------------------------------------------------------------------------------------
function fnHideShowDivs(sPass, iTotal) { 
var i;
for (i = 1; i <= iTotal; i++){   
        document.all(sPass+i).style.display == "block" ? document.all(sPass+i).style.display = "none" : document.all(sPass+i).style.display = "block";
}
} 

//---------------------------------------------------------------------------------------------------
function openTandC()
{
window.open("http://www.77finance.co.uk/termsandconditions.html", "tcs", "directories=0,menubar=0,toolbar=0,location=1,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=350");
}
//---------------------------------------------------------------------------------------------------





function openTandC()
{
window.open("../termsandconditions.html", "tcs", "directories=0,menubar=0,toolbar=0,location=1,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=350");
}

// BROWSER SNIFFER
if (document.layers) {navigator.family = "nn4"}
if (document.all) {navigator.family = "ie4"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {navigator.family = "gecko"}

//  #########  popup text
descarray = new Array(
"<tr><td class=b_header>A discretionary or full service broker</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">Hand over your money, and all responsibility, and your broker will choose what to invest in and when to trade.  But it's not cheap and there's no guarantee that his results will be any better than yours - only you'll pay more for the privilege!</td></tr>",
"<tr><td class=b_header>An advisory broker</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">Open up an account, deposit your money and choose whether or not to follow the broker's investment advice.  Again, it's not cheap and there are no guarantees of success - but the broker may offer some new ideas and give you a little more reassurance when you trade.</td></tr>",
"<tr><td class=b_header>An execution only broker</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">You do the research and you make the decisions.  The broker simply carries out your instructions.</td></tr>",
"<tr><td class=b_header>Face to face contact</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">Sat across the desk from your broker - probably best for the faint hearted who don't want to lose sight of their hard earned savings until the last possible moment.</td></tr>",
"<tr><td class=b_header>Telephone dealing</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">Very convenient - everyone has access to a telephone - although most brokers now charge a premium for telephone dealing as they have increased overheads to pass on.  Plus, it's difficult to maintain a constant watch on the market to time your trades to best effect, when all you've got is a voice on the other end of a telephone.</td></tr>",
"<tr><td class=b_header>Internet dealing</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">Requires the client to have access to a computer, but offers a number of advantages - cheaper transaction costs, 24 hour availability, real-time pricing, portfolio management functionality… and its fun!  For many people trading over the Internet is a challenge and a pleasure - making it more of a hobby than a chore.</td></tr>",
"<tr><td class=b_header>Dealing commission structures</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">In recent years there has been a trend towards brokers simplifying their services and pricing structures. This has coincided with the rise of the Internet as a share dealing platform - Internet share dealing only took off in 1999, but now accounts for 25% of all retail trades.<p>The new Internet brokers have used technology to revolutionise their services and the subsequent charging structures.  Many of the traditional players have had to update their pricing to stay competitive.</p><p><li><strong>Flat fee trading</strong> - The most common and transparent basis for charging dealing commission on the Internet - and very often the cheapest.  The broker quotes a single flat fee which applies regardless of the size of transaction - placing a £500 trade costs the same as placing a £5,000 trade.</li></p><p><li><strong>Stepped or percentage fees, based on transaction size</strong> - The broker quotes a greater fee for a larger trade, either as a percentage of the transaction size, or using incremental fees based on pricing bands.  This is the traditional method for a stockbroker to charge dealing commission - basically the larger investor pays more than the smaller investor.<br>However, there is now little justifiable reason for the investor to pay more commission on a larger trade as the market charges the broker the same fee regardless of size.</li></p><p><li><strong>Stepped fees, based on number of trades</strong> - The broker offers discounts to investors doing more than a specified number of trades per quarter, rewarding investors for their business and loyalty.</p></td></tr>",
"<tr><td class=b_header>Management fees and hidden charges</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">Some brokers still charge the investor an annual fee for the privilege of being a customer, under the guise that it covers their administration costs.  Others levy an annual fee in exchange for offering cheaper dealing commissions and additional share trading tools.  And some have relabelled this annual charge an 'inactivity fee', whereby it is only levied against those investors not trading in any one quarter.<p>In addition, all brokers will charge a fee for 're-materialising stock', (issuing a stock certificate), and 'transfers out', (transferring a stock holding to another broker), whilst some brokers will also charge for corporate actions, (issuing a dividend), placing limit orders, placing a trade over the telephone and even just holding your stock on their database.</p></td></tr>",
"<tr><td class=b_header>Bid/ offer spreads and price improvement</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">The bid/ offer spread is the difference between the quoted price at which you can buy and sell stock through the broker and as dictated by the various market makers (RSPs) offering a market for the stock.  The 'yellow strip' or 'touch price' is a summary of the best prices available from all the market makers.<p>Every broker has an obligation to quote their clients within the touch-price.  But some brokers are better at this than others.  Most brokers obtain quotes from a panel of market makers and those with a larger panel can often 'improve' on the quoted price.</p><p>What this means is that a private investor selling 2,000 shares at the 'touch price' of 152.00 per share will receive £3040.00 on the trade, whereas an investor getting an 'improved' price of 152.25, (a quarter point above touch), will receive £3045.00 - an extra £5 on the trade.  And on a larger, £20,000 trade he would make an extra £50 on the transaction.</p></td></tr>",
"<tr><td class=b_header>Type of investment product - low/medium risk</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">Different brokers offer different trading instruments.  Most offer a wide choice of Crest-eligible UK stocks, but there are other options available with different risk profiles:<p><li><strong>Funds</strong> - Many brokers offer access to investment funds that track industry sectors or geographic regions.  A more recent innovation is the Exchange Traded Fund, ETF, which tracks indices or sector risks in the same way as a trust fund, but incurs lower management costs and offers continuous pricing throughout the day for increased trading flexibility.</li></p><p><li><strong>International stocks</strong> - There are now several brokers giving access to the US and European markets, meaning that private investors can now trade many of the world's largest brands not previously listed in the UK.  Generally, but not always, the brokers will charge a premium for international trades and there are additional forms to complete to access the US markets.<br><br>In response to the growing demand for overseas trading the London Stock Exchange set up the International Retail Service, IRS, which offers secondary listings of 150 large overseas stocks.  These IRS securities can usually be traded at UK commission levels.</li></p><p><li><strong>Tax free ISA wrappers</strong> - An Individual Savings Account, ISA, is a tax efficient savings vehicle - you pay no Capital Gains Tax on profits realised within the wrapper.  Many brokers now offer self-select ISAs which allow the investor to decide for himself which equities, investment trusts, ETFs, unit trusts or gilts to hold.<br><br>For an annual fee of as little as £25 the private individual can now invest up to £7,000 per tax year free of Capital Gains Tax.</li></p></td></tr>",
"<tr><td class=b_header>Type of investment product - medium/high risk</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">Different brokers offer different trading instruments.  Most offer a wide choice of Crest-eligible UK stocks, but there are other options available with different risk profiles:<p><li><strong>Small cap and OFEX shares</strong> - These are typically small companies and start-ups not traded by the majority of the online brokers.  Anyone interested in this type of risk should seek out a specialist.  The illiquid nature of these stocks (some of them may go several days without any trading activity) gives rise to wide bid/offer spreads and volatile price movements.</li></p><p><li><strong>CFDs</strong> - A Contract for Difference is a derivative instrument designed to replicate the economic performance and the cash flows of a conventional share investment.  But a CFD offers greater leverage and small fluctuations in the value of the underlying instrument can quickly lead to profits or losses which can exceed the initial deposit. <br><br> CFDs can be used in falling as well as rising markets and they can be used to hedge equity positions.  But they are high risk investments and are not suitable for everyone.</li></p><p><li><strong>Spread betting</strong> - Spread betting allows an investor to speculate on the outcome of various events, such as financial markets or sporting fixtures.  A 'spread' is quoted, such as 4500-4510 for the FTSE 100 index.  If the investor decides that the index will go higher than 4510 he can place a bet that the index will rise, or he may decide to gamble that it will fall below 4500.  The investor decides how much to bet on each point that the index will move outside the spread.<br><br>Again, spread betting can be used to hedge a position or place a one-way bet.  And again, this is a high risk investment, not suitable for everyone.</li></p></td></tr>",
"<tr><td class=b_header>Limit orders</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">A limit order is an instruction stating the maximum price an investor is willing to pay when buying shares, (a buy order), or the minimum he will accept when selling, (a sell order).  These orders allow the investor to have greater control over the timing of his trades and consequently allow him to achieve better prices.<p>Over half of the online brokers now offer some form of limit order, varying from same day 'fill or kill' orders to full 90 day limit orders and subsequent 'contingent stop' orders which allow the investor to effectively 'programme in' a sequence of trading events.</p></td></tr>",
"<tr><td class=b_header>Dealing tools and value-added services</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">All the brokers offer some form of free news, research or analysis tools.  A few also offer premium services which are available either on a pay-per-use basis, or in exchange for an annual fee or the placing of a minimum number of trades per quarter.<p>At the very top of the premium services tree is Level 2 Market Information - which includes the underlying market maker quotes and order books that form the basis of the publicly quoted bid/ offer share prices.  This information is invaluable for predicting short term price movements and market sentiment, which allows the investor to time his trades better.</p><p>Other services to look out for include premium research, broker tips, fundamental analysis and advanced charting tools.  All of these tools have their advocates and detractors.  And all are available separately from specialist non-broker sites, so it is important to make sure that you are not paying extra for something you are not going to use.</p></td></tr>",
"<tr><td class=b_header>Your average trade or transaction size</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">One investor might buy small parcels of OFEX listed stock at £500 per trade - in the hope that one or two of them may hit the big time over the next few years.  Another investor might choose to buy and sell £20,000 of the same blue-chip stock several times a day - watching the minute fluctuations and making £200 on each trade.  Most investors' behaviour falls somewhere between the two.<p>The average online trade in the UK is currently about £5,000.  Your choice of broker account should reflect the average size of your investments:</p><p><li><strong>Average less than £5,000:</strong> - If you are going to trade regularly at less than this level then a competitive dealing commission is important, with flat fee trading available from £7 per trade.  And look for a broker with no hidden extra costs or management fees.</li></p><p><li><strong>More than £5,000:</strong> - If you are going to trade at much higher than this level, saving a few pounds on up-front dealing commissions becomes less important than making sure that you are trading at the best available market prices for each stock.  You need to make best use of limit orders and 'price improvement' on the bid/ offer spreads, and investigate the possible use of Level 2 information.</li></p></td></tr>",
"<tr><td class=b_header>The frequency at which you trade</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">There are less than 10,000 private individuals making more than 10 trades per month.  The average investor trades little more than once a month and holds his investments for over a year.<p>Those investors trading more than 10 times per quarter enter the territory of the 'frequent trader' and they are much prized by the broker community who will often offer commission discounts and value-added services to attract them on-board.</p><p>The frequent traders can be split between 'active traders', who follow the same buy-hold-sell pattern of the normal investor, and 'day traders' who are often looking to buy and sell a stock on minor fluctuations within the space of a few days.</p><p><li><strong>Normal investors:</strong> - Less frequent traders don't qualify automatically for the discount packages and should be careful not to pay an increased annual fee or subscription for these trading discounts and value added services if they are not going to make full use of them.  Look for good value 'flat fee' dealing commissions, no annual fees, good basic service and market coverage.</li></p><p><li><strong>Active traders:</strong> - These investors are often in touch with market sentiment and should be looking to obtain the best prices on each trade, 'price improvement', together with a good level of service including limit orders and a good value fee structure.</li></p><p><li><strong>Day traders:</strong> - These investors are often only looking to make a small margin on each trade over a short period.  An 'improved' bid/offer spread becomes as important as the initial dealing commission.  Look for low dealing commissions, tight spreads, limit orders and Level 2 information.</li></p></td></tr>",
"<tr><td class=b_header>Your attitude towards risk</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">The private investor's attitude toward risk is typically based on a combination of confidence with the markets and how much he can afford to lose on a bad decision.  However, there are now so many online trading options available, that there is something to suit everyone:<p><li><strong>Low risk</strong> - For a long term investment at the safer end of the scale, look for a broker that offers trusts and funds - Exchange Traded Funds, ETFs, are easy to trade and often incur lower management charges.  Also look out for ISA wrappers which can be used to protect an annual investment of £7000 against the ravages of the tax man.</li></p><p><li><strong>Nominal risk</strong> - Individual shares are always more volatile than a basket of shares in a fund, and potentially offer greater returns for the astute investor.  Large blue-chip shares are relatively safe in comparison with the more volatile smaller stocks and high risk OFEX listings.  A broker offering international share dealing might offer an interesting opportunity to diversify.</li></p><p><li><strong>Medium/ high risk instruments</strong> - In addition to traditional equities, many brokers now offer other instruments with potentially greater returns, but also more complexity and risk.  This risk increases from main-market equities, through small-cap shares and into more exotic instruments such as cfds, spread-betting, futures and options.</li></p></td></tr>",
"<tr><td class=b_header>Your use of research & additional tools</td></tr><tr><td style=\"padding:10px;text-align:justify;\" class=\"paragraph\">Most brokers offer basic trading tools and research, which are in themselves more than enough for the average investor.  However, some investors like to base their decisions on screening and financial charting tools, whilst others use fundamental analysis of a company's financials as a base for their decisions.<p><li><strong>Services for the occasional trader</strong> - Look for free research, full customer service and limit orders to give better control on the timing of your trades.  More advanced traders should also look for full 90-day limit and contingent stop orders.  However, there is a lot of research available free on the Internet or on a pay-per-use basis and the occasional trader shouldn't need to pay extra broker charges unless they are really going to benefit.</li></p><p><li><strong>Packages for frequent traders</strong> - Frequent traders often qualify for enhanced packages of services, including discounts, premium research, streaming and level 2 pricing information.  However, these tools are frequently available independently - check that you are getting good value & something useful before committing to a broker with higher dealing charges.</li></p></td></tr>"
);

overdiv="0";
//  #########  CREATES POP UP BOXES
function popLayer(a,h){document.getElementById("object1").style.display="block";
if(!descarray[a]){descarray[a]="<font color=red>This popup (#"+a+") isn't setup correctly - needs description</font>";}
if (navigator.family == "gecko") {pad="0";}
else {pad="1"; bord="0";}
desc = 	"<table cellspacing=0 cellpadding=0 border=0><tr><td class=violet>\n"
	+"<table cellspacing=2 cellpadding=2 border=0 width=500>\n"
	+descarray[a]
	+"</table>\n"
	+"</td></tr></table>";
if(navigator.family =="nn4") {
	document.object1.document.write(desc);
	document.object1.document.close();
	document.object1.left=x+50;
	document.object1.top=y-h;
	}
else if(navigator.family =="ie4"){
	object1.innerHTML=desc;
	object1.style.pixelLeft=x+10;
	object1.style.pixelTop=y-h;
	}
else if(navigator.family =="gecko"){
	document.getElementById("object1").innerHTML=desc;
	document.getElementById("object1").style.left=x+50;
	document.getElementById("object1").style.top=y-h;
	}
}
function hideLayer(){
if (overdiv == "0") {document.getElementById("object1").style.display="none";
	if(navigator.family =="nn4") {eval(document.object1.top="-500");}
	else if(navigator.family =="ie4"){object1.innerHTML="";}
	else if(navigator.family =="gecko") {document.getElementById("object1").style.top="-500";}
	}
}

//  ########  TRACKS MOUSE POSITION FOR POPUP PLACEMENT
var isNav = (navigator.appName.indexOf("Netscape") !=-1);
function handlerMM(e){
x = (isNav) ? e.pageX : event.clientX + document.body.scrollLeft;
y = (isNav) ? e.pageY : event.clientY + document.body.scrollTop;
}
if (isNav){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = handlerMM;
//  End -->


//---------------------------------------------------------------------------------------------------
//FUNCTIONS FOR PERSONAL LOANS CALCULATOR (IN TABS)

var amount, apr, n, payment, npy, tablebuilt=false;

function calculate(){
var d=document.f;
amount=d.amount.value;
apr=d.apr.value;
n=d.n.value;
npy=d.npy.value;
if( (amount!='') && (n!='') && (apr!='') && (npy!='') ){
tmp=Math.pow((1+(apr/100/npy)), (n*npy));
payment=(amount*tmp*(apr/100/npy))/(tmp-1);
if((!isNaN(payment))&&(payment!=Number.POSITIVE_INFINITY)&&(payment!=Number.NEGATIVE_INFINITY)){
d.payment.value=round(payment);
d.totpaid.value=round(payment*n*npy);
d.intpaid.value=round((payment*n*npy)-amount);
}else alert('Error: One or more fields contain data\nwhich cannot be used in the calculation. \n\nCheck you have only used numbers and \ndecimal points in the text fields.');
}else alert('Error:\nYou did not provide enough data.');
}

function round(val){
tmp=Math.round(val*100)/100+'';
if(tmp.indexOf('.')==-1)tmp+='.00';
else if(tmp.length-tmp.indexOf('.')==2)tmp+='0';
return tmp;
}

function resetall(){
var d=document.f;
d.amount.value='';
d.apr.value='';
d.n.value='';
d.npy.value=12;
d.payment.value='';
d.totpaid.value='';
d.intpaid.value='';
d.amount.focus();
}

function more() { document.all('talak').style.display='block'; 
                  document.all('linka').style.display='none'; }
				  
				  
				  function mare() { document.all('linka').style.display='block'; }
				  
				  

function printer(){
	if((navigator.appVersion.indexOf("4.") != -1) && (navigator.appName.indexOf("Netscape") != -1)){
	print();}
}

function buildtable(){
tablebuilt=true;
txt='<html><head><title>Payment Schedule</title></head><body bgcolor="#FFFFFF"><center><form>';
txt+='<input type="button" value="Close" onClick="window.close()"><br><br><em>to print this table, right-click with your mouse and<br>select print from the context menu...</em><br><br>';
txt+='<table bgcolor="#FFFFFF" border="0" cellpadding="4" cellspacing="3">';
txt+='<tr><strong><td align="center">Payment<br>Number</td><td align="center">Monthly<br>payment</td><td align="center">Principle<br>amount</td><td align="center">Interest<br>amount</td><td align="center">Remaining<br>balance</td></strong></tr>';
amount=eval(amount);
for(i=1;i<=n*npy;i++){
tbldata='<td bgcolor="'+((i%2!=0) ? '#EEF1F8' : '#FFFFFF')+'" align="right">';
interest=amount*apr/npy/100;
amount+=interest;
principle=payment-interest;
amount-=payment;
txt+='<tr>'+tbldata+i+':</td>'+tbldata+round(payment)+'</td>'+tbldata+round(principle)+'</td>'+tbldata+round(interest)+'</td>'+tbldata+round(amount)+'</td></tr>';
}
txt+='</table><br><br><input type="button" value="Close" onClick="self.close()"></center></form></body></html>';
var psch=window.open('', 'viewsch' ,'top=0,left=0,toolbar=no,scrollbars=yes,resizable=yes,width=500,height=450,menubar=no,status=no');
psch.document.write(txt);
}
//---------------------------------------------------------------------------------------------------
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
//---------------------------------------------------------------------------------------------------
    function doSort(field,direction, form_name){
    document.forms[form_name].hdnSort.value = field; 
    document.forms[form_name].hdnAscDsc.value = direction;
    document.forms[form_name].submit(); 
    }
//---------------------------------------------------------------------------------------------------
function encode(str) {
	var result = "";
	for (i = 0; i < str.length; i++) {
		if (str.charAt(i) == " ") result += "+";
		else result += str.charAt(i);
	}
	return escape(result);
}
//---------------------------------------------------------------------------------------------------

function fn(fileName) {
	var session = "";
	if (session == "") alert("You need be registered and logged in to access this data");
	else
    parent.frameName1.location.href = "webbox.asp?iUrlNumber="+fileName;
}
//---------------------------------------------------------------------------------------------------
	function checkSendFriend(Registration) {
		friendName = Registration.txtFname.value;
		senderName = Registration.txtSenderName.value;
		senderMail = Registration.txtSendermail.value;
		friendMail = Registration.txtFmail.value;
		
		check_friendName = 0;
		check_senderName = 0;
		check_mail_1 = 0;
			if (friendName == "") {
				alert("Please enter your friend name");
				return(false);
			} else {
				check_friendName = 1;
				}
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(friendMail)){
				check_mail_2 = 1 ;
			} else {
				alert("Please enter a valid friend email address");
				return (false);
			}
			if (senderName == "") {
				alert("Please enter your name");
				return(false);
			} else {
				check_senderName = 1;
				}
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(senderMail)){
				check_mail_1 = 1 ;
			} else {
				alert("Please enter a valid email address");
				return (false);
				}
			
		return(true);	

	}
	
//---------------------------------------------------------------------------------------------------
	function checkFields(Registration) {
		name = Registration.txt_firstName.value;
		last_name = Registration.txt_lastName.value;
		pass = Registration.txt_password.value;
		pass2 = Registration.txt_password2.value;
		check_name = 0;
		check_lastname = 0;
		check_mail = 0;
		check_pass = 0;
		check_pass2 = 0;
			if (name == "") {
				alert("Please enter your First Name");
				return(false);
			} else {
				check_name = 1;
				}
			if (last_name == "") {
				alert("Please enter your Last Name");
				return(false);
			} else {
				check_lastname = 1;
				}
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(Registration.txt_email.value)){
				check_mail = 1 ;
			} else {
				alert("Please enter a valid email address");
				return (false);
				}
			if (pass == "") {
				alert("Please insert a valid Password");
				return(false);
			}
			if (pass != pass2) {
				alert("Your confirmation password does not match your password");
				return(false);
			} else {
				check_pass = 1;
				}
		return(true);	

	}
//---------------------------------------------------------------------------------------------------
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 checkEmail(myForm) {

    if(myForm.txtName.value == '') {myForm.txtName.value='Enter name';}  
   
   	if ('validationKey='+myForm.txtValid.value != readCookie('validationKey')) {
	alert("Please enter validation code");
	return (false)}
	
	
	
	if(myForm.iCompanyMark.value == '') {if(myForm.include_raiting.checked) {alert("Please select rating");
	return (false)} else {myForm.iCompanyMark.value == '';}}  
	
	if(myForm.txtComment.value=='Please type your comments here') {alert("Please type some comments");
	return (false)} 
	
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.txtMail.value)){
	
	if(myForm.txtName.value == 'Enter name' || myForm.txtName.value == '') {myForm.txtName.value='Anonymous';}  
	
	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;
		}
	} l=parseInt(strobj.value.length);
	  left = 600 - l; 
	  document.getElementById('charcount').value = '('+left+' characters left)';
}
//---------------------------------------------------------------------------------------------------------------------------------------------
function fnSubmitForm(sForm){
	document.forms[sForm].submit();
}
//---------------------------------------------------------------------------------------------------------------------------------------------
function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }
//---------------------------------------------------------------------------------------------------------------------------------------------
function doCheckCurr(sForm, sText){
	if (document.forms[sForm].Currency.value != ''){
		if (IsNumeric(sText) == true)
		{return true;}
		else
		{alert('Please enter correct number');
		return false;}
	}
	else{
		return false;
	}
}
//---------------------------------------------------------------------------------------------------------------------------------------------
function doSearch(sForm){
	if (document.forms[sForm].txtSearch.value != '' & document.forms[sForm].txtSearch.value != 'search'){
		return true;
	}
	else{
	    alert('Please type some search terms');
		return false;
	}
	return false;
}
//---------------------------------------------------------------------------------------------------------------------------------------------
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 movies = xdoc.getElementsByTagName("TITLE");
	var movies1 = xdoc.getElementsByTagName("DESCRIPTION");
	var movies2 = xdoc.getElementsByTagName("URL");
	var movies3 = xdoc.getElementsByTagName("REDIR");
		
	var element = document.createElement("div");

	e.appendChild(document.createElement("div")).innerHTML = "<div style='width:128px;'><table style='overflow:hidden;' cellpadding=2 cellspacing=0 >";
	for(var i = 0; i < movies.length; ++i)
	{
	 e.appendChild(document.createElement("div")).innerHTML = '<tr><td><div style="margin: 0px 4px 0px 4px; overflow:hidden; width: 100px;" ><a class="subheader" target="_blank" href="' + movies3[i].firstChild.nodeValue + '">' + movies[i].firstChild.nodeValue + '</a><br></div></td></tr>';
	 e.appendChild(document.createElement("div")).innerHTML = '<tr><td><div style="margin: 0px 4px 4px 4px; overflow:hidden; width: 100px;" >' + movies1[i].firstChild.nodeValue + '<br></div></td></tr>';
	}
	e.appendChild(document.createElement("div")).innerHTML = '</table></div>';
}
//---------------------------------------------------------------------------------------------------------------------------------------------
function ShowHideSpecDiv(pass) { 
var divs = document.getElementsByTagName('div'); 
for(i=0;i<divs.length;i++){ 
	if(divs[i].id.match(pass)){  //if they are 'see' divs 
		divs[i].style.display == "block" ? divs[i].style.display = "none" : divs[i].style.display = "block";
	  } 
} //end for 
} 
//---------------------------------------------------------------------------------------------------------------------------------------------

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 color = new Array("#ffffff", "#EEF1F8")

function GlobalShow(g,b,l,m)

{ for (i=1; i<=m; i=i+1) { document.all(g+i).style.background=color[1] }
  for (i=1; i<=m; i=i+1) { document.all(b+i).style.display="none" }

  document.all(g+l).style.background=color[0]
  document.all(b+l).style.display="block"
  
  if (g=="tab_") {
  for (i=1; i<=m; i=i+1) { document.all("a_"+i).style.color=""; document.all("a_"+i).style.textDecoration=""; document.all("a_"+i).style.fontWeight="normal"; }
  document.all("a_"+l).style.color="#000000"; document.all("a_"+l).style.textDecoration="none"; document.all("a_"+l).style.fontWeight="bold"; }
      
 }

 
 
 h=1
 
 function Gl(b,l) { 
 
 document.getElementById(b+h).style.display="none";   
 document.getElementById(b+l).style.display="block"; 
 h=l;

}
 
 
 
 o="AZdiv_0"
 q="az_m_0"

 function Glicerin(l,f) {
  
 document.all(q).style.background=color[1]
 document.all(f).style.background=color[0]
 
 document.all(o).style.display="none"
 document.all(l).style.display="block"
  
  o=l
  q=f
 }
 
 
 
  ob="ob_1";
  zb="zb_1";
 
function brokersw(l,f) {
    document.all(ob).style.background=color[1]
    document.all(l).style.background=color[0]
    document.all(ob+"_a").style.fontWeight="normal"
    document.all(l+"_a").style.fontWeight="bold"
    document.all(ob+"_a").style.color="#E41B5B"
    document.all(l+"_a").style.color="#000000"

    document.all(ob+"_a").style.textDecoration="underline"
    document.all(l+"_a").style.textDecoration="none"

    document.all(zb).style.display="none"
    document.all(f).style.display="block"

    ob=l
    zb=f
}
 

