//---------------------------------------------------------------------------------------------------------------------------------------------
var months = new Array(13);
months[1]  = "January";
months[2]  = "February";
months[3]  = "March";
months[4]  = "April";
months[5]  = "May";
months[6]  = "June";
months[7]  = "July";
months[8]  = "August";
months[9]  = "September";
months[10]  = "October";
months[11] = "November";
months[12] = "December";

var myDays = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]

var bDateAdded = false;

function fnPrintTodaysDate(){
	var date = new Date();
	if(bDateAdded == false){
		document.write(myDays[date.getDay()]+", "+date.getDate() + " " + months[date.getMonth()]+" "+date.getFullYear());
		bDateAdded = true;}
}
//---------------------------------------------------------------------------------------------------------------------------------------------
function importXML(xmlFile){
	if (document.implementation && document.implementation.createDocument){
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = createTable;
	}
	else if (window.ActiveXObject)	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () {
			if (xmlDoc.readyState == 4) createTable()
		};
 	}
	else
	{
		//alert('Your browser can\'t handle this script');
		return;
	}
	xmlDoc.load(xmlFile);
}
//---------------------------------------------------------------------------------------------------------------------------------------------
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 checkMessage(myForm) {
	if ('validationKey='+myForm.txtValid.value != readCookie('validationKey') || myForm.txtMailSubject.value == '' || myForm.txtMailBody.value=='Please type your message here') {
	    alert("Please type correct subject, message and validation key")
	    return (false);
	}
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.txtMail.value)){
	    return (true);
	}
	alert("Please enter  a valid email address");
	return (false);
}
//---------------------------------------------------------------------------------------------------
function fnHideShowDivs(sPass, iTotal) { 
	var i;
	for (i = 1; i <= iTotal; i++){   
		   if(i == sPass.substring(sPass.length-1, sPass.length)){
			document.all(sPass).style.display = "block";
		   }
		   else{
			document.all(sPass.substring(0, sPass.length-1)+i).style.display = "none";
		   }
	}
} 
//---------------------------------------------------------------------------------------------------
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 bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}
//---------------------------------------------------------------------------------------------------
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 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 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 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 ('validationKey='+myForm.txtValid.value != readCookie('validationKey')) {
	    alert("Please type correct validation key");
	    return (false);}
	
	if (myForm.iCompanyMark.selectedIndex == 0 || myForm.txtComment.value=='Please type your comments here') {
	alert("Please select a rating from the drop down menu and type some comments");
	return (false);}
	
	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 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 != ''){
		//alert(document.forms[sForm].txtSearch.value);
		return true;
	}
	else{
		return false;
	}
}
//---------------------------------------------------------------------------------------------------------------------------------------------
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.all(b+h).style.display="none";   
 document.all(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
 }
 

 