// JavaScript Document

var event1 = '<div class="divmsgbold">Event 1</div><div class="divmsg">My First Event</div>';
 var msg1 = '<div class="divmsgbold">Your Name</div><div class="divmsg">Please enter your name. e.g. Sam D Costa or A K Gupta</div>';
 var msg2 = '<div class="divmsgbold">Your Email Id</div><div class="divmsg">Please enter your Email Id. e.g. mymailid@mail.com or test@test.com</div>';
 var msg3 = '<div class="divmsgbold">Your Comment Type</div><div class="divmsg">Please Choose Type of Comment Here.</div>';
 var msg4 = '<div class="divmsgbold">Comments</div><div class="divmsg">Please enter your Comments here.</div>'; 
 var msg6 = '<div class="divmsgbold">Department / Responsibility</div><div class="divmsg">What you do, rather than your job title. This allows members find other members based on what they do, such as marketing or research or what they are a responsible for, such as director. Please select the closest to what you do. If there\'s nothing appropriate please let us know.</div>';		 
 var msg7 = '<div class="divmsgbold">Business Area</div><div class="divmsg">Please select the sector of finance in which you work, such as hedge funds or derivatives. It will allow members to find other members based on business area as well as other criteria. Please select the closest. If there\'s nothing appropriate please let us know.</div>'; 
 var msg8 = '<div class="divmsgbold">Email Address</div><div class="divmsg">The Financial Net requires an email address from  a recognised firm for authentication, but members can select to use an alternative email address for communicating with other members.</div>';
 var msg9 = '<div class="divmsgbold">Correspondence Email ID</div><div class="divmsg">This is the email address to be used for communication with other members of The Financial Net. If not entered default is same as above</div>';
 var msg9a = '<div class="divmsgbold">Password</div><div class="divmsg">Minimum 7 characters. Must include at least 1 number.</div>';
 var msg10 = '<div class="divmsgbold">Personnel Interest</div><div class="divmsg">This will allow members to find other members with shared interests – such as tennis, opera, sailing or golf – to share news on events or perhaps send an invitation</div>';
 var msg11 = '<div class="divmsgbold">Department / Responsibility</div><div class="divmsg">If other is selected, please type the name in the box.</div>';
 var msg12 = '<div class="divmsgbold">Business Area</div><div class="divmsg">If other is selected, please type the name in the box.</div>';
 var msg13 = '<div class="divmsgbold">State</div><div class="divmsg">Required field if US is selected as Country.</div>';
 var msg14 = '<div class="divmsgbold">Country</div><div class="divmsg">Please choose from the list.</div>';
 var msg15 = '<div class="divmsgbold">Web Profile URL</div><div class="divmsg">Text can contain any combination of up to 12 characters and digits (a-z or 0-9), must be in lower case, and greater than one character. If the string contains an underscore (_) it should be followed by a character (a-z or 0-9).</div>';
 var msg16 = '<div class="divmsgbold">View Web Profile</div><div class="divmsg">The URL is accessible if profile is set to active, a character text in the profile text box added and profile saved.</div>';
 var msg17 = '<div class="divmsgbold">My Sector</div><div class="divmsg">To select multiple sectors please press the CTRL/SHIFT key.</div>';
 var msg18 = '<div class="divmsgbold">Everyone</div><div class="divmsg">If you choose your profile to be visible to everyone anyone in the network can see your profile.</div>';
 var msg19 = '<div class="divmsgbold">My Sectors</div><div class="divmsg">If you choose your profile to be visible to My sectors, all the members who are a part of your sectors can see your profile.</div>';
 var msg20 = '<div class="divmsgbold">My Connections</div><div class="divmsg">If you choose your profile to be visible to My connections, any member who is your connection can see your profile.</div>';
 var msg21 = '<div class="divmsgbold">Public Profile</div><div class="divmsg">If you choose your profile to be visible to Public Profile, then the profile can be accessed by anyone connected to the internet can see your profile and it is also searchable on google.</div>';
 var msg22 = '<div class="divmsgbold">Job Title</div><div class="divmsg">Required field which needs to be an alphabetical string.</div>';
 var msg23 = '<div class="divmsgbold">Organization Name</div><div class="divmsg">Required field which needs to be an alphabetical string.</div>';
 var msg24 = '<div class="divmsgbold">State</div><div class="divmsg">To be chosen if US is chosen as country.</div>'; 
 var msg25 = '<div class="divmsgbold">Country</div><div class="divmsg">Please choose from the list.</div>';
 var msg26 = '<div class="divmsgbold">Security Code</div><div class="divmsg">Required field. Must be the string displayed in the box.</div>'; 
 var msg27 = '<div class="divmsgbold">Image size</div><div class="divmsg">Should be less than 2 mb.</div>'; 
 var msg28 = '<div class="divmsgbold">First Name</div><div class="divmsg">First Name does not accept special characters.</div>'; 
 var msg29 = '<div class="divmsgbold">Last Name</div><div class="divmsg">Last Name does not accept special characters.</div>'; 
 var msg30 = '<div class="divmsgbold">Forum Display Name</div><div class="divmsg">Forum Display Name does not accept special characters.</div>';  
 var msg31 =  '<div class="divmsg">The Financial Net will forward all Requests to Connect immediately. Other updates by email, outlined here, are optional.</div>';
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}


function DefaultValue_OnFocus(control,msg)
{
	var tBox = document.getElementById(control);
	
	tBox.value = (tBox.value == msg || trim(tBox.value) == "") ? "" : tBox.value;
	tBox.className = "testBoxStyle";
	
}

function DefaultValue_OnBlur(control,msg)
{
	var tBox = document.getElementById(control);
	
	tBox.value = (tBox.value == msg || trim(tBox.value) == "") ? msg : tBox.value;
	tBox.className = (tBox.value == msg || trim(tBox.value) == "") ? "testBoxStyleDefault" : "testBoxStyle";
	
}


// Expandable
function switchMenu(obj,img) {
var el = document.getElementById(obj).style;

if ( el.display != 'block' ) {
el.display = 'block';

	if(img != "" )
	    {
			var im = document.getElementById(img);
			im.src = "../images/collapse.gif";
		 }
}

else {
el.display = 'none';
if(img != "" )
	    {
			var im = document.getElementById(img);
			im.src = "../images/expand.gif";
		 }

}
}
function showHide(obj) {

	document.getElementById("block1").style.display = (obj == "block1" ? "block" : "none") ;
	document.getElementById("block2").style.display = (obj == "block2" ? "block" : "none") ;
	document.getElementById("block3").style.display = (obj == "block3" ? "block" : "none") ;
	document.getElementById("block4").style.display = (obj == "block4" ? "block" : "none") ;
        document.getElementById("block5").style.display = (obj == "block5" ? "block" : "none") ;

}
function AddSelected() {
	
	
	var src = document.getElementById('SectorSector');
	var dst = document.getElementById('YourSelection');
	var flag = true;
	for(var i=0; i<src.options.length;i++) 
	{
		
                if(src.options[i].selected == true) 
		{
			var add = src.options[i].text;
                       	var dst = document.getElementById('YourSelection');
			for(var j = 0; j< dst.options.length;j++) {
			    var remove = dst.options[j].text;
                            	if(add == remove) {
					flag = false;
					break;
				}
			}
		
			if(flag == true) {
			dst.options[dst.options.length] = new Option(src.options[i].text,src.options[i].value, true, false)
			}
                       
		}
	}
	
}

function RemoveSelected() {
	
	var dst = document.getElementById('YourSelection');

	for(var i = dst.options.length - 1; i >= 0; i-- )
		{
			if(dst.options[i].selected == true)
			{
				dst.options[i] = null;	
			}
		}
		
}

function AddSelectedForum() {
	
	
	var src = document.getElementById('ForumForumID');
	var dst = document.getElementById('YourSelectionForum');
	var flag = true;
	for(var i=0; i<src.options.length;i++) 
	{
		
                if(src.options[i].selected == true) 
		{
			var add = src.options[i].text;
                       	var dst = document.getElementById('YourSelectionForum');
			for(var j = 0; j< dst.options.length;j++) {
			    var remove = dst.options[j].text;
                            	if(add == remove) {
					flag = false;
					break;
				}
			}
		
			if(flag == true) {
			dst.options[dst.options.length] = new Option(src.options[i].text,src.options[i].value, true, false)
			}
                       
		}
	}
	
}

function RemoveSelectedForum() {
	
	var dst = document.getElementById('YourSelectionForum');

	for(var i = dst.options.length - 1; i >= 0; i-- )
		{
			if(dst.options[i].selected == true)
			{
				dst.options[i] = null;	
			}
		}
		
}
