
function popWindow(name,url,obj) {
  switch ( name ) {
	case "sendmail":
     var NewWindow = window.open("http://www.fs-business.com/GlobalFiles/SendMail.asp?url="+url+"&subject="+obj, "sendmail", "width=400,height=370,resizable,scrollbars");
	  break;
	case "printTrade":
     var NewWindow = window.open("http://www.fs-business.com/Trade/Print.asp?id="+obj+"&url="+url, "print", "width=600,height=350,left=130,top=110,status=no,scrollbars=yes,resizable=yes,toolbar=no");
	  break;
	case "printFB":
     var NewWindow = window.open("http://www.fs-business.com/FireBrigade/Print.asp?id="+obj+"&url="+url, "print", "width=600,height=350,left=130,top=110,status=no,scrollbars=yes,resizable=yes,toolbar=no");
	  break;
	}
	
  if(!NewWindow.opener) {
	 NewWindow.opener = self;
	 }	
	 NewWindow.focus();
}

function CheckSearch(TheForm)
{	
   if (TheForm.search.value == "")
	{
		alert("You must enter keywords.");
		TheForm.search.focus();
		return(false);
	}
 return(true);		
}

function CheckSearchTop(TheForm)
{	
   if (TheForm.search.value == "")
	{
		alert("You must enter keywords.");
		TheForm.search.focus();
		return(false);
	}

   if (TheForm.searchOption[0].checked == true){ //search news
	 document.searchForm.method = "POST";
	 document.searchForm.action = "http://www.fs-world.com/searchResults.asp";
   }else if(TheForm.searchOption[1].checked == true){ //search events
	 document.searchForm.method = "POST";
	 document.searchForm.action = "http://www.fs-world.com/searchEventResults.asp";
   }else if(TheForm.searchOption[3].checked == true){ //search products
	 document.searchForm.method = "POST";
	 document.searchForm.action = "http://www.fs-business.com/ProductCenter/tableview.asp?search=ON";
	 document.searchForm.KeyWords.value = document.searchForm.search.value;
   }else if(TheForm.searchOption[4].checked == true){ //search buy & sell
	 document.searchForm.method = "POST";
	 document.searchForm.action = "http://www.fs-business.com/BuyNSell/searchResults.asp";
	 document.searchForm.type.value = "All";
   }else if(TheForm.searchOption[2].checked == true){ //Forum
	 document.searchForm.method = "POST";
	 document.searchForm.action = "http://www.fs-business.com/Forum/Search.asp?mode=doit";
   }

    return(true);		
}

function CheckEmail(TheForm)
{	
   if (TheForm.email.value == "")
	{
		alert("You must enter Email.");
		TheForm.email.focus();
		return(false);
	}
 return(true);		
}

x="http://www.fs-business.com/fs-world/"
//x="http://rgur/fs-world/"

function Contact(url){
  window.open(x + "contact.asp?Page="+url);
}

// function to change background colour of leftmenu
function bg(obj,col) {
	//obj.style.backgroundColor = col;
	switch ( col ) {
		case 0:
			obj.style.backgroundColor = '#EEEEED'; //'#E07D29';
			break;
		case 1:
			obj.style.backgroundColor = '#D9D9D9';
			break;
		case 2:
			obj.style.backgroundColor = '#ffffff';
			break;
		}
}



// Get the date
function getDate(){
	var today = new Date();
	var day = today.getDay();
	var dday = today.getDate();
	var mon = today.getMonth();
	var year = today.getFullYear();
	var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
	var mons = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
	var outStr = days[day] + ' ' + mons[mon] + ' ' + dday + ', ' + year;
	return outStr;
}


function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}



// function to change background color of Tables
function TableBG(obj,col) {
 if (navigator.appVersion.charAt(navigator.appVersion.indexOf("MSIE") + 5) >= 5 && navigator.platform.indexOf("Win16") == -1 && navigator.platform.indexOf("Mac") == -1){
	switch ( col ) {
		case 0: // OnMouseOver
			obj.style.backgroundColor = '#6699CC';
			break;
		case 1: // OnMouseOut
			obj.style.backgroundColor = '#214F7E';
			break;
		}
  }	
}
