<!--

function afunc()
{
if($('#country')[0].length>1) return;
$.get('countries.php', function(data) {
	document.getElementById('id15').innerHTML = data;
   return;
});
}





function display_page(url,w,h) {
	newwindow=window.open(url,'name','scrollbars=1,height='+h+',width='+w);
	if (window.focus) {newwindow.focus()}
	return false;
}
function forgot_function()
{
	$("index-wrap").style.MozOpacity=0.3;
	$("index-wrap").style.filter='alpha(opacity=30)';
	$("forgot").style.display='block';
	$("forgot").style.position='absolute';
	$("forgot").style.left='25%';
	$("forgot").style.top='78px';
	$("user").value='';
	$("e-mail").value='';
	$("forgot_success").style.display='none';
}

function submit_function()
{	
	var username=$("user").value;
	var captcha=$("captcha").value;
	var email=$("e-mail").value;
	if (captcha=='') captcha='1';
	var params="a="+username+"&b=send&c="+captcha+"&d="+email;
	if ((username=='')||(email=='')) 
		alert('You must fill both fields!');
	else
	{  
		new Ajax.Request('for-got.php', {method: 'post', postBody:params, asynchronous: false,
			 onSuccess: function(transport) { /*alert('DONE:' + transport.responseText);*/ },
			 onFailure: function(transport) { /*alert('ERR:' + transport.responseText);*/ }
			 
			 });
		$("forgot_success").style.position='absolute';
		$("forgot_success").style.left='25%';
		$("forgot_success").style.top='78px';
		$("forgot").style.display='none';
		$("forgot_success").style.display='block';
	}
}

function cancel_function()
{

  	$("forgot").style.display='none';
  	$("index-wrap").style.MozOpacity=1;
  	$("index-wrap").style.filter='alpha.opacity=100';
	$("forgot_success").style.display='none';
}

function subscribe()
{
	var email=$("newsletter").value;
	var params="?mail="+email+'&lang=1';
	if (email=='')
		alert('You must fill email field!');
	else
	{  
		new Ajax.Request('subscribe.php'+params, 
			{method: 'post', 
			 asynchronous: false,
			 onSuccess: function(transport) {alert(transport.responseText);}});
		//alert('Your email was sent');
		//$('newsletter').value='';
	}
}


function finoform_includeNow(url){
	var req;
	
	var axO=['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.4.0',
		'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'], i;
	for(i=0;i<axO.length;i++)
		try{
			req = new ActiveXObject(axO[i]);
			break;
		}catch(e){}
	if(!req && typeof XMLHttpRequest != 'undefined')
		req = new XMLHttpRequest();
	
	req.open('GET', url, false);
	req.send(null);
	
	var html_doc = document.getElementsByTagName('head').item(0);
    var js = document.createElement('script');
    js.setAttribute('language', 'javascript');
    js.setAttribute('type', 'text/javascript');
	try{
		js.innerHTML = req.responseText;
		html_doc.appendChild(js);
	}
	catch(e){
		document.write("<script type='text/javascript'>\n"+ req.responseText + "\n</script>\n");
    }
	//eval(req.responseText);
	
	return false;
}

// -->
<!--


  // this function is need to work around 
  // a bug in IE related to element attributes
  function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  }   

 function stripe(id) {

    // the flag we'll use to keep track of 
    // whether the current row is odd or even
    var even = false;
  
    // if arguments are provided to specify the colours
    // of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    var evenColor = arguments[1] ? arguments[1] : "#fff";
    var oddColor = arguments[2] ? arguments[2] : "#eee";
  
    // obtain a reference to the desired table
    // if no such table exists, abort
    var table = document.getElementById(id);
    if (! table) { return; }
    
    // by definition, tables can have more than one tbody
    // element, so we'll have to get the list of child
    // &lt;tbody&gt;s 
    var tbodies = table.getElementsByTagName("tbody");

    // and iterate through them...
    for (var h = 0; h < tbodies.length; h++) {
    
     // find all the &lt;tr&gt; elements... 
      var trs = tbodies[h].getElementsByTagName("tr");
      
      // ... and iterate through them
      for (var i = 0; i < trs.length; i++) {

	    // avoid rows that have a class attribute
        // or backgroundColor style
	    if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
 
         // get all the cells in this row...
          var tds = trs[i].getElementsByTagName("td");
        
          // and iterate through them...
          for (var j = 0; j < tds.length; j++) {
        
            var mytd = tds[j];

            // avoid cells that have a class attribute
            // or backgroundColor style
	        if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
        
		      mytd.style.backgroundColor = even ? evenColor : oddColor;
              
            }
          }
        }
        // flip from odd to even, or vice-versa
        even =  ! even;
      }
    }
  }
function go_to_url(obj)
{
	q = obj.selectedIndex+1;
	$('#question-div').load('/content/questions-div.php?question='+q);
}
function go_to_faq(obj)
{
	q = obj.selectedIndex+1;
	$('#faq-div').load('/content/faq-div.php?question='+q);
}
function setTimeZone(obj)
{
	diff = obj.selectedIndex + 1;
	document.getElementById('timezone').value=obj.value;
	document.sortme.submit();
}
function montre(id,id1) {
var d = document.getElementById(id);
var f = document.getElementById(id1);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
		if (document.getElementById('menu'+i)) {document.getElementById('menu'+i).style.color='#555555';}
	}
if (d) {d.style.display='block';}
if (f) {f.style.color='#1A94C3';}
}
function clearCookies()
{
	$.cookie('finotec_web_main_blocks_position', 	null);
	$.cookie('finotec_web_main_blocks_state', 	null);
}

function savePos()
{
	
	var cookie_value = $.SortSerialize('sort1').o.sort1[0] + '::' + $.SortSerialize('sort1').o.sort1[1];
	$.cookie(
				'finotec_web_main_blocks_position', 
				cookie_value,
				{expires: 730}
			);
	
}

function saveState()
{
	
	var cookie_value =  $('#faq .content').css("display") + '::' +  $('#news-links .content').css("display");
	$.cookie(
				'finotec_web_main_blocks_state', 
				cookie_value,
				{expires: 730}
			);
}




function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) 
	{
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}


function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }	

function display_page(url,w,h) {
	newwindow=window.open(url,'name','scrollbars=1,height='+h+',width='+w);
	if (window.focus) {newwindow.focus()}
	return false;
}
function onchangetype()
{
	if (jQuery('#type')[0].value == 8)
	{
		jQuery('#affadd').show();
	//	jQuery('#join_forexcash')[0].action='http://www.forexcash.com/thankyou.php';
	}
	else
	{
		jQuery('#affadd').hide();
	//	jQuery('#join_forexcash')[0].action='http://www.finotec.com/partnership/thankyou.php';
	}
	
}
function adddomain()
{
	if($('#countDomains')[0].value < 10)
	{
		$('#disp_website'+(parseInt($('#countDomains')[0].value)+1))[0].style.display='block';
		$('#countDomains')[0].value = parseInt($('#countDomains')[0].value) + 1;
		if($('#countDomains')[0].value > 2)
		{
			$('#control'+$('#countDomains')[0].value)[0].style.display='inline';
			$('#control'+(parseInt($('#countDomains')[0].value)-1))[0].style.display='none';
		}
	}
}


	

function mainmenu(){
	$(" #cssdropdown ul ").css({display: "none"}); // Opera Fix
	$(" #cssdropdown li#mainitems").hover(
		function(){
			$(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown();
			if ( $("#selectLogin").length > 0 )$('#selectLogin')[0].style.width='144px';
		},
		function(){
			$(this).find('ul:first').css({visibility: "hidden"});
			if ( $("#selectLogin").length > 0 )$('#selectLogin')[0].style.width='228px';
		}
	);
}
 
$(document).ready(function(){
	mainmenu();
});


// -->
