public boolean fToggle(String mode)
	{
		//get element
		WebElement objToggle = objCommon.getObject(btnToggle);
		if(objToggle==null) return false;
		
		String expectedState;
		if(mode.trim().equalsIgnoreCase("play")) expectedState = "true";
		else if(mode.trim().equalsIgnoreCase("pause")) expectedState = "false";
		else{
			Reporter.fnWriteToHtmlOutput("Toggle Mode", "Change to " + mode, "Inavlid Mode", "Fail");
			return false;
		}
		
		
		//get existing state
		String existingState = objToggle.getAttribute("checked");
		if(existingState.equalsIgnoreCase(expectedState)){
			Reporter.fnWriteToHtmlOutput("Toggle Mode", "Change to " + mode, "Mode already set to " + mode, "Done");
			return true;
		}
		else{
			
			//Click
			if(objCommon.fGuiClick(objToggle)==false) return false;
			
			try {
				Thread.sleep(3000);
			} catch (InterruptedException e) {
				e.printStackTrace();
				return false;
			}
		}	
		
		//validate state
		String actualState = objToggle.getAttribute("checked");
				
		if(actualState.equalsIgnoreCase(expectedState)){
			Reporter.fnWriteToHtmlOutput("Toggle State", "Toggle state should be " + expectedState, "Toggle state is " + expectedState, "Pass");
		}
		else{
			Reporter.fnWriteToHtmlOutput("Toggle State", "Toggle state should be " + expectedState, "Toggle state is not " + expectedState, "Fail");
			return false;
		}					
		
		return true;
	}