var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var mX = 0;
var mY = 0;
ID_Floatie_Interval=0;

function getMouseXY(e) 
	{
	if (IE) 
		{
		mX = event.clientX + document.body.scrollLeft;
		mY = event.clientY + document.body.scrollTop;
		}
	else 
		{ 
		mX = e.pageX;
		mY = e.pageY;
		}  
	if (mX < 0)
		mX = 0;
	if (mY < 0)
		mY = 0;  
	return true;
	}

function mail_verification(mail)//verify good mail
	{	
	a=0;
	for(i=0;i<mail.length;i++)
		if(mail.charAt(i)=="." || mail.charAt(i)=="@")
			a++;
	if(a>=2)
		return true;
	return false;
	}

function popup_window(url,w,h)//popup window
	 {
	  var width=w;
	  var height=h;
	  var from_top=150;
	  var from_left=307;
	  var toolbar='no';
	  var location='no';
	  var directories='no';
	  var status='no';
	  var menubar='no';
	  var scrollbars='no';
	  var resizable='no';
	  var atts='width='+width+'show,height='+height+',top='+from_top+',screenY=';
	  atts+= from_top+',left='+from_left+',screenX='+from_left+',toolbar='+toolbar;
	  atts+=',location='+location+',directories='+directories+',status='+status;
	  atts+=',menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable;
	  window.open(url,'win_name',atts);
	 }
	 
function submit_form(fields,mail,form,err1,err2)//for submit verification
	{
	arr=fields.split("|");
	on=1;
	for(i=0;i<arr.length;i++)
		{
		if(document.getElementById(arr[i]).value=='')
			on=0;
		}
	if(on==0)
		alert(err1);
	else
		{
		if(mail_verification(document.getElementById(mail).value))	
			document.getElementById(form).submit();
		else
			alert(err2);
		}
	return false;
	}	
	
function put_value(elid,value)//put a value in an object
	{
	document.getElementById(elid).value=value;
	}
	
function get_sel_index(id_sel)
	{
	return document.getElementById(id_sel).selectedIndex;
	}

function get_sel_value(id_sel,index)
	{
	return document.getElementById(id_sel).options[index].value;
	}

function set_sel_index(id_sel,index)
	{
	document.getElementById(id_sel).selectedIndex=index;
	}

function make_invisible(id_el)
	{
	document.getElementById(id_el).style.display='none';
	}

function make_visible(id_el)
	{
	document.getElementById(id_el).style.display='block';
	}

//functions for floatie
//USAGE
//<a href="#" onmousemove="javascript: show_floatie('pula lu calu');" onmouseout="javascript: deactivate_floatie();">TEST</a>
function insert_floatie()
	{
	div='<div name="floatie" id="floatie" style="z-index:10; position:absolute; top:5px; left:100px; display:none;"></div>';
	document.write(div);
	}

function show_floatie(text)
	{
	ob=document.getElementById('floatie');
	//ob.style.zIndex=10;
	//ob.style.position="absolute";
	ob.style.top=(mY+20)+'px';
	ob.style.left=(mX+20)+'px';
	ob.innerHTML=text;
	ob.style.display='block';
	}

function deactivate_floatie()
	{
	ob=document.getElementById('floatie');
	ob.style.display='none';
	}
//
	
function get_Browser()
	{
	var nav = navigator.appName;
	nav = nav.toLowerCase();

	if (nav == 'microsoft internet explorer')
		return 'IE' + navigator.appVersion;
	else
		return 'NS' + navigator.appVersion;
	}
	
function redirect(URL)
	{
	window.location=URL;
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
