var bsIE6 = (navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("MSIE 7") == -1);

if (bsIE6) {
	window.onload = function() {
		var menuItems = document.getElementById('menuMain').getElementsByTagName('LI');
		for (var i = 0; i < menuItems.length; i++) {
			menuItems[i].onmouseover = function() { this.className += " hover"; }
			menuItems[i].onmouseout = function() { this.className = this.className.replace(" hover", ""); }
		}
		DisableButtons();
		ActiveJavaButtons();
	}
}
else
{
	window.onload = function() {
		DisableButtons();
		ActiveJavaButtons();
	}
}

function DisableButtons()
{
	if(document.getElementById('save')!=null)document.getElementById('save').disabled=false;
	if(document.getElementById('sendtest0')!=null)document.getElementById('sendtest0').disabled=false;
	if(document.getElementById('sendbulk0')!=null)document.getElementById('sendbulk0').disabled=false;
	
	
}

function ActiveJavaButtons()
{

	//Login Form
	if(document.getElementById('Login_Button')!=null)
	{
		document.getElementById('Login_Button').onclick=function()
		{
			
	   	  document.forms['Form_login'].submit();
		
		} 

	}
	
	
//NewsLetter Form
	if(document.getElementById('savenews')!=null)
	{
		document.getElementById('savenews').onclick=function()
		{
			if(FrontPage_Form2_Validator(document.forms['FrontPage_Form2'])) 
				document.forms['FrontPage_Form2'].submit();
		
		} 
	}

	if(document.getElementById('SendTest2')!=null)
	{
		document.getElementById('SendTest2').onclick=function()
		{
			if(FrontPage_Form2_Validator(document.forms['FrontPage_Form2'])) 
			{
				document.forms['FrontPage_Form2'].sendtest.value="Send test";
				document.forms['FrontPage_Form2'].submit();
			}
			
		} 
	}

	if(document.getElementById('sendBulk2')!=null)
	{
		document.getElementById('sendBulk2').onclick=function()
		{
			if(FrontPage_Form2_Validator(document.forms['FrontPage_Form2'])) 
			{
				document.forms['FrontPage_Form2'].sendbulk.value="Continue";
				document.forms['FrontPage_Form2'].submit();return false;
			}
		
		} 

	
	}



	if(document.getElementById('submittemplate')!=null)
	{
		document.getElementById('submittemplate').onclick=function()
		{
			
			document.forms['formimagelink'].submit();
		
		} 
	}

	//send message
	if(document.getElementById('sendmsg')!=null)
	{
		document.getElementById('sendmsg').onclick=function()
		{
			
			document.forms['FormSendMsg'].submit();
		
		} 
	}

//Export
	if(document.getElementById('Export_button')!=null)
	{
		
					
		document.getElementById('Export_button').onclick=function()
		 {
			document.forms['Export_Form'].submit();
		 }
		
	}

	if(document.getElementById('exportnext')!=null)
	{
		
					
		document.getElementById('exportnext').onclick=function()
		 {
			document.forms['formnext'].submit();
		 }
		
	}

//Subscribers

	if(document.getElementById('Bulk_button')!=null)
	{
					
		document.getElementById('Bulk_button').onclick=function()
		 {
			if(FrontPage_Form2_Validator(document.forms['FrontPage_Form2']))
					document.forms['FrontPage_Form2'].submit();
		 }
		
	}


	
	if(document.getElementById('Bulk_button2')!=null)
	{
					
		document.getElementById('Bulk_button2').onclick=function()
		 {
			if(FrontPage_Form1_Validator(document.forms['FrontPage_Form1']))
					document.forms['FrontPage_Form1'].submit();
		 }
		
	}
	//remove bulk

	if(document.getElementById('removebulk')!=null)
	{
					
		document.getElementById('removebulk').onclick=function()
		 {
			if(FrontPage_Form3_Validator(document.forms['FrontPage_Form3']))
					document.FrontPage_Form3.submit()
		 }
		
	}

	//add bulk
	if(document.getElementById('addsubscriber')!=null)
	{
					
		document.getElementById('addsubscriber').onclick=function()
		 {
			if(FrontPage_Form2_Validator(document.forms['FrontPage_Form2'])) 
				document.forms['FrontPage_Form2'].submit();				
		 }
		
	}

	//add new subscriber
	if(document.getElementById('addnewsub')!=null)
	{
					
		document.getElementById('addnewsub').onclick=function()
		 {
			if(FrontPage_Form1_Validator(document.forms['FrontPage_Form1'])) 
				document.forms['FrontPage_Form1'].submit();				
		 }
		
	}

//Reports
	//executive
	if(document.getElementById('executive')!=null)
	{
					
		document.getElementById('executive').onclick=function()
		 {
			document.forms['FormExecutive'].submit();
		 }
		
	}

	
	//views and clicks
	if(document.getElementById('viewsclicks')!=null)
	{
					
		document.getElementById('viewsclicks').onclick=function()
		 {
			document.forms['FormReport'].submit();
		 }
		
	}

	//subscriptions by date
	if(document.getElementById('subscriptions')!=null)
	{
					
		document.getElementById('subscriptions').onclick=function()
		 {
			document.forms['Report'].submit();
		 }
		
	}

	//forward to a friend
	if(document.getElementById('forwardsexport')!=null)
	{
					
		document.getElementById('forwardsexport').onclick=function()
		 {
			document.forms['FormExcel'].submit();
		 }
		
	}

//Lists
	//add new
	if(document.getElementById('createlist')!=null)
	{
					
		document.getElementById('createlist').onclick=function()
		 {
			document.FrontPage_Form1.submit();
		 }
		
	}
//Tools
	//Search
	if(document.getElementById('searchx')!=null)
	{
					
		document.getElementById('searchx').onclick=function()
		 {
			if(FrontPage_Form1_Validator(document.forms['FrontPage_Form1'])) 
				document.forms['FrontPage_Form1'].submit();
		 }
		
	}

	//preferences
	if(document.getElementById('preferences')!=null)
	{
					
		document.getElementById('preferences').onclick=function()
		 {
			if(FrontPage_Form1_Validator(document.forms['FrontPage_Form1'])) 
				document.forms['FrontPage_Form1'].submit();
		 }
		
	}
}
