
function doOnmouseover() 
{
	thisTag = window.event.srcElement.tagName
	thisClass = window.event.srcElement.className
	subscript = window.event.srcElement.sourceIndex
	
	if (thisClass == "simple" || thisClass == "clsMenuBarItem") 		   
		document.all(subscript).style.color = "aa0000"	
}


function doOnmouseout() 
{
	thisTag = window.event.srcElement.tagName	
	thisClass = window.event.srcElement.className
	subscript = window.event.srcElement.sourceIndex
	
	if (thisClass == "simple" || thisClass == "clsMenuBarItem") {
		document.all(subscript).style.color = "ffffff"
	}
}

function popUp(url) 
{
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
	self.name = "mainWin"; 
}


function openFullWindow(url)
{
	newWindow = window.open(url, '', 'width=' + (window.screen.availWidth-5) + ',height=' + window.screen.availHeight + ',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1,top=0,left=0'); 
	newWindow.focus();
}


function openWindow(url, width, height)
{
	newWindow = window.open(url, '', 'width=' + width + ',height=' + height + ',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=1,top=0,left=0'); 
	newWindow.focus();
}



function openWin(url, features)
{
	if (features == undefined)
		newWindow = window.open(url); 
	else
		newWindow = window.open(url, '', features); 	
	newWindow.focus();
}


function SelectionsMove(sel,sel2)
{
	var i, len
	sel.selectedIndex = -1
	
	for(i = 0; i < sel2.length; i++)
	{
		if (sel2.options[i].selected)
		{
			len = sel.length
			sel.length = sel.length + 1
			sel.options[len].value = sel2.options[i].value
			sel.options[len].text  = sel2.options[i].text
			sel.options[len].selected = true
		}		
	}
	
	for(i = 0; i < sel2.length; i++)
	{
		if (sel2.options[i].selected)
		{
			sel2.options[i] = null
			i = i - 1
		}
	}				
	sel2.selectedIndex = -1		
}



function SelectionsSelectAll(sel)
{
	for(i=0; i<sel.length; i++)
		sel.options[i].selected = true
}




function SelectionsClearAll(sel)
{
	sel.selectedIndex = -1
}


function JsTrim(str) 
{
	return str.replace(/^\s+/gi, "").replace(/\s+$/gi, "");
}


function IsValidEmail(email)
{
    var invalidChars = new String(" /:,;'&");
    var invalidCharsSize = invalidChars.length;
    var atPos = -1;
    var periodPos = -1;

    for (var i=0; i < invalidCharsSize; i++)
    {
        var badchar = invalidChars.charAt(i);
        if (email.indexOf(badchar, 0) != -1) return false;
    }
    
    atPos = email.indexOf("@");
    if (atPos == -1 || atPos == 0) return false;
    if (email.indexOf("@", atPos+1) != -1) return false;
    
    periodPos = email.indexOf(".", atPos);
    if(periodPos == -1) return false;
    if (email.indexOf(".@") != -1) return false;
    if (email.indexOf("@.") != -1) return false;
    if (email.indexOf("..") != -1) return false;

    return true;
}
